diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-02-13 17:53:50 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-02-13 17:53:50 +0000 |
| commit | 95abf1220f56acbe88517799fc4b92be2e908575 (patch) | |
| tree | c3c1d4e64ba9b19701c25a0413285dd092321cd0 /src/Compositor.cpp | |
| parent | b500e5699b9aa0f5a92805707bcc88ba151a7c82 (diff) | |
keybinds: fix swapactiveworkspaces not moving focus
fixes #4626
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 0d336506..0c65b67f 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -2019,7 +2019,11 @@ void CCompositor::swapActiveWorkspaces(CMonitor* pMonitorA, CMonitor* pMonitorB) updateFullscreenFadeOnWorkspace(PWORKSPACEB); updateFullscreenFadeOnWorkspace(PWORKSPACEA); - g_pInputManager->sendMotionEventsToFocused(); + if (pMonitorA->ID == g_pCompositor->m_pLastMonitor->ID || pMonitorB->ID == g_pCompositor->m_pLastMonitor->ID) { + const auto LASTWIN = pMonitorA->ID == g_pCompositor->m_pLastMonitor->ID ? PWORKSPACEB->getLastFocusedWindow() : PWORKSPACEA->getLastFocusedWindow(); + g_pCompositor->focusWindow(LASTWIN ? LASTWIN : + (g_pCompositor->vectorToWindowUnified(g_pInputManager->getMouseCoordsInternal(), RESERVED_EXTENTS | INPUT_EXTENTS | ALLOW_FLOATING))); + } // event g_pEventManager->postEvent(SHyprIPCEvent{"moveworkspace", PWORKSPACEA->m_szName + "," + pMonitorB->szName}); |
