|
|
c59feb |
From 05bf09ea4aa5a7dc22869075ea2096c4a293d70d Mon Sep 17 00:00:00 2001
|
|
|
c59feb |
From: Jeff Smith <whydoubt@gmail.com>
|
|
|
c59feb |
Date: Wed, 31 Jan 2018 23:27:19 -0600
|
|
|
c59feb |
Subject: [PATCH] backends/x11: Fix time-comparison bug causing hang
|
|
|
c59feb |
|
|
|
c59feb |
A comparison in translate_device_event() does not account for the fact
|
|
|
c59feb |
that X's clock wraps about every 49.7 days. When triggered, this causes
|
|
|
c59feb |
an unresponsive GUI.
|
|
|
c59feb |
|
|
|
c59feb |
Replace simple less-than comparison with XSERVER_TIME_IS_BEFORE macro,
|
|
|
c59feb |
which accounts for the wrapping of X's clock.
|
|
|
c59feb |
|
|
|
c59feb |
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/12
|
|
|
c59feb |
---
|
|
|
c59feb |
src/backends/x11/meta-backend-x11.c | 2 +-
|
|
|
c59feb |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
c59feb |
|
|
|
c59feb |
diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c
|
|
|
c59feb |
index 233532435..f447f785f 100644
|
|
|
c59feb |
--- a/src/backends/x11/meta-backend-x11.c
|
|
|
c59feb |
+++ b/src/backends/x11/meta-backend-x11.c
|
|
|
c59feb |
@@ -112,7 +112,7 @@ translate_device_event (MetaBackendX11 *x11,
|
|
|
c59feb |
|
|
|
c59feb |
if (!device_event->send_event && device_event->time != CurrentTime)
|
|
|
c59feb |
{
|
|
|
c59feb |
- if (device_event->time < priv->latest_evtime)
|
|
|
c59feb |
+ if (XSERVER_TIME_IS_BEFORE (device_event->time, priv->latest_evtime))
|
|
|
c59feb |
{
|
|
|
c59feb |
/* Emulated pointer events received after XIRejectTouch is received
|
|
|
c59feb |
* on a passive touch grab will contain older timestamps, update those
|
|
|
c59feb |
--
|
|
|
c59feb |
2.17.1
|
|
|
c59feb |
|