From e6046e94933b02f29bf7f5041228a44b3ff17c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Wed, 17 Jan 2024 15:14:12 +0100 Subject: [PATCH] gtk: Fix GtkListItemWidget focus chain It would not check if the focus child can handle the focus, so it wouldn't be possible to navigate through each focusable descendant Fixes #6340 --- gtk/gtklistitemwidget.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gtk/gtklistitemwidget.c b/gtk/gtklistitemwidget.c index 55a9b9252c..4f959cdf63 100644 --- a/gtk/gtklistitemwidget.c +++ b/gtk/gtklistitemwidget.c @@ -37,11 +37,14 @@ gtk_list_item_widget_focus (GtkWidget *widget, GtkDirectionType direction) { GtkWidget *child = gtk_widget_get_first_child (widget); + GtkWidget *focus_child = gtk_widget_get_focus_child (widget); - if (gtk_widget_get_focus_child (widget)) + if (focus_child) { /* focus is in the child */ - if (direction == GTK_DIR_TAB_BACKWARD) + if (gtk_widget_child_focus (focus_child, direction)) + return TRUE; + else if (direction == GTK_DIR_TAB_BACKWARD) return gtk_widget_grab_focus_self (widget); else return FALSE;