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
This commit is contained in:
drendog 2024-03-15 19:44:17 +01:00 committed by GitHub
parent a958884b52
commit 72d78eff95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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