[gnome-builder] pnl: handle GtkPopover when tracking parent hierarchy



commit 4f6b7ebd7448ccde3e090897c055da75318dceb5
Author: Christian Hergert <chergert redhat com>
Date:   Sat May 21 16:02:52 2016 +0300

    pnl: handle GtkPopover when tracking parent hierarchy

 contrib/pnl/pnl-dock-manager.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/contrib/pnl/pnl-dock-manager.c b/contrib/pnl/pnl-dock-manager.c
index 2e917aa..7188cae 100644
--- a/contrib/pnl/pnl-dock-manager.c
+++ b/contrib/pnl/pnl-dock-manager.c
@@ -63,9 +63,8 @@ pnl_dock_manager_do_set_focus (PnlDockManager *self,
   /*
    * If their is a PnlDockItem in the hierarchy, create a new transient grab.
    */
-  for (parent = focus;
-       parent != NULL;
-       parent = gtk_widget_get_parent (parent))
+  parent = focus;
+  while (GTK_IS_WIDGET (parent))
     {
       if (PNL_IS_DOCK_ITEM (parent))
         {
@@ -73,6 +72,11 @@ pnl_dock_manager_do_set_focus (PnlDockManager *self,
             grab = pnl_dock_transient_grab_new ();
           pnl_dock_transient_grab_add_item (grab, PNL_DOCK_ITEM (parent));
         }
+
+      if (GTK_IS_POPOVER (parent))
+        parent = gtk_popover_get_relative_to (GTK_POPOVER (parent));
+      else
+        parent = gtk_widget_get_parent (parent);
     }
 
   /*


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