Skip to content

Commit

Permalink
session_lock: Verify BufferAssignment is NewBuffer in attached bu…
Browse files Browse the repository at this point in the history
…ffer check
  • Loading branch information
Ottatop authored and Drakulix committed May 17, 2024
1 parent 271fbc0 commit 900b938
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/wayland/session_lock/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,14 @@ where
// Ensure surface has no existing buffers attached.
let has_buffer = compositor::with_states(&surface, |states| {
let cached = &states.cached_state;
let pending = cached.pending::<SurfaceAttributes>().buffer.is_some();
let current = cached.current::<SurfaceAttributes>().buffer.is_some();
let pending = matches!(
cached.pending::<SurfaceAttributes>().buffer,
Some(BufferAssignment::NewBuffer(_))
);
let current = matches!(
cached.current::<SurfaceAttributes>().buffer,
Some(BufferAssignment::NewBuffer(_))
);
pending || current
});
if has_buffer {
Expand Down

0 comments on commit 900b938

Please sign in to comment.