aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2023-01-20 20:57:35 +0100
committervaxerski <[email protected]>2023-01-20 20:57:35 +0100
commit434719611d4295f7fab72f969d40ac32cbd7865a (patch)
tree6026146eed0dfcd09401b1200e22163f0a3ff2a0
parent5814d9b2a01c9c1d07fef023ad12196d49dd4780 (diff)
downloadHyprland-434719611d4295f7fab72f969d40ac32cbd7865a.tar.gz
Hyprland-434719611d4295f7fab72f969d40ac32cbd7865a.zip
fix focus history on workspace jumps
-rw-r--r--src/Compositor.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index 574c9575..f5918192 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -808,8 +808,14 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) {
if (pWindow->m_bPinned)
pWindow->m_iWorkspaceID = m_pLastMonitor->activeWorkspace;
- if (!isWorkspaceVisible(pWindow->m_iWorkspaceID))
+ if (!isWorkspaceVisible(pWindow->m_iWorkspaceID)) {
+ // This is to fix incorrect feedback on the focus history.
+ const auto PWORKSPACE = getWorkspaceByID(pWindow->m_iWorkspaceID);
+ PWORKSPACE->m_pLastFocusedWindow = pWindow;
g_pKeybindManager->changeworkspace("[internal]" + std::to_string(pWindow->m_iWorkspaceID));
+ // changeworkspace already calls focusWindow
+ return;
+ }
const auto PLASTWINDOW = m_pLastWindow;
m_pLastWindow = pWindow;