[gtk+] widget: Also reset focus on non-container widgets
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] widget: Also reset focus on non-container widgets
- Date: Fri, 31 Mar 2017 07:55:07 +0000 (UTC)
commit 64544968e9421fb79f8ad4ffa3b795630ecfa5e5
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 d7a9951..f89351a 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]