[gnome-builder] command-bar: use workbench if there is no active view



commit e9610abce5548c8d0a5c9846b578403c14b025d2
Author: Christian Hergert <christian hergert me>
Date:   Tue Jun 9 20:23:40 2015 -0700

    command-bar: use workbench if there is no active view
    
    Fixes ability to call nighthack and such when no view is set.

 plugins/command-bar/gb-command-gaction-provider.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/plugins/command-bar/gb-command-gaction-provider.c 
b/plugins/command-bar/gb-command-gaction-provider.c
index 37115b3..b9c26cb 100644
--- a/plugins/command-bar/gb-command-gaction-provider.c
+++ b/plugins/command-bar/gb-command-gaction-provider.c
@@ -155,7 +155,6 @@ gb_group_free (GbGroup *gb_group)
 static GList *
 discover_groups (GbCommandGactionProvider *provider)
 {
-  GbView *view;
   GApplication *application;
   GtkWidget *widget;
   GbGroup *gb_group = NULL;
@@ -164,11 +163,12 @@ discover_groups (GbCommandGactionProvider *provider)
 
   g_return_val_if_fail (GB_IS_COMMAND_GACTION_PROVIDER (provider), NULL);
 
-  view = gb_command_provider_get_active_view (GB_COMMAND_PROVIDER (provider));
+  widget = (GtkWidget *)gb_command_provider_get_active_view (GB_COMMAND_PROVIDER (provider));
 
-  for (widget = GTK_WIDGET (view);
-       widget;
-       widget = gtk_widget_get_parent (widget))
+  if (widget == NULL)
+    widget = (GtkWidget *)gb_command_provider_get_workbench (GB_COMMAND_PROVIDER (provider));
+
+  for (; widget; widget = gtk_widget_get_parent (widget))
     {
       const gchar **prefixes;
       guint i;


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