From 1c64438b122870e085ffc19d914fe7a274871c5d Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 21 Mar 2023 14:06:33 +0100 Subject: [PATCH] checkbutton: Only andle arrow focus if we're in a group If there is no other widget in the group that we can focus, don't focus and activate ourselves. Otherwise the arrow keys on checkbuttons toggle the checkbutton. --- gtk/gtkcheckbutton.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gtk/gtkcheckbutton.c b/gtk/gtkcheckbutton.c index 7b45cdf91f..a4a24fa8be 100644 --- a/gtk/gtkcheckbutton.c +++ b/gtk/gtkcheckbutton.c @@ -481,16 +481,15 @@ gtk_check_button_focus (GtkWidget *widget, } } + g_ptr_array_free (child_array, TRUE); - if (new_focus) + if (new_focus && new_focus != widget) { gtk_widget_grab_focus (new_focus); gtk_widget_activate (new_focus); + return TRUE; } - - g_ptr_array_free (child_array, TRUE); - - return TRUE; + return FALSE; } else { -- 2.30.2