[gtk+] widget: Implement create_path for widgets with non-container parent



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

    widget: Implement create_path for widgets with non-container parent

 gtk/gtkwidget.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 1de5d2f..a3e1293 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -14565,8 +14565,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]