summaryrefslogtreecommitdiff
path: root/src/managers/input/InputManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-07-04 12:05:25 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-07-04 12:05:25 +0200
commit18f9fb5e0fdb3fdc1aebe61b3c589bc23aed1e9f (patch)
tree74cd33c195e5486a7a998ade7e29c715032d06c8 /src/managers/input/InputManager.cpp
parent6f91997f069a92c23886888e51c27d02d50a6a96 (diff)
rules: add stayfocused
Diffstat (limited to 'src/managers/input/InputManager.cpp')
-rw-r--r--src/managers/input/InputManager.cpp11
1 files changed, 8 insertions, 3 deletions
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