EWMH desktop counting fix

This commit is contained in:
vaxerski 2022-03-08 20:14:01 +01:00
parent 0138a072ca
commit 56c3cff855

View file

@ -75,11 +75,11 @@ void EWMH::updateDesktops() {
if (!g_pWindowManager->getMonitorFromCursor()) {
Debug::log(ERR, "Monitor was null! (updateDesktops EWMH) Using LastWindow");
if (const auto PWINDOW = g_pWindowManager->getWindowFromDrawable(g_pWindowManager->LastWindow); PWINDOW)
ACTIVEWORKSPACE = g_pWindowManager->activeWorkspaces[PWINDOW->getWorkspaceID()];
ACTIVEWORKSPACE = g_pWindowManager->activeWorkspaces[PWINDOW->getWorkspaceID()] - 1; // because xorg counts from zero
else
ACTIVEWORKSPACE = 0;
} else {
ACTIVEWORKSPACE = g_pWindowManager->activeWorkspaces[g_pWindowManager->getMonitorFromCursor()->ID];
ACTIVEWORKSPACE = g_pWindowManager->activeWorkspaces[g_pWindowManager->getMonitorFromCursor()->ID] - 1;
}
if (DesktopInfo::lastid != ACTIVEWORKSPACE) {