summaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2025-08-01 20:46:48 -0400
committerVictor Kareh <[email protected]>2025-09-04 15:27:36 -0400
commit4e2f0755fc01b6bee61347c4a951d2ce8a7cd387 (patch)
tree6ba0ed8e2ad19460b900ca1390067b7afc38f631 /applets
parent226c03b3f9b010fd8f988aa3754558217598832d (diff)
downloadmate-panel-4e2f0755fc01b6bee61347c4a951d2ce8a7cd387.tar.bz2
mate-panel-4e2f0755fc01b6bee61347c4a951d2ce8a7cd387.tar.xz
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.
Diffstat (limited to 'applets')
-rw-r--r--applets/clock/clock.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/applets/clock/clock.c b/applets/clock/clock.c
index 0eee5766..1cc7b734 100644
--- a/applets/clock/clock.c
+++ b/applets/clock/clock.c
@@ -857,8 +857,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);