session-lock: wait for present before locking

Currently we send the locked event after rendering and commit of blank
or lock surfaces buffers on all outputs. However, this is technically
not enough to ensure that the buffers have been presented.

Instead, listen to the wlr_output present event to ensure that no
normal, "unlocked" content is possibly visible.
This commit is contained in:
Isaac Freund
2023-01-06 18:51:40 +01:00
parent c479525ab8
commit df2fc30238
3 changed files with 46 additions and 4 deletions

View File

@ -98,9 +98,10 @@ pub fn renderOutput(output: *Output) void {
return;
};
output.lock_render_state = if (output.lock_surface != null) .lock_surface else .blanked;
if (server.lock_manager.state != .locked) {
server.lock_manager.maybeLock();
if (output.lock_surface == null) {
output.lock_render_state = .pending_blank;
} else {
output.lock_render_state = .pending_lock_surface;
}
return;