sessionLock: fix focus not being tied to mouse (#6414)

This commit is contained in:
outfoxxed 2024-06-11 08:11:15 -07:00 committed by GitHub
parent 90d0097716
commit 809820921d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -155,6 +155,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
Vector2D surfacePos = Vector2D(-1337, -1337); Vector2D surfacePos = Vector2D(-1337, -1337);
PHLWINDOW pFoundWindow; PHLWINDOW pFoundWindow;
PHLLS pFoundLayerSurface; PHLLS pFoundLayerSurface;
SSessionLockSurface* pSessionLock = nullptr;
if (!g_pCompositor->m_bReadyToProcess || g_pCompositor->m_bIsShuttingDown || g_pCompositor->m_bUnsafeState) if (!g_pCompositor->m_bReadyToProcess || g_pCompositor->m_bIsShuttingDown || g_pCompositor->m_bUnsafeState)
return; return;
@ -261,12 +262,12 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
g_pCompositor->setActiveMonitor(PMONITOR); g_pCompositor->setActiveMonitor(PMONITOR);
if (g_pSessionLockManager->isSessionLocked()) { 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; return;
foundSurface = PSLS->surface->surface(); foundSurface = pSessionLock->surface->surface();
surfacePos = PMONITOR->vecPosition; surfacePos = PMONITOR->vecPosition;
} }
@ -455,7 +456,9 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
restoreCursorIconToApp(); restoreCursorIconToApp();
} }
if (pFoundWindow) { if (pSessionLock != nullptr)
g_pCompositor->focusSurface(foundSurface);
else if (pFoundWindow) {
// change cursor icon if hovering over border // change cursor icon if hovering over border
if (*PRESIZEONBORDER && *PRESIZECURSORICON) { if (*PRESIZEONBORDER && *PRESIZECURSORICON) {
if (!pFoundWindow->m_bIsFullscreen && !pFoundWindow->hasPopupAt(mouseCoords)) { if (!pFoundWindow->m_bIsFullscreen && !pFoundWindow->hasPopupAt(mouseCoords)) {