diff options
author | Alexander Schwinn <alexxcons@xfce.org> | 2022-02-28 22:32:21 +0000 |
---|---|---|
committer | Alexander Schwinn <alexxcons@xfce.org> | 2022-02-28 22:32:21 +0000 |
commit | 3e6c1a939fdeee8a59b066d072329be9aa13adc0 (patch) | |
tree | 79484fa3458a207263ace625e95855fbfc198c6f | |
parent | 8959a150d067dfcb0dbf89d0fec1da14002c01a1 (diff) | |
download | libxfce4ui-3e6c1a939fdeee8a59b066d072329be9aa13adc0.tar.gz |
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.
-rw-r--r-- | libxfce4ui/xfce-spawn.c | 18 |
1 files 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, |