Fix XVideo rendering into GTK+ 3.0 GtkDialog

Thu, 17 Mar 2016 18:11:31 +0100

author
Jakub Adam <jakub.adam@ktknet.cz>
date
Thu, 17 Mar 2016 18:11:31 +0100
changeset 37590
92bff33e5d0d
parent 37589
e498a88e7c00
child 37592
741f27684265
child 37615
eacd3d5842fc

Fix XVideo rendering into GTK+ 3.0 GtkDialog

pidgin/gtkutils.c file | annotate | diff | comparison | revisions
--- a/pidgin/gtkutils.c	Thu Mar 17 17:52:10 2016 +0100
+++ b/pidgin/gtkutils.c	Thu Mar 17 18:11:31 2016 +0100
@@ -236,6 +236,18 @@
 	video = gtk_drawing_area_new();
 	gtk_widget_override_background_color(video, GTK_STATE_FLAG_NORMAL, &color);
 
+	/* In order to enable client shadow decorations, GtkDialog from GTK+ 3.0
+	 * uses ARGB visual which by default gets inherited by its child widgets.
+	 * XVideo adaptors on the other hand often support just depth 24 and
+	 * rendering video through xvimagesink onto a widget inside a GtkDialog
+	 * then results in no visible output.
+	 *
+	 * This ensures the default system visual of the drawing area doesn't get
+	 * overridden by the widget's parent.
+	 */
+	gtk_widget_set_visual(video,
+	                gdk_screen_get_system_visual(gtk_widget_get_screen(video)));
+
 	return video;
 }
 

mercurial