[gimp] app: Don't try to create widgets that requires a context while detached



commit 87c25236b81fc1280ffeeb5d4809ac42a5feb075
Author: Martin Nordholts <martinn src gnome org>
Date:   Tue Jan 5 11:29:54 2010 +0100

    app: Don't try to create widgets that requires a context while detached
    
    When quitting GIMP while in single-window mode and the widget
    hierarchies are cleaned up, prevent a tab widget from being
    constructed so we don't get any annoying warnings due to failing to
    look up a context.

 app/widgets/gimpdockbook.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/app/widgets/gimpdockbook.c b/app/widgets/gimpdockbook.c
index 0105c35..3f7d1d3 100644
--- a/app/widgets/gimpdockbook.c
+++ b/app/widgets/gimpdockbook.c
@@ -267,6 +267,15 @@ gimp_dockbook_style_set (GtkWidget *widget,
 
   GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
 
+  /* Don't attempt to construct widgets that require a GimpContext if
+   * we are detached from a top-level, we're either on our way to
+   * destruction, in which case we don't care, or we will be given a
+   * new parent, in which case the widget style will be reset again
+   * anyway, i.e. this function will be called again
+   */
+  if (! gtk_widget_is_toplevel (gtk_widget_get_toplevel (widget)))
+    return;
+
   gtk_widget_style_get (widget,
                         "tab-border", &tab_border,
                         NULL);



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