summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2022-08-06 21:05:19 +0200
committervaxerski <vaxry@vaxry.net>2022-08-06 21:05:19 +0200
commit68fd97fae967fa72589baa4007c3511fb5779cdc (patch)
treeb684b723540c43b1bbbbd54cebcb19e65b481d60 /src
parent1b109d92424d70baf8ef9d96490f7b6ef98f8466 (diff)
change workspace in focusWindow if necessary
Diffstat (limited to 'src')
-rw-r--r--src/Compositor.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index c0ecb7f1..2d875ccd 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -624,6 +624,9 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) {
if (m_pLastWindow == pWindow && m_sSeat.seat->keyboard_state.focused_surface == pSurface)
return;
+ if (!isWorkspaceVisible(pWindow->m_iWorkspaceID))
+ g_pKeybindManager->changeworkspace("[internal]" + std::to_string(pWindow->m_iWorkspaceID));
+
const auto PLASTWINDOW = m_pLastWindow;
m_pLastWindow = pWindow;
@@ -1549,10 +1552,10 @@ void CCompositor::closeWindow(CWindow* pWindow) {
g_pXWaylandManager->sendCloseWindow(pWindow);
if (pWindow == m_pLastWindow) {
- g_pCompositor->m_pLastFocus = nullptr;
- g_pCompositor->m_pLastWindow = nullptr;
+ m_pLastFocus = nullptr;
+ m_pLastWindow = nullptr;
g_pEventManager->postEvent(SHyprIPCEvent{"activewindow", ","}); // post an activewindow event to empty, as we are currently unfocused
- g_pCompositor->focusWindow(g_pCompositor->windowFromCursor());
+ focusWindow(windowFromCursor());
}
}
} \ No newline at end of file