diff --git a/src/ui/window.rs b/src/ui/window.rs index 343f960..7635a0b 100644 --- a/src/ui/window.rs +++ b/src/ui/window.rs @@ -162,6 +162,10 @@ mod imp { loop { let window = window.upgrade().unwrap(); let listener = window.imp().mpv.wakeup_listener(); + + // only send property change notifications after the event queue is drained + let freeze_notify = window.freeze_notify(); + while let Some(event) = window.imp().mpv.wait_event(0.0) { use crate::mpv::Event; @@ -186,6 +190,9 @@ mod imp { _ => event!(Level::DEBUG, "unhandled {event:?}"), } } + + // send property change notifications now + drop(freeze_notify); drop(window); listener.await; }