From 4179176ce8de04bf9970777c98804d7e45830b4c Mon Sep 17 00:00:00 2001 From: Rafostar <40623528+Rafostar@users.noreply.github.com> Date: Sun, 2 May 2021 15:51:14 +0200 Subject: [PATCH] Sink: queue render on GTK settings change We have turned off auto rendering in video widget, hence we need to manually refresh when user changes some GTK settings (theme, icons etc.) --- lib/gst/clapper/gtk4/gtkclapperglwidget.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/gst/clapper/gtk4/gtkclapperglwidget.c b/lib/gst/clapper/gtk4/gtkclapperglwidget.c index 0504d617..5f37def0 100644 --- a/lib/gst/clapper/gtk4/gtkclapperglwidget.c +++ b/lib/gst/clapper/gtk4/gtkclapperglwidget.c @@ -463,6 +463,13 @@ gtk_clapper_gl_widget_motion_event (GtkEventControllerMotion * motion_controller return FALSE; } +static void +gtk_clapper_gl_widget_settings_changed (GtkGLArea * glarea) +{ + GST_DEBUG ("GTK settings changed, queued render"); + gtk_gl_area_queue_render (glarea); +} + static void gtk_clapper_gl_widget_bind_buffer (GtkClapperGLWidget * clapper_widget) { @@ -1014,6 +1021,9 @@ gtk_clapper_gl_widget_init (GtkClapperGLWidget * clapper_widget) GST_INFO ("Created %" GST_PTR_FORMAT, priv->display); gtk_gl_area_set_auto_render (GTK_GL_AREA (widget), FALSE); + + g_signal_connect_swapped (gtk_widget_get_settings (widget), "notify", + G_CALLBACK (gtk_clapper_gl_widget_settings_changed), GTK_GL_AREA (widget)); } GtkWidget *