wlx-capture: avoid busy loop waiting for screencopy events

This commit is contained in:
hiina 2026-06-08 22:38:37 -06:00
parent 6dc76c881f
commit 826ec2c0b3
1 changed files with 6 additions and 0 deletions

View File

@ -227,7 +227,9 @@ where
let mut maybe_dmabuf = None;
'receiver: loop {
let mut received_event = false;
for event in rx.try_iter() {
received_event = true;
match event {
ScreenCopyEvent::Buffer { .. } => {
log::trace!("{name}: ScreenCopy Buffer event received");
@ -367,6 +369,10 @@ where
}
};
}
if !received_event {
client.dispatch();
}
}
(client, user_data)