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
This commit is contained in:
Kévin Commaille 2024-01-17 15:14:12 +01:00
parent d16d2135e6
commit e6046e9493
No known key found for this signature in database
GPG Key ID: 29A48C1F03620416

View File

@ -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;