From 9a03925e627ba223c070a04568cb027bc39f15e0 Mon Sep 17 00:00:00 2001 From: GhostNaN Date: Wed, 24 Apr 2024 21:43:34 -0400 Subject: [PATCH] Unclog wl_display with wl_display_dispatch_pending() For some reason on Nvidia pro drivers the frame_callback won't get called back after some random time. Calling wl_display_dispatch_pending() seems to get it unstuck with no negative effects I can see. So while this feels like a hack, I'm going to just let it go. --- src/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.c b/src/main.c index 90abcdb..bb6c5ba 100644 --- a/src/main.c +++ b/src/main.c @@ -1108,6 +1108,10 @@ int main(int argc, char **argv) { if (fds[0].revents & POLLIN) { if (wl_display_dispatch(state.display) == -1) break; + } else { + if (wl_display_dispatch_pending(state.display) == -1) + break; + wl_display_flush(state.display); } // MPV is ready to draw a new frame