From ba9a8a9ded02b5af182b0dfcb46da1769060fbba Mon Sep 17 00:00:00 2001 From: vaxerski Date: Tue, 25 Oct 2022 14:19:24 +0100 Subject: unify LS unmap focus --- src/managers/XWaylandManager.cpp | 6 ++++-- src/managers/input/InputManager.cpp | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/managers') diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp index e9980075..4a0b397d 100644 --- a/src/managers/XWaylandManager.cpp +++ b/src/managers/XWaylandManager.cpp @@ -62,8 +62,10 @@ void CHyprXWaylandManager::activateWindow(CWindow* pWindow, bool activate) { else wlr_xdg_toplevel_set_activated(pWindow->m_uSurface.xdg->toplevel, activate); - g_pCompositor->m_pLastFocus = getWindowSurface(pWindow); - g_pCompositor->m_pLastWindow = pWindow; + if (activate) { + g_pCompositor->m_pLastFocus = getWindowSurface(pWindow); + g_pCompositor->m_pLastWindow = pWindow; + } if (!pWindow->m_bPinned) g_pCompositor->getWorkspaceByID(pWindow->m_iWorkspaceID)->m_pLastFocusedWindow = pWindow; diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 64963041..d76810e3 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -311,7 +311,6 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { } else { if (pFoundLayerSurface && pFoundLayerSurface->layerSurface->current.keyboard_interactive && *PFOLLOWMOUSE != 3 && allowKeyboardRefocus) { g_pCompositor->focusSurface(foundSurface); - g_pCompositor->m_pLastWindow = nullptr; // reset last window as we have a full focus on a LS } if (pFoundLayerSurface) -- cgit v1.2.3