From e1082516e8b77bd487ed780f0408534ff4100888 Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Thu, 5 Feb 2026 14:40:06 +0100 Subject: [PATCH] fix: X11 video stutter during background scrolling --- linux/runner/mpv/mpv_player.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/linux/runner/mpv/mpv_player.cc b/linux/runner/mpv/mpv_player.cc index ecf55475..3c7a214d 100644 --- a/linux/runner/mpv/mpv_player.cc +++ b/linux/runner/mpv/mpv_player.cc @@ -316,7 +316,8 @@ void MpvPlayer::RequestRedraw() { if (gl_area_) { // Queue redraw on main thread GtkGLArea* area = gl_area_; - g_idle_add( + g_idle_add_full( + GDK_PRIORITY_REDRAW, [](gpointer data) -> gboolean { GtkGLArea* area = static_cast(data); if (GTK_IS_GL_AREA(area)) { @@ -324,7 +325,8 @@ void MpvPlayer::RequestRedraw() { } return G_SOURCE_REMOVE; }, - area); + area, + nullptr); } } @@ -335,7 +337,8 @@ void MpvPlayer::OnMpvWakeup(void* ctx) { if (player->disposed_) return; // Schedule event processing on the main thread. - g_idle_add( + g_idle_add_full( + G_PRIORITY_HIGH_IDLE, [](gpointer data) -> gboolean { auto* player = static_cast(data); @@ -347,7 +350,8 @@ void MpvPlayer::OnMpvWakeup(void* ctx) { } return G_SOURCE_REMOVE; }, - player); + player, + nullptr); } void MpvPlayer::OnMpvRenderUpdate(void* ctx) {