mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 16:25:59 +01:00
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:
parent
a958884b52
commit
72d78eff95
1 changed files with 11 additions and 0 deletions
|
@ -172,6 +172,17 @@ bool CSessionLockManager::isSurfaceSessionLock(wlr_surface* pSurface) {
|
||||||
|
|
||||||
void CSessionLockManager::removeSessionLockSurface(SSessionLockSurface* pSLS) {
|
void CSessionLockManager::removeSessionLockSurface(SSessionLockSurface* pSLS) {
|
||||||
std::erase_if(m_sSessionLock.vSessionLockSurfaces, [&](const auto& other) { return pSLS == other.get(); });
|
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() {
|
void CSessionLockManager::activateLock() {
|
||||||
|
|
Loading…
Reference in a new issue