From 3e6c1a939fdeee8a59b066d072329be9aa13adc0 Mon Sep 17 00:00:00 2001 From: Alexander Schwinn Date: Mon, 28 Feb 2022 22:32:21 +0000 Subject: Simplify startup notification timeout Related: xfce/thunar#125 (xfce/thunar#125) GTimeVal is deprecated due to Y2038 problem. Instead of replacing it, it is just dropped here to simplify the related code. --- libxfce4ui/xfce-spawn.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/libxfce4ui/xfce-spawn.c b/libxfce4ui/xfce-spawn.c index f1f75cb..49945cf 100644 --- a/libxfce4ui/xfce-spawn.c +++ b/libxfce4ui/xfce-spawn.c @@ -100,20 +100,8 @@ typedef struct static gboolean xfce_spawn_startup_timeout (gpointer user_data) { - XfceSpawnData *spawn_data = user_data; - GTimeVal now; - gdouble elapsed; - glong tv_sec; - glong tv_usec; - - g_return_val_if_fail (spawn_data->sn_launcher != NULL, FALSE); - - /* determine the amount of elapsed time */ - g_get_current_time (&now); - sn_launcher_context_get_last_active_time (spawn_data->sn_launcher, &tv_sec, &tv_usec); - elapsed = now.tv_sec - tv_sec + ((gdouble) (now.tv_usec - tv_usec) / G_USEC_PER_SEC); - - return elapsed < XFCE_SPAWN_STARTUP_TIMEOUT; + /* timeout reached, lets stop the startup notification */ + return FALSE; } @@ -429,7 +417,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS if (G_LIKELY (sn_launcher != NULL)) { /* start a timeout to stop the startup notification sequence after - * a certain about of time, to handle applications that do not + * about XFCE_SPAWN_STARTUP_TIMEOUT seconds, to handle applications that do not * properly implement startup notify */ spawn_data->sn_launcher = sn_launcher; spawn_data->timeout_id = g_timeout_add_seconds_full (G_PRIORITY_LOW, -- cgit v1.2.1