From 18f9fb5e0fdb3fdc1aebe61b3c589bc23aed1e9f Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 4 Jul 2023 12:05:25 +0200 Subject: rules: add stayfocused --- src/managers/input/InputManager.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/managers/input/InputManager.cpp') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 9dd6e5da..ce61a665 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -98,10 +98,15 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { if (*PZOOMFACTOR != 1.f) g_pHyprRenderer->damageMonitor(PMONITOR); - if (m_pForcedFocus) { - pFoundWindow = m_pForcedFocus; + CWindow* forcedFocus = m_pForcedFocus; + + if (!forcedFocus) + forcedFocus = g_pCompositor->getForceFocus(); + + if (forcedFocus) { + pFoundWindow = forcedFocus; surfacePos = pFoundWindow->m_vRealPosition.vec(); - foundSurface = m_pForcedFocus->m_pWLSurface.wlr(); + foundSurface = pFoundWindow->m_pWLSurface.wlr(); } // constraints -- cgit v1.2.3