diff options
author | Benjamin Otte <otte@redhat.com> | 2016-01-22 20:39:14 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2016-01-22 20:39:14 +0100 |
commit | 0a9e9db9f4a8b81d3dda6b7d739b0fb003a642c1 (patch) | |
tree | bf61a24c062d62972860a414520c6578eecafea2 /gtk/gtkshortcutswindow.c | |
parent | efc899bd2b2a351221cd2c455773f62defc06b9c (diff) | |
download | gtk+-0a9e9db9f4a8b81d3dda6b7d739b0fb003a642c1.tar.gz |
shortcuts: Don't forall() widgets that aren't children
Diffstat (limited to 'gtk/gtkshortcutswindow.c')
-rw-r--r-- | gtk/gtkshortcutswindow.c | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/gtk/gtkshortcutswindow.c b/gtk/gtkshortcutswindow.c index 09e6a07c24..6edb4ee756 100644 --- a/gtk/gtkshortcutswindow.c +++ b/gtk/gtkshortcutswindow.c @@ -371,32 +371,29 @@ gtk_shortcuts_window_forall (GtkContainer *container, if (include_internal) { - if (priv->header_bar) - callback (GTK_WIDGET (priv->header_bar), callback_data); - if (priv->main_box) - callback (GTK_WIDGET (priv->main_box), callback_data); - if (priv->popover) - callback (GTK_WIDGET (priv->popover), callback_data); + GTK_CONTAINER_CLASS (gtk_shortcuts_window_parent_class)->forall (container, include_internal, callback, callback_data); } - - if (priv->stack) + else { - GList *children, *l; - GtkWidget *search; - GtkWidget *empty; - - search = gtk_stack_get_child_by_name (GTK_STACK (priv->stack), "internal-search"); - empty = gtk_stack_get_child_by_name (GTK_STACK (priv->stack), "no-search-results"); - children = gtk_container_get_children (GTK_CONTAINER (priv->stack)); - for (l = children; l; l = l->next) + if (priv->stack) { - GtkWidget *child = l->data; - - if (include_internal || - (child != search && child != empty)) - callback (child, callback_data); + GList *children, *l; + GtkWidget *search; + GtkWidget *empty; + + search = gtk_stack_get_child_by_name (GTK_STACK (priv->stack), "internal-search"); + empty = gtk_stack_get_child_by_name (GTK_STACK (priv->stack), "no-search-results"); + children = gtk_container_get_children (GTK_CONTAINER (priv->stack)); + for (l = children; l; l = l->next) + { + GtkWidget *child = l->data; + + if (include_internal || + (child != search && child != empty)) + callback (child, callback_data); + } + g_list_free (children); } - g_list_free (children); } } |