[mutter] backends/x11: Improve grab-device clock updates
- From: Marco Trevisan <marcotrevi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] backends/x11: Improve grab-device clock updates
- Date: Mon, 13 Aug 2018 19:12:17 +0000 (UTC)
commit 1bfa20929b36d06cc23667d1122175149615b56d
Author: Jeff Smith <whydoubt gmail com>
Date: Fri Jul 20 00:41:43 2018 -0500
backends/x11: Improve grab-device clock updates
meta_backend_x11_grab_device is performing X server clock comparison
using the MAX macro, which comes down to a simple greater-than.
Use XSERVER_TIME_IS_BEFORE, which is a better macro for X server
clock comparisons, as it accounts for 32-bit wrap-around.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/174
src/backends/x11/meta-backend-x11.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c
index 9a1f35e6e..ed81364e2 100644
--- a/src/backends/x11/meta-backend-x11.c
+++ b/src/backends/x11/meta-backend-x11.c
@@ -547,8 +547,9 @@ meta_backend_x11_grab_device (MetaBackend *backend,
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
int ret;
- if (timestamp != META_CURRENT_TIME)
- timestamp = MAX (timestamp, priv->latest_evtime);
+ if (timestamp != META_CURRENT_TIME &&
+ XSERVER_TIME_IS_BEFORE (timestamp, priv->latest_evtime))
+ timestamp = priv->latest_evtime;
XISetMask (mask.mask, XI_ButtonPress);
XISetMask (mask.mask, XI_ButtonRelease);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]