diff options
-rw-r--r-- | gtk/gtkwidget.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index d7a9951db1..f89351aff6 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -7149,14 +7149,11 @@ static void reset_focus_recurse (GtkWidget *widget, gpointer data) { - if (GTK_IS_CONTAINER (widget)) - { - gtk_widget_set_focus_child (widget, NULL); + gtk_widget_set_focus_child (widget, NULL); - gtk_container_foreach (GTK_CONTAINER (widget), - reset_focus_recurse, - NULL); - } + gtk_widget_forall (widget, + reset_focus_recurse, + NULL); } static void @@ -7210,9 +7207,9 @@ gtk_widget_real_grab_focus (GtkWidget *focus_widget) * actually, this is very questionable behavior. */ - gtk_container_foreach (GTK_CONTAINER (toplevel), - reset_focus_recurse, - NULL); + gtk_widget_forall (toplevel, + reset_focus_recurse, + NULL); } /* now propagate the new focus up the widget tree and finally |