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
1 changed files with 7 additions and 4 deletions

View File

@ -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)) {