[gnome-shell] st_widget_get_theme_node: g_error if called on an unparented widget



commit d128cc5af35674a8ec6604820127cb188172a59b
Author: Dan Winship <danw gnome org>
Date:   Wed Feb 17 15:21:51 2010 -0500

    st_widget_get_theme_node: g_error if called on an unparented widget
    
    It's wrong to do anything that requires looking up a widget's style
    before you add the widget to the stage, since its final style may
    depend on properties inherited from its parents.
    st_widget_get_theme_node() used to emit a warning in this case, but
    many would-be contributors apparently didn't notice. Help them out.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=610279

 src/st/st-widget.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/src/st/st-widget.c b/src/st/st-widget.c
index 4a674c5..08768f7 100644
--- a/src/st/st-widget.c
+++ b/src/st/st-widget.c
@@ -1101,8 +1101,7 @@ st_widget_get_theme_node (StWidget *widget)
 
       if (stage == NULL)
         {
-          g_warning ("st_widget_get_theme_node called on a widget not in a stage");
-          stage = CLUTTER_STAGE (clutter_stage_get_default ());
+          g_error ("st_widget_get_theme_node called on a widget not in a stage");
         }
 
       if (parent_node == NULL)



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