don't swap workspaces if monitors are the same (#2322)

Return swapActiveWorkspaces early if MON1 and MON2 are equals, to avoid
buggy behavior.
This commit is contained in:
Anthony Ruhier 2023-05-17 14:31:03 +02:00 committed by GitHub
parent 642030f959
commit 9ef7225532
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1872,7 +1872,7 @@ void CKeybindManager::swapActiveWorkspaces(std::string args) {
const auto PMON1 = g_pCompositor->getMonitorFromString(MON1); const auto PMON1 = g_pCompositor->getMonitorFromString(MON1);
const auto PMON2 = g_pCompositor->getMonitorFromString(MON2); const auto PMON2 = g_pCompositor->getMonitorFromString(MON2);
if (!PMON1 || !PMON2) if (!PMON1 || !PMON2 || PMON1 == PMON2)
return; return;
g_pCompositor->swapActiveWorkspaces(PMON1, PMON2); g_pCompositor->swapActiveWorkspaces(PMON1, PMON2);