From 8877d930595a6ead5213ea05a961828ea4f88197 Mon Sep 17 00:00:00 2001 From: Hari Rana Date: Sat, 21 Feb 2026 08:09:09 -0500 Subject: [PATCH] views/month-popover: Add "closed" signal This will be needed for setting focus to the last focused widget after closing the popover. Alternatively, we could have used the "unmap" signal, but this causes a significant delay before setting focus to the last focused widget, as it needs to complete the animation before it emits the "unmap" signal. Part-of: --- src/gui/views/gcal-month-popover.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui/views/gcal-month-popover.c b/src/gui/views/gcal-month-popover.c index 7aadcd1e..ca766a17 100644 --- a/src/gui/views/gcal-month-popover.c +++ b/src/gui/views/gcal-month-popover.c @@ -61,6 +61,7 @@ enum enum { EVENT_ACTIVATED, + CLOSED, LAST_SIGNAL, }; @@ -456,6 +457,13 @@ gcal_month_popover_class_init (GcalMonthPopoverClass *klass) 1, GCAL_TYPE_EVENT_WIDGET); + signals[CLOSED] = g_signal_new ("closed", + GCAL_TYPE_MONTH_POPOVER, + G_SIGNAL_RUN_FIRST, + 0, NULL, NULL, NULL, + G_TYPE_NONE, + 0, NULL); + gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/ui/views/gcal-month-popover.ui"); gtk_widget_class_bind_template_callback (widget_class, close_button_clicked_cb); @@ -536,6 +544,8 @@ gcal_month_popover_popdown (GcalMonthPopover *self) adw_timed_animation_set_easing (ADW_TIMED_ANIMATION (self->animation), ADW_EASE_IN_EXPO); adw_animation_play (self->animation); + g_signal_emit (self, signals[CLOSED], 0, NULL); + GCAL_EXIT; }