[mutter/wip/wayland-work: 15/22] wayland: use the timestamps from events



commit 376854da301bc34ce4d37dcd305ff1884444d698
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 e95250d..88dc758 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -695,12 +695,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]