From: Matthias Clasen Date: Fri, 27 Dec 2019 13:48:03 +0000 (-0500) Subject: inspector: Remove menu special-casing X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~20^2~486^2~14 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b59521bb8290258d02cbbf9398154c40a1943c04;p=gtk4.git inspector: Remove menu special-casing --- diff --git a/gtk/inspector/object-tree.c b/gtk/inspector/object-tree.c index e0e1f4c2ff..cfc41987f5 100644 --- a/gtk/inspector/object-tree.c +++ b/gtk/inspector/object-tree.c @@ -111,14 +111,6 @@ object_tree_widget_get_parent (GObject *object) return G_OBJECT (gtk_widget_get_parent (GTK_WIDGET (object))); } -static GObject * -object_tree_menu_get_parent (GObject *object) -{ - GtkWidget *w = gtk_menu_get_attach_widget (GTK_MENU (object)); - - return w ? G_OBJECT (w) : NULL; -} - static GListModel * object_tree_widget_get_children (GObject *object) { @@ -237,12 +229,6 @@ list_model_for_properties (GObject *object, return result; } -static GListModel * -object_tree_menu_item_get_children (GObject *object) -{ - return list_model_for_properties (object, (const char *[2]) { "submenu", NULL }); -} - static GListModel * object_tree_combo_box_get_children (GObject *object) { @@ -517,16 +503,6 @@ static const ObjectTreeClassFuncs object_tree_class_funcs[] = { object_tree_widget_get_parent, object_tree_combo_box_get_children }, - { - gtk_menu_item_get_type, - object_tree_widget_get_parent, - object_tree_menu_item_get_children - }, - { - gtk_menu_get_type, - object_tree_menu_get_parent, - object_tree_widget_get_children - }, { gtk_widget_get_type, object_tree_widget_get_parent, diff --git a/gtk/inspector/prop-editor.c b/gtk/inspector/prop-editor.c index 220d984e78..6c7471b0e3 100644 --- a/gtk/inspector/prop-editor.c +++ b/gtk/inspector/prop-editor.c @@ -1251,15 +1251,6 @@ attribute_editor (GObject *object, return box; } -static GtkWidget * -action_ancestor (GtkWidget *widget) -{ - if (GTK_IS_MENU (widget)) - return gtk_menu_get_attach_widget (GTK_MENU (widget)); - else - return gtk_widget_get_parent (widget); -} - static GObject * find_action_owner (GtkActionable *actionable) { @@ -1291,7 +1282,7 @@ find_action_owner (GtkActionable *actionable) if (muxer && gtk_action_muxer_find (muxer, full_name, NULL)) return (GObject *)widget; - widget = action_ancestor (widget); + widget = gtk_widget_get_parent (widget); } return NULL;