From d477ac2d7243c2b1bbbab50c8946c3a71bd9c7f5 Mon Sep 17 00:00:00 2001 From: Hari Rana Date: Sat, 19 Jul 2025 18:10:56 -0400 Subject: [PATCH] event-editor/multi-choice: Focus widget if increment/decrement buttons are pressed This also re-sets the state flags of the buttons, because otherwise the increment/decrement buttons lose their hovered state after the widget gains focus. Part-of: --- src/gui/event-editor/gcal-multi-choice.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/event-editor/gcal-multi-choice.c b/src/gui/event-editor/gcal-multi-choice.c index 83658e1f..d7008eae 100644 --- a/src/gui/event-editor/gcal-multi-choice.c +++ b/src/gui/event-editor/gcal-multi-choice.c @@ -226,12 +226,21 @@ static void button_clicked_cb (GtkWidget *button, GcalMultiChoice *self) { + GtkStateFlags state_flags; + + state_flags = gtk_widget_get_state_flags (button); + if (button == self->down_button) go_down (self); else if (button == self->up_button) go_up (self); else g_assert_not_reached (); + + if (!gtk_widget_grab_focus (GTK_WIDGET (self))) + g_assert_not_reached (); + + gtk_widget_set_state_flags (button, state_flags, TRUE); } static gboolean