[gnome-screensaver] gs-window-x11: If not realized, don't clear



commit cee21332ccbbd2b7c2a374d6b986c99abe14d839
Author: Colin Walters <walters verbum org>
Date:   Thu Feb 24 17:48:26 2011 -0500

    gs-window-x11: If not realized, don't clear
    
    This avoids tripping an assertion I was hitting where the widget
    wasn't yet realized, and thus gtk_widget_get_window() returned NULL.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=643242

 src/gs-window-x11.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-window-x11.c b/src/gs-window-x11.c
index c683f6c..708d3c1 100644
--- a/src/gs-window-x11.c
+++ b/src/gs-window-x11.c
@@ -261,6 +261,9 @@ clear_widget (GtkWidget *widget)
 {
         GdkColor color = { 0, 0x0000, 0x0000, 0x0000 };
 
+        if (!gtk_widget_get_realized (widget))
+                return;
+
         gdk_window_set_background (gtk_widget_get_window (widget),
                                    &color);
         gtk_widget_queue_draw (GTK_WIDGET (widget));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]