[mutter/wip/wayland-work: 20/25] wayland: use the timestamps from events



commit 68d2a28a98ff7eb8b971772e796b0c6188d38151
Author: Giovanni Campagna <gcampagn redhat com>
Date:   Wed Sep 4 15:23:11 2013 +0200

    wayland: use the timestamps from events
    
    Clutter has learned to use monotonic times for the events, and
    so does X (at least Xwayland, which is an implementation we know
    and we can rely upon), so the values are directly comparable.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=707466

 src/wayland/meta-wayland-keyboard.c |    4 +---
 src/wayland/meta-wayland.c          |    7 +------
 2 files changed, 2 insertions(+), 9 deletions(-)
---
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c
index b80c3bc..4e6a141 100644
--- a/src/wayland/meta-wayland-keyboard.c
+++ b/src/wayland/meta-wayland-keyboard.c
@@ -446,9 +446,7 @@ process_keybinding (MetaWaylandKeyboard   *keyboard,
 
   memcpy (&device_event, &generic_event, sizeof (XGenericEvent));
 
-  /* Can't use clutter_event_get_time() here, because evdev timestamps
-     have nothing to do with X timestamps */
-  device_event.time = meta_display_get_current_time_roundtrip (display);
+  device_event.time = clutter_event_get_time (event);
   device_event.deviceid = clutter_event_get_device_id (event);
   device_event.sourceid = 0; /* not used, not sure what this should be */
   device_event.detail = clutter_event_get_key_code (event);
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index 9eae91c..7242021 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -699,12 +699,7 @@ event_cb (ClutterActor *stage,
 
       if (surface && surface->window &&
          surface->window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND)
-        {
-         MetaDisplay *display = meta_get_display ();
-         guint32 timestamp = meta_display_get_current_time_roundtrip (display);
-
-         meta_window_focus (surface->window, timestamp);
-        }
+       meta_window_focus (surface->window, clutter_event_get_time (event));
     }
 
   if (seat->cursor_tracker)


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