diff options
| author | outfoxxed <outfoxxed@outfoxxed.me> | 2024-06-11 08:11:15 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-11 17:11:15 +0200 |
| commit | 809820921d9844e1bc09b843392fd7d277b83f73 (patch) | |
| tree | a4bdf786024b0af697526910724c9226c91b7c91 /src/managers/input/InputManager.cpp | |
| parent | 90d00977169e8478b5f4c27ec0a364a7ec11b0aa (diff) | |
sessionLock: fix focus not being tied to mouse (#6414)
Diffstat (limited to 'src/managers/input/InputManager.cpp')
| -rw-r--r-- | src/managers/input/InputManager.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index ff10f303..5ce53472 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -155,6 +155,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { Vector2D surfacePos = Vector2D(-1337, -1337); PHLWINDOW pFoundWindow; PHLLS pFoundLayerSurface; + SSessionLockSurface* pSessionLock = nullptr; if (!g_pCompositor->m_bReadyToProcess || g_pCompositor->m_bIsShuttingDown || g_pCompositor->m_bUnsafeState) return; @@ -261,12 +262,12 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { g_pCompositor->setActiveMonitor(PMONITOR); if (g_pSessionLockManager->isSessionLocked()) { - const auto PSLS = PMONITOR ? g_pSessionLockManager->getSessionLockSurfaceForMonitor(PMONITOR->ID) : nullptr; + pSessionLock = PMONITOR ? g_pSessionLockManager->getSessionLockSurfaceForMonitor(PMONITOR->ID) : nullptr; - if (!PSLS) + if (!pSessionLock) return; - foundSurface = PSLS->surface->surface(); + foundSurface = pSessionLock->surface->surface(); surfacePos = PMONITOR->vecPosition; } @@ -455,7 +456,9 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { restoreCursorIconToApp(); } - if (pFoundWindow) { + if (pSessionLock != nullptr) + g_pCompositor->focusSurface(foundSurface); + else if (pFoundWindow) { // change cursor icon if hovering over border if (*PRESIZEONBORDER && *PRESIZECURSORICON) { if (!pFoundWindow->m_bIsFullscreen && !pFoundWindow->hasPopupAt(mouseCoords)) { |
