[mutter/wip/wayland-work: 8/10] wayland: use the timestamps from events



commit 20cd02f086df9fc2cb74939cafc7929c55e5e773
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 1f36f6e..470e864 100644
--- a/src/wayland/meta-wayland-keyboard.c
+++ b/src/wayland/meta-wayland-keyboard.c
@@ -445,9 +445,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 13bbb9a..6186685 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -697,12 +697,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]