From 0fd2c32d6c1aabebad1f77388e9c8c419cfba9cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ball=C3=B3=20Gy=C3=B6rgy?= Date: Thu, 1 Feb 2024 11:24:44 +0100 Subject: [PATCH] clock: Ensure that calendar popup is always on screen This fixes the problem that the calendar popup is rendered partially off sceen on the right when the user expands the locations or adds a location with long name that extends the calendar popup. --- modules/clock/clock-applet.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/clock/clock-applet.c b/modules/clock/clock-applet.c index 70ccfb7a0..2de5dd007 100644 --- a/modules/clock/clock-applet.c +++ b/modules/clock/clock-applet.c @@ -837,6 +837,16 @@ static const GActionEntry clock_menu_actions [] = { { NULL } }; +static void +expand_locations_changed (GSettings *settings, + const gchar *key, + ClockApplet *clock) +{ + if (clock->calendar_popup != NULL) { + position_calendar_popup (clock); + } +} + static void format_changed (GSettings *settings, const gchar *key, @@ -945,6 +955,9 @@ locations_changed (GSettings *settings, if (cd->clock_vbox) create_cities_section (cd); + + if (cd->calendar_popup) + position_calendar_popup (cd); } static void @@ -1841,6 +1854,11 @@ clock_applet_constructed (GObject *object) G_CALLBACK (show_week_changed), self); + g_signal_connect (self->applet_settings, + "changed::expand-locations", + G_CALLBACK (expand_locations_changed), + self); + g_signal_connect (self->applet_settings, "changed::locations", G_CALLBACK (locations_changed), -- GitLab