[gtk+/wip/baedert/focus: 5/20] widget: Also reset focus on non-container widgets
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/focus: 5/20] widget: Also reset focus on non-container widgets
- Date: Fri, 10 Feb 2017 20:55:17 +0000 (UTC)
commit a349d53645cd180b9d6578669de056dd46718080
Author: Timm Bäder <mail baedert org>
Date: Wed Feb 8 09:26:40 2017 +0100
widget: Also reset focus on non-container widgets
gtk/gtkwidget.c | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index f2688be..45f337a 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]