[gnome-builder] util: special-case widget being an IdeWorkbench



commit 76d37ecf612c94e726ad42dff468c6cd74da8444
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jan 9 15:40:11 2018 -0800

    util: special-case widget being an IdeWorkbench

 src/libide/util/ide-gtk.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/libide/util/ide-gtk.c b/src/libide/util/ide-gtk.c
index 0f0c349..907a307 100644
--- a/src/libide/util/ide-gtk.c
+++ b/src/libide/util/ide-gtk.c
@@ -140,6 +140,9 @@ ide_widget_get_workbench (GtkWidget *widget)
 
   g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
 
+  if (IDE_IS_WORKBENCH (widget))
+    return IDE_WORKBENCH (widget);
+
   ancestor = gtk_widget_get_ancestor (widget, IDE_TYPE_WORKBENCH);
   if (IDE_IS_WORKBENCH (ancestor))
     return IDE_WORKBENCH (ancestor);


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