summaryrefslogtreecommitdiff
path: root/applets/clock/clock.c
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2025-09-22 22:23:09 +0000
committerGitHub <[email protected]>2025-09-22 22:23:09 +0000
commitcf2f458dd8b70450c3fdffb10d4a45c8c369b3e9 (patch)
tree1bfd5fb81bf88684653315aaad11f37532ab4fa9 /applets/clock/clock.c
parentd68c23bd8e07612f305dcc7825f3a8ee448544f5 (diff)
downloadmate-panel-cf2f458dd8b70450c3fdffb10d4a45c8c369b3e9.tar.bz2
mate-panel-cf2f458dd8b70450c3fdffb10d4a45c8c369b3e9.tar.xz
clock: Store calendar client in ClockData (#1516)
* clock: Store calendar client in ClockData This simplifies the evolution calendar client architecture and makes the popup show up faster, since we don't need to create a new one every time we open it. * clock: Fix calendar data refresh when opening popup The calendar popup was not showing recently added Evolution events/tasks. Added a refresh timeout call every time the calendar popup opens. That way the popup opens immediately and the data is refresh after a small delay.
Diffstat (limited to 'applets/clock/clock.c')
-rw-r--r--applets/clock/clock.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/applets/clock/clock.c b/applets/clock/clock.c
index cc5ea999..2e26b39f 100644
--- a/applets/clock/clock.c
+++ b/applets/clock/clock.c
@@ -211,6 +211,10 @@ struct _ClockData {
const gchar *weather_icon_name;
GDBusProxy *system_manager_proxy;
+
+#ifdef HAVE_EDS
+ CalendarClient *calendar_client;
+#endif
};
/* Used to count the number of clock instances. It's there to know when we
@@ -828,6 +832,13 @@ destroy_clock (GtkWidget * widget, ClockData *cd)
cd->builder = NULL;
}
+#ifdef HAVE_EDS
+ if (cd->calendar_client) {
+ g_object_unref (cd->calendar_client);
+ cd->calendar_client = NULL;
+ }
+#endif
+
g_free (cd);
}
@@ -887,6 +898,12 @@ create_calendar (ClockData *cd)
cd->settings);
g_free (prefs_path);
+#ifdef HAVE_EDS
+ if (cd->calendar_client) {
+ calendar_window_set_client (CALENDAR_WINDOW (window), cd->calendar_client);
+ }
+#endif
+
calendar_window_set_show_weeks (CALENDAR_WINDOW (window),
cd->showweek);
@@ -2763,6 +2780,11 @@ fill_clock_applet (MatePanelApplet *applet)
* hibernate). */
setup_monitor_for_resume (cd);
+#ifdef HAVE_EDS
+ /* Initialize persistent calendar client */
+ cd->calendar_client = calendar_client_new (cd->settings);
+#endif
+
return TRUE;
}