From 2decff6393a44b56d80d53570718f95354fde454 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 11 Oct 2012 16:03:33 +1000 Subject: [PATCH 1/7] xkb: ProcesssPointerEvent must work on the VCP if it gets the VCP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For button release events, the current code picks the VCK. Because that has a XKB struct, it thinks this is a PointerKeys event and proceeds to send the release event through the XTest pointer. That has no effect in normal operation as the button is never down and an attempt is silently discarded (normal event processing continues with the VCP). On server shutdown, the XTest device is already removed, leading to a null-pointer derefernce when the device is checked for whether buttons are down (XkbFakeDeviceButton → button_is_down(xtest pointer)). The current state has only worked by accident, the right approach here is to handle the VCP's event as such and not switch to the keyboard. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard --- xkb/xkbAccessX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c index 082c0db57..c1af32eb9 100644 --- a/xkb/xkbAccessX.c +++ b/xkb/xkbAccessX.c @@ -709,7 +709,7 @@ ProcessPointerEvent(InternalEvent *ev, DeviceIntPtr mouse) xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(mouse); DeviceEvent *event = &ev->device_event; - dev = IsFloating(mouse) ? mouse : GetMaster(mouse, MASTER_KEYBOARD); + dev = (IsMaster(mouse) || IsFloating(mouse)) ? mouse : GetMaster(mouse, MASTER_KEYBOARD); if (dev && dev->key) { xkbi = dev->key->xkbInfo; From 3018f9c1e5109680dcf69b8f2d7807696a473bde Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 12 Oct 2012 13:48:27 +1000 Subject: [PATCH 2/7] Xi: set xChangeDeviceControlReply.status to Success by default If the status is other than Success, the code will set it to the required value. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard --- Xi/chgdctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c index 9fe69a5ad..7daf58461 100644 --- a/Xi/chgdctl.c +++ b/Xi/chgdctl.c @@ -126,7 +126,8 @@ ProcXChangeDeviceControl(ClientPtr client) .repType = X_Reply, .RepType = X_ChangeDeviceControl, .sequenceNumber = client->sequence, - .length = 0 + .length = 0, + .status = Success, }; switch (stuff->control) { From 676447190190d8546165e21be242cf16dd69f5ae Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 17 Oct 2012 14:13:29 +1000 Subject: [PATCH 3/7] Xi: don't deliver TouchEnd to a client waiting for TouchBegin (#55738) If a client is still waiting for the TouchBegin, don't deliver a TouchEnd event. X.Org Bug 55738 Signed-off-by: Peter Hutterer Tested-by: Thomas Jaeger Reviewed-by: Keith Packard --- Xi/exevents.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Xi/exevents.c b/Xi/exevents.c index 6ed499142..4cbeb3796 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1862,6 +1862,11 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev, goto out; } + if (listener->state == LISTENER_AWAITING_BEGIN) { + listener->state = LISTENER_HAS_END; + goto out; + } + /* Event in response to reject */ if (ev->device_event.flags & TOUCH_REJECT) { if (listener->state != LISTENER_HAS_END) From e7cd5cce740e653000fb1192b600268dcf77dde2 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 18 Oct 2012 15:11:31 +1000 Subject: [PATCH 4/7] dix: fix zaphod screen scrossing (#54654) POINTER_SCREEN coordinates are screen-relative. For a Zaphod setup, the coordinates after a screen crossing are already relative to the new screen's origin. Add that offset to the coordinates before re-setting. regression introduced by commit bafbd99080be49a17be97d2cc758fbe623369945 Author: Peter Hutterer Date: Wed Aug 8 11:34:32 2012 +1000 dix: work around scaling issues during WarpPointer (#53037) X.Org Bug 54654 Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard --- dix/getevents.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dix/getevents.c b/dix/getevents.c index 71d83c4ba..8b4379d1c 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -1400,8 +1400,9 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type, coordinates were. */ if (flags & POINTER_SCREEN) { - screenx = sx; - screeny = sy; + scr = miPointerGetScreen(pDev); + screenx = sx + scr->x; + screeny = sy + scr->y; } scr = positionSprite(pDev, (flags & POINTER_ABSOLUTE) ? Absolute : Relative, From 760be785eb49fed4652950fb55dc07b0a41d87de Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 24 Oct 2012 11:20:54 +1000 Subject: [PATCH 5/7] xfree86: remove unused variable sigstate Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard --- hw/xfree86/common/xf86Events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index 3ad34b543..9dabf103f 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -376,7 +376,7 @@ static void xf86ReleaseKeys(DeviceIntPtr pDev) { KeyClassPtr keyc; - int i, sigstate; + int i; if (!pDev || !pDev->key) return; From ced56f322ead10d1bc93fcd1f8e0ec3ae51292a3 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 25 Oct 2012 15:03:50 +0200 Subject: [PATCH 6/7] Sync TouchListener memory allocation with population in TouchSetupListeners() The allocated TouchListener array may fall short by 1 if hitting the worst case situation where there's an active grab, passive grabs on each window in the sprite trace and event selection for touch in one of the windows. This may lead to memory corruptions as the array is overflown. Signed-off-by: Carlos Garnacho Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- dix/touch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dix/touch.c b/dix/touch.c index e64a6262c..5f77be575 100644 --- a/dix/touch.c +++ b/dix/touch.c @@ -572,8 +572,8 @@ TouchBuildSprite(DeviceIntPtr sourcedev, TouchPointInfoPtr ti, return FALSE; /* Mark which grabs/event selections we're delivering to: max one grab per - * window plus the bottom-most event selection. */ - ti->listeners = calloc(sprite->spriteTraceGood + 1, sizeof(*ti->listeners)); + * window plus the bottom-most event selection, plus any active grab. */ + ti->listeners = calloc(sprite->spriteTraceGood + 2, sizeof(*ti->listeners)); if (!ti->listeners) { sprite->spriteTraceGood = 0; return FALSE; From d511a3016a79c50cb38e7504d4831a9ae128e422 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Fri, 26 Oct 2012 16:27:34 +0200 Subject: [PATCH 7/7] Add missing labels for multitouch valuators ABS_MT_DISTANCE exists since kernel v2.6.38, ABS_MT_TOOL_X|Y appeared in v3.6. Signed-off-by: Benjamin Tissoires Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- Xi/xiproperty.c | 3 +++ include/xserver-properties.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c index 43351bccc..796ba0948 100644 --- a/Xi/xiproperty.c +++ b/Xi/xiproperty.c @@ -105,6 +105,9 @@ static struct dev_properties { {0, AXIS_LABEL_PROP_ABS_MT_BLOB_ID}, {0, AXIS_LABEL_PROP_ABS_MT_TRACKING_ID}, {0, AXIS_LABEL_PROP_ABS_MT_PRESSURE}, + {0, AXIS_LABEL_PROP_ABS_MT_DISTANCE}, + {0, AXIS_LABEL_PROP_ABS_MT_TOOL_X}, + {0, AXIS_LABEL_PROP_ABS_MT_TOOL_Y}, {0, AXIS_LABEL_PROP_ABS_MISC}, {0, BTN_LABEL_PROP}, {0, BTN_LABEL_PROP_BTN_UNKNOWN}, diff --git a/include/xserver-properties.h b/include/xserver-properties.h index 85f2ce5c4..bf48fabe5 100644 --- a/include/xserver-properties.h +++ b/include/xserver-properties.h @@ -118,6 +118,9 @@ #define AXIS_LABEL_PROP_ABS_MT_BLOB_ID "Abs MT Blob ID" #define AXIS_LABEL_PROP_ABS_MT_TRACKING_ID "Abs MT Tracking ID" #define AXIS_LABEL_PROP_ABS_MT_PRESSURE "Abs MT Pressure" +#define AXIS_LABEL_PROP_ABS_MT_DISTANCE "Abs MT Distance" +#define AXIS_LABEL_PROP_ABS_MT_TOOL_X "Abs MT Tool X" +#define AXIS_LABEL_PROP_ABS_MT_TOOL_Y "Abs MT Tool Y" #define AXIS_LABEL_PROP_ABS_MISC "Abs Misc" /* Button names */