summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2017-02-08 09:26:40 +0100
committerTimm Bäder <mail@baedert.org>2017-03-31 09:50:39 +0200
commit64544968e9421fb79f8ad4ffa3b795630ecfa5e5 (patch)
treead67cb6c5163dd6e962c5eb996e1ce74f980581d
parent6353433f0ef40cfb3c5e5dcf5a5935e4e215c9f8 (diff)
downloadgtk+-64544968e9421fb79f8ad4ffa3b795630ecfa5e5.tar.gz
widget: Also reset focus on non-container widgets
-rw-r--r--gtk/gtkwidget.c17
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