From 29a8742080dab02afbe6f7e453a7525c54be946e Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Fri, 1 Aug 2025 20:46:48 -0400 Subject: clock: Provide fallback preferences path Provide a fallback preferences path in case the applet doesn't provide one. This happens when running outside the actual panel, like in the case of mate-panel-test-applets. --- applets/clock/clock.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'applets') diff --git a/applets/clock/clock.c b/applets/clock/clock.c index 41bb49b0..4b7920c1 100644 --- a/applets/clock/clock.c +++ b/applets/clock/clock.c @@ -863,8 +863,19 @@ create_calendar (ClockData *cd) { GtkWidget *window; char *prefs_path; + char *fallback_path = NULL; prefs_path = mate_panel_applet_get_preferences_path (MATE_PANEL_APPLET (cd->applet)); + + /* Provide a fallback preferences path in case the applet doesn't + * provide one. This happens when running outside the actual panel, + * like in mate-panel-test-applets */ + if (!prefs_path || !prefs_path[0]) { + fallback_path = g_strdup ("/org/mate/panel/applets/clock/"); + g_free (prefs_path); + prefs_path = fallback_path; + } + window = calendar_window_new (&cd->current_time, prefs_path, cd->orient == MATE_PANEL_APPLET_ORIENT_UP, -- cgit v1.2.1