session-lock: send locked after the lock screen is properly rendered (#6850)

The protocol says:
> The locked event "must not be sent until a new "locked" frame (either from a
> session lock surface or the compositor blanking the output) has been presented
> on all outputs and no security sensitive normal/unlocked content is possibly
> visible".

This helps users ensure the screen is properly locked before suspending
the machine. (e.g. with swaylock --ready-fd)
This commit is contained in:
Junxuan Liao
2024-07-13 18:32:08 +08:00
committed by GitHub
parent f85c6416c6
commit 7486576fa7
3 changed files with 23 additions and 3 deletions

View File

@@ -990,8 +990,11 @@ void CHyprRenderer::renderLockscreen(CMonitor* pMonitor, timespec* now, const CB
if (ALPHA < 1.f) /* animate */
damageMonitor(pMonitor);
else
g_pSessionLockManager->onLockscreenRenderedOnMonitor(pMonitor->ID);
} else {
renderSessionLockSurface(PSLS, pMonitor, now);
g_pSessionLockManager->onLockscreenRenderedOnMonitor(pMonitor->ID);
}
}
}