From e4d09aa3a9de9a9e71c10bf4b6800585b3db9a4c Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Tue, 25 Jun 2024 14:22:38 -0700 Subject: [PATCH] sessionLock: focus lock on creation based on mouse position (#6658) * sessionLock: focus lock on creation based on mouse position * sessionLock: immediately unfocus any focused surfaces on lock --- src/managers/SessionLockManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/managers/SessionLockManager.cpp b/src/managers/SessionLockManager.cpp index 3bec1c4b..b4695e0e 100644 --- a/src/managers/SessionLockManager.cpp +++ b/src/managers/SessionLockManager.cpp @@ -10,7 +10,7 @@ SSessionLockSurface::SSessionLockSurface(SP surface_) : sur listeners.map = surface_->events.map.registerListener([this](std::any data) { mapped = true; - g_pCompositor->focusSurface(surface->surface()); + g_pInputManager->simulateMouseMovement(); const auto PMONITOR = g_pCompositor->getMonitorFromID(iMonitorID); @@ -78,6 +78,7 @@ void CSessionLockManager::onNewSessionLock(SP pLock) { }); pLock->sendLocked(); + g_pCompositor->focusSurface(nullptr); } bool CSessionLockManager::isSessionLocked() {