From 3b67cd26149eb991b5f015061a818af65369e668 Mon Sep 17 00:00:00 2001 From: Chase Douglas Date: Thu, 7 Jun 2012 14:12:06 -0700 Subject: [PATCH 1/4] End physically active touches when device is disabled Otherwise: * We can't end the touches while device is disabled * New touches after enabling the device may erroneously be mapped to old logical touches Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- dix/devices.c | 1 + dix/touch.c | 28 ++++++++++++++++++++++++++++ include/input.h | 1 + 3 files changed, 30 insertions(+) diff --git a/dix/devices.c b/dix/devices.c index 66d440683..fd4916a3a 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -443,6 +443,7 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent) if (*prev != dev) return FALSE; + TouchEndPhysicallyActiveTouches(dev); ReleaseButtonsAndKeys(dev); SyncRemoveDeviceIdleTime(dev->idle_counter); dev->idle_counter = NULL; diff --git a/dix/touch.c b/dix/touch.c index 497ad7dac..e64a6262c 100644 --- a/dix/touch.c +++ b/dix/touch.c @@ -1029,3 +1029,31 @@ TouchAcceptReject(ClientPtr client, DeviceIntPtr dev, int mode, return TouchListenerAcceptReject(dev, ti, i, mode); } + +/** + * End physically active touches for a device. + */ +void +TouchEndPhysicallyActiveTouches(DeviceIntPtr dev) +{ + InternalEvent *eventlist = InitEventList(GetMaximumEventsNum()); + int i; + + OsBlockSignals(); + mieqProcessInputEvents(); + for (i = 0; i < dev->last.num_touches; i++) { + DDXTouchPointInfoPtr ddxti = dev->last.touches + i; + + if (ddxti->active) { + int j; + int nevents = GetTouchEvents(eventlist, dev, ddxti->ddx_id, + XI_TouchEnd, 0, NULL); + + for (j = 0; j < nevents; j++) + mieqProcessDeviceEvent(dev, eventlist + j, NULL); + } + } + OsReleaseSignals(); + + FreeEventList(eventlist, GetMaximumEventsNum()); +} diff --git a/include/input.h b/include/input.h index 5747f3cd2..f8459b8c8 100644 --- a/include/input.h +++ b/include/input.h @@ -579,6 +579,7 @@ extern int TouchListenerAcceptReject(DeviceIntPtr dev, TouchPointInfoPtr ti, int listener, int mode); extern int TouchAcceptReject(ClientPtr client, DeviceIntPtr dev, int mode, uint32_t touchid, Window grab_window, XID *error); +extern void TouchEndPhysicallyActiveTouches(DeviceIntPtr dev); /* misc event helpers */ extern Mask GetEventMask(DeviceIntPtr dev, xEvent *ev, InputClientsPtr clients); From c0a752d2864872023216005375a6a1973fadeffe Mon Sep 17 00:00:00 2001 From: Lionel Elie Mamane Date: Tue, 9 Oct 2012 03:17:49 +0200 Subject: [PATCH 2/4] dix: fix Ungrab action #55785 UngrabAllDevices(Bool kill_client): If we are not going to kill the client (kill_clients false), we need to deactivate grabs of active clients, too. (If we are going to kill the client, no need to deactivate the grab, as this will be done as part of the client kill.) Fixes: X.Org Bug 55785 Signed-off-by: Lionel Elie Mamane Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- dix/grabs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dix/grabs.c b/dix/grabs.c index 55bf64f2c..fe7967415 100644 --- a/dix/grabs.c +++ b/dix/grabs.c @@ -179,7 +179,7 @@ UngrabAllDevices(Bool kill_client) continue; PrintDeviceGrabInfo(dev); client = clients[CLIENT_ID(dev->deviceGrab.grab->resource)]; - if (!client || client->clientGone) + if (!kill_client || !client || client->clientGone) dev->deviceGrab.DeactivateGrab(dev); if (kill_client) CloseDownClient(client); From 7d89eb4978a6649be22747c3de2886781e311647 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 4 Jan 2012 17:37:06 -0500 Subject: [PATCH 3/4] autogen.sh: Honor NOCONFIGURE=1 (Also while we have the patient open, use exec instead of hanging around uselessly in waitpid) http://people.gnome.org/~walters/docs/build-api.txt Reviewed-by: Adam Jackson Signed-off-by: Colin Walters Signed-off-by: Peter Hutterer --- autogen.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autogen.sh b/autogen.sh index 8b6f58f69..dd0731ad9 100755 --- a/autogen.sh +++ b/autogen.sh @@ -9,4 +9,6 @@ cd $srcdir autoreconf --force -v --install || exit 1 cd $ORIGDIR || exit $? -$srcdir/configure "$@" +if test -z "$NOCONFIGURE"; then + exec $srcdir/configure "$@" +fi From c5396ec05a5c6cab6608ba677f703c5227b1de13 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Wed, 17 Oct 2012 12:11:49 +0200 Subject: [PATCH 4/4] xf86: Fix build against recent Linux kernel Recent Linux kernels reworked the linux/input.h header file, which is now part of the "user-space API". The include guard therefore has an additional additional _UAPI prefix. Instead of adding another case to the #ifdef, drop any include guard checks and instead always undefine the BUS_* definitions on Linux. Signed-off-by: Thierry Reding Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- hw/xfree86/common/xf86str.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h index 059026243..4c2d147a2 100644 --- a/hw/xfree86/common/xf86str.h +++ b/hw/xfree86/common/xf86str.h @@ -347,7 +347,7 @@ typedef struct _DriverRec { */ /* Tolerate prior #include */ -#if defined(linux) && defined(_INPUT_H) +#if defined(linux) #undef BUS_NONE #undef BUS_PCI #undef BUS_SBUS