diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-03-20 19:14:17 +0100 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-03-20 19:14:17 +0100 |
| commit | 23ec4793e18949f32c4954b46ff2e724dc1e6f31 (patch) | |
| tree | 79c991a1d4a0b9aaeb3867c9c41d9eeb885be99c /src/managers/KeybindManager.cpp | |
| parent | f3d703335db50269c37819cd36712dc7c2e674cf (diff) | |
fix xwayland windows grabbing mouse when hidden
Diffstat (limited to 'src/managers/KeybindManager.cpp')
| -rw-r--r-- | src/managers/KeybindManager.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 68f6dbc4..2dedf22c 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -100,9 +100,21 @@ void CKeybindManager::changeworkspace(std::string args) { const auto PMONITOR = g_pCompositor->getMonitorFromID(g_pCompositor->getWorkspaceByID(workspaceToChangeTo)->monitorID); // if it's not visible, make it visible. - if (!g_pCompositor->isWorkspaceVisible(workspaceToChangeTo)) + if (!g_pCompositor->isWorkspaceVisible(workspaceToChangeTo)) { + const auto OLDWORKSPACEID = PMONITOR->activeWorkspace; + + // change it PMONITOR->activeWorkspace = workspaceToChangeTo; + // we need to move XWayland windows to narnia or otherwise they will still process our cursor and shit + // and that'd be annoying as hell + g_pCompositor->fixXWaylandWindowsOnWorkspace(OLDWORKSPACEID); + + // and fix on the new workspace + g_pCompositor->fixXWaylandWindowsOnWorkspace(PMONITOR->activeWorkspace); + } + + // If the monitor is not the one our cursor's at, warp to it. if (PMONITOR != g_pCompositor->getMonitorFromCursor()) { Vector2D middle = PMONITOR->vecPosition + PMONITOR->vecSize / 2.f; @@ -111,7 +123,7 @@ void CKeybindManager::changeworkspace(std::string args) { // focus the first window g_pCompositor->focusWindow(g_pCompositor->getFirstWindowOnWorkspace(workspaceToChangeTo)); - + return; } |
