From 704c0815a1a4a01c7d38289eb3fb20611b81c871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Fortin=20Tam?= Date: Sun, 25 Feb 2024 14:13:31 -0500 Subject: [PATCH] event-editor: Focus "Done" for read-only events In commit 1494f7407, we focus the summary entry when opening the dialog. However, this prevents the Escape keyboard shortcut from working when opening a read-only event after having opened a writable event. Set focus onto the "Done" button when showing a read-only event, as it's the only widget that can be activated/clicked in this situation. This makes the "Escape", "Spacebar" and "Enter" keyboard shortcuts work. Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1180 --- src/gui/event-editor/gcal-event-editor-dialog.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/event-editor/gcal-event-editor-dialog.c b/src/gui/event-editor/gcal-event-editor-dialog.c index b1009b46..2f1f081e 100644 --- a/src/gui/event-editor/gcal-event-editor-dialog.c +++ b/src/gui/event-editor/gcal-event-editor-dialog.c @@ -787,6 +787,9 @@ gcal_event_editor_dialog_set_event (GcalEventEditorDialog *self, self->event_is_new = new_event; gtk_widget_set_visible (self->delete_button, !new_event); + if (!self->writable) + gtk_widget_grab_focus (self->done_button); + out: flags = GCAL_EVENT_EDITOR_FLAG_NONE;