summaryrefslogtreecommitdiff
path: root/src/managers/SessionLockManager.cpp
diff options
context:
space:
mode:
authordrendog <53359960+drendog@users.noreply.github.com>2024-03-15 19:44:17 +0100
committerGitHub <noreply@github.com>2024-03-15 18:44:17 +0000
commit72d78eff95948a3eb3260791cfdf625c0102d33a (patch)
treec708b512c0977cd2310e686ec5a9a907e27618c4 /src/managers/SessionLockManager.cpp
parenta958884b5259ec5d6a2c97078b373c722ae20c39 (diff)
sessionlock: refocus after destroy focused surface (#5117)
* fix: refocus after destroy focused surface * refactor: minor refactor on refocus loop condition * refactor: minor refactor on condition * style: format code
Diffstat (limited to 'src/managers/SessionLockManager.cpp')
-rw-r--r--src/managers/SessionLockManager.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/managers/SessionLockManager.cpp b/src/managers/SessionLockManager.cpp
index 1e366034..a0374b85 100644
--- a/src/managers/SessionLockManager.cpp
+++ b/src/managers/SessionLockManager.cpp
@@ -172,6 +172,17 @@ bool CSessionLockManager::isSurfaceSessionLock(wlr_surface* pSurface) {
void CSessionLockManager::removeSessionLockSurface(SSessionLockSurface* pSLS) {
std::erase_if(m_sSessionLock.vSessionLockSurfaces, [&](const auto& other) { return pSLS == other.get(); });
+
+ if (g_pCompositor->m_pLastFocus)
+ return;
+
+ for (auto& sls : m_sSessionLock.vSessionLockSurfaces) {
+ if (!sls->mapped)
+ continue;
+
+ g_pCompositor->focusSurface(sls->pWlrLockSurface->surface);
+ break;
+ }
}
void CSessionLockManager::activateLock() {