[Xfce4-commits] [apps/xfce4-screensaver] 253/425: Gtk3, gs-window-x11: defer setting bg color until realization

noreply at xfce.org noreply at xfce.org
Mon Oct 15 01:51:40 CEST 2018


This is an automated email from the git hooks/post-receive script.

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-screensaver.

commit 8b76c13a915f6060f3bcfde9f0d5f4177c1f6114
Author: Ray Strode <rstrode at redhat.com>
Date:   Tue Jul 17 19:41:12 2012 +0000

    Gtk3, gs-window-x11: defer setting bg color until realization
    
    commit adfc280 changed the drawing area associated with each
    monitors screensaver window to get realized early.
    
    That change is seemingly causing problems for users.
    
    This commit stops preemptively realizing the drawing areas, and
    instead makes the background color settings get applied reactively
    in response to realization.
    
    http://bugzilla.gnome.org/show_bug.cgi?id=679441
---
 src/gs-window-x11.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/gs-window-x11.c b/src/gs-window-x11.c
index d4bb564..b374715 100644
--- a/src/gs-window-x11.c
+++ b/src/gs-window-x11.c
@@ -2740,13 +2740,20 @@ create_info_bar (GSWindow *window)
 	gtk_box_pack_end (GTK_BOX (window->priv->vbox), window->priv->info_bar, FALSE, FALSE, 0);
 }
 
+#if GTK_CHECK_VERSION (3, 0, 0)
 static void
-gs_window_init (GSWindow *window)
+on_drawing_area_realized (GtkWidget *drawing_area)
 {
-#if GTK_CHECK_VERSION (3, 0, 0)
 	GdkRGBA black = { 0.0, 0.0, 0.0, 1.0 };
 
+	gdk_window_set_background_rgba (gtk_widget_get_window (drawing_area),
+	                                &black);
+}
 #endif
+
+static void
+gs_window_init (GSWindow *window)
+{
 	window->priv = GS_WINDOW_GET_PRIVATE (window);
 
 	window->priv->geometry.x      = -1;
@@ -2789,9 +2796,10 @@ gs_window_init (GSWindow *window)
 #endif
 	gtk_box_pack_start (GTK_BOX (window->priv->vbox), window->priv->drawing_area, TRUE, TRUE, 0);
 #if GTK_CHECK_VERSION (3, 0, 0)
-        gtk_widget_realize (window->priv->drawing_area);
-        gdk_window_set_background_rgba (gtk_widget_get_window (window->priv->drawing_area), &black);
-
+	g_signal_connect (window->priv->drawing_area,
+	                  "realize",
+	                  G_CALLBACK (on_drawing_area_realized),
+	                  NULL);
 #endif
 	create_info_bar (window);
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list