[gtk+/wip/baedert/children: 13/36] widget: Implement create_path for widgets with no-container parent



commit cdeaec0700082b1ada928b881b2a0211e34f3761
Author: Timm Bäder <mail baedert org>
Date:   Fri Nov 18 10:02:50 2016 +0100

    widget: Implement create_path for widgets with no-container parent

 gtk/gtkwidget.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 775d546..585a3a5 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -14574,8 +14574,14 @@ _gtk_widget_create_path (GtkWidget *widget)
 
   parent = widget->priv->parent;
 
-  if (parent)
+  if (parent && GTK_IS_CONTAINER (parent))
     return gtk_container_get_path_for_child (GTK_CONTAINER (parent), widget);
+  else if (parent)
+    {
+      GtkWidgetPath *path = _gtk_widget_create_path (parent);
+      gtk_widget_path_append_for_widget (path, widget);
+      return path;
+    }
   else
     {
       /* Widget is either toplevel or unparented, treat both


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