From 94ca386a8c298265fa5fb19ee2ec2be3db335502 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 5 Sep 2022 21:36:22 +0200 Subject: [PATCH] set last monitor and dont refocus in some cases (changeworkspace) --- src/managers/KeybindManager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index c1ef0cfe..d5b6014a 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -658,9 +658,12 @@ void CKeybindManager::changeworkspace(std::string args) { if (g_pCompositor->cursorOnReservedArea()) // fix focus on bars etc g_pInputManager->refocus(); - } else + } else if (g_pCompositor->getWindowsOnWorkspace(PWORKSPACETOCHANGETO->m_iID) > 0) g_pInputManager->refocus(); + // set the new monitor as the last (no warps would bug otherwise) + g_pCompositor->m_pLastMonitor = g_pCompositor->getMonitorFromID(PWORKSPACETOCHANGETO->m_iMonitorID); + // mark the monitor dirty g_pHyprRenderer->damageMonitor(PMONITOR);