summaryrefslogtreecommitdiff
path: root/libmate-desktop/mate-desktop-item.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmate-desktop/mate-desktop-item.c')
-rw-r--r--libmate-desktop/mate-desktop-item.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/libmate-desktop/mate-desktop-item.c b/libmate-desktop/mate-desktop-item.c
index f7b1154..616020b 100644
--- a/libmate-desktop/mate-desktop-item.c
+++ b/libmate-desktop/mate-desktop-item.c
@@ -1578,26 +1578,41 @@ startup_timeout (void *data)
{
StartupTimeoutData *std = data;
GSList *tmp;
- GTimeVal now;
int min_timeout;
min_timeout = STARTUP_TIMEOUT_LENGTH;
+#if GLIB_CHECK_VERSION(2,61,2)
+ gint64 now = g_get_real_time ();
+#else
+ GTimeVal now;
g_get_current_time (&now);
+#endif
tmp = std->contexts;
while (tmp != NULL) {
SnLauncherContext *sn_context = tmp->data;
GSList *next = tmp->next;
- long tv_sec, tv_usec;
double elapsed;
+#if GLIB_CHECK_VERSION(2,61,2)
+ time_t tv_sec;
+ suseconds_t tv_usec;
+ gint64 tv;
+
+ sn_launcher_context_get_last_active_time (sn_context, &tv_sec, &tv_usec);
+ tv = (tv_sec * G_USEC_PER_SEC) + tv_usec;
+ elapsed = (double) (now - tv) / 1000.0;
+#else
+ long tv_sec, tv_usec;
+
sn_launcher_context_get_last_active_time (sn_context,
&tv_sec, &tv_usec);
elapsed =
((((double)now.tv_sec - tv_sec) * G_USEC_PER_SEC +
(now.tv_usec - tv_usec))) / 1000.0;
+#endif
if (elapsed >= STARTUP_TIMEOUT_LENGTH) {
std->contexts = g_slist_remove (std->contexts,