[mutter/wip/carlosg/startup-notification-fixes: 1/4] core: Fix differing sequence timestamp precision expectations



commit 9b587fd79fb0310322c971718b71741af4971c5c
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Apr 15 20:03:16 2019 +0200

    core: Fix differing sequence timestamp precision expectations
    
    Calculations were being done at places accounting on usec precision,
    however those are still treated as having msec precision. Let's consolidate
    for the latter since requires less changes across the board and usec
    precision doesn't buy us anything here.
    
    https://gitlab.gnome.org/GNOME/mutter/issues/541

 src/core/startup-notification.c         | 4 ++--
 src/x11/meta-startup-notification-x11.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/core/startup-notification.c b/src/core/startup-notification.c
index d2d0d1362..aba45a991 100644
--- a/src/core/startup-notification.c
+++ b/src/core/startup-notification.c
@@ -37,7 +37,7 @@
  * OpenOffice or whatever seems to stop launching - people
  * might decide they need to launch it again.
  */
-#define STARTUP_TIMEOUT 15000000
+#define STARTUP_TIMEOUT 15000
 
 enum
 {
@@ -440,7 +440,7 @@ startup_sequence_timeout (void *data)
   GSList *l;
 
   ctod.list = NULL;
-  ctod.now = g_get_monotonic_time ();
+  ctod.now = g_get_monotonic_time () / 1000;
   g_slist_foreach (sn->startup_sequences,
                    collect_timed_out_foreach,
                    &ctod);
diff --git a/src/x11/meta-startup-notification-x11.c b/src/x11/meta-startup-notification-x11.c
index d6814926a..99fcf4561 100644
--- a/src/x11/meta-startup-notification-x11.c
+++ b/src/x11/meta-startup-notification-x11.c
@@ -151,7 +151,7 @@ meta_startup_sequence_x11_new (SnStartupSequence *seq)
 {
   gint64 timestamp;
 
-  timestamp = sn_startup_sequence_get_timestamp (seq) * 1000;
+  timestamp = sn_startup_sequence_get_timestamp (seq);
   return g_object_new (META_TYPE_STARTUP_SEQUENCE_X11,
                        "id", sn_startup_sequence_get_id (seq),
                        "icon-name", sn_startup_sequence_get_icon_name (seq),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]