From ba3cd74a681130771bb032c4284962b439ee3fbc Mon Sep 17 00:00:00 2001 From: Erica Z Date: Wed, 6 Nov 2024 12:30:02 +0100 Subject: [PATCH] try delaying notify signal --- src/ui/window.rs | 7 +++++++ 1 file changed, 7 insertions(+) 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; }