PsppSheetView resize handler: Do nothing if the widget is not realized
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 7 Jul 2012 05:14:53 +0000 (07:14 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sun, 8 Jul 2012 10:00:20 +0000 (12:00 +0200)
This seems to avoid the occasional GtkCritical that I get.

src/ui/gui/pspp-sheet-view.c

index 51ceafcc6f4333c052e6c6ba14b25bef6c88ef03..02825483ccc6d7d830b72db4ca86a19cbf31b765 100644 (file)
@@ -5361,6 +5361,9 @@ do_presize_handler (PsppSheetView *tree_view)
   validate_visible_area (tree_view);
   tree_view->priv->presize_handler_timer = 0;
 
+  if (! gtk_widget_get_realized (GTK_WIDGET (tree_view)))
+    return FALSE;
+
   gtk_widget_size_request (GTK_WIDGET (tree_view), &requisition);
 
   tree_view->priv->hadjustment->upper = MAX (tree_view->priv->hadjustment->upper, (gfloat)requisition.width);