summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp16
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;
}