[gtk/wip/matthiasc/focus2: 36/50] Force focus chain to be cyclic
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/focus2: 36/50] Force focus chain to be cyclic
- Date: Thu, 7 Mar 2019 11:43:24 +0000 (UTC)
commit 1c700f953230fc63829276294ee1c4e5df14e5ae
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Mar 4 22:44:50 2019 -0500
Force focus chain to be cyclic
Move the enforcement of focus chain wraparound to
gtk_widget_get_next_focus. This lets next_focus_child
implementation be simpler.
gtk/gtkwidgetfocus.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkwidgetfocus.c b/gtk/gtkwidgetfocus.c
index a380295798..e6f4e3060f 100644
--- a/gtk/gtkwidgetfocus.c
+++ b/gtk/gtkwidgetfocus.c
@@ -495,8 +495,15 @@ gtk_widget_get_next_focus (GtkWidget *widget,
next = GTK_WIDGET_GET_CLASS (widget)->next_focus_child (widget, prev, dir);
if (next == NULL)
{
- prev = widget;
- widget = gtk_widget_get_parent (widget);
+ if (GTK_IS_ROOT (widget))
+ {
+ prev = NULL;
+ }
+ else
+ {
+ prev = widget;
+ widget = gtk_widget_get_parent (widget);
+ }
}
else if (gtk_widget_can_take_focus (next))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]