From d7be0c1ef076f6960abeb17335e587b598dcab68 Mon Sep 17 00:00:00 2001 From: Chase Douglas Date: Wed, 4 Apr 2012 16:53:33 -0700 Subject: [PATCH] Imported Debian patch 2:1.11.4-0ubuntu10 --- debian/changelog | 7 + ...touchscreen_pointer_emulation_checks.patch | 157 ++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 165 insertions(+) create mode 100644 debian/patches/506_touchscreen_pointer_emulation_checks.patch diff --git a/debian/changelog b/debian/changelog index 8453b8e..8abf057 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +xorg-server (2:1.11.4-0ubuntu10) precise; urgency=low + + * Fix touchscreen pointer emulation (LP: #949791) + - Add temporary patch 506_touchscreen_pointer_emulation_checks.patch + + -- Chase Douglas Wed, 04 Apr 2012 16:53:33 -0700 + xorg-server (2:1.11.4-0ubuntu9) precise; urgency=low * Report button press when touchscreen touch is active (LP: #972985) diff --git a/debian/patches/506_touchscreen_pointer_emulation_checks.patch b/debian/patches/506_touchscreen_pointer_emulation_checks.patch new file mode 100644 index 0000000..11a9ea2 --- /dev/null +++ b/debian/patches/506_touchscreen_pointer_emulation_checks.patch @@ -0,0 +1,157 @@ +From c149cf06d1966d134073d4b33f2ec028fbf7bbd1 Mon Sep 17 00:00:00 2001 +From: Chase Douglas +Date: Wed, 4 Apr 2012 12:41:59 -0700 +Subject: [PATCH 1/3] Don't attempt to add non-master core touch pointer + emulation listeners + +Core events aren't generated for slave devices, so this is just wrong. +On top of that, the mask being checked in the removed hunk is wrong as +well. It is dereferencing a pointer of type OtherClients as though it +were a pointer to type InputClients. + +Signed-off-by: Chase Douglas + +Conflicts: + + dix/touch.c +--- + dix/touch.c | 12 ------------ + 1 files changed, 0 insertions(+), 12 deletions(-) + +diff --git a/dix/touch.c b/dix/touch.c +index d04801c..87b0f15 100644 +--- a/dix/touch.c ++++ b/dix/touch.c +@@ -853,18 +853,6 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti, + win); + return TRUE; + } +- +- /* all others */ +- nt_list_for_each_entry(iclients, (InputClients*)wOtherClients(win), next) +- { +- if (!(iclients->mask[XIAllDevices] & core_filter)) +- continue; +- +- TouchEventHistoryAllocate(ti); +- TouchAddListener(ti, iclients->resource, CORE, +- type, LISTENER_AWAITING_BEGIN, win); +- return TRUE; +- } + } + + return FALSE; +-- +1.7.9.1 + +From 01091806f762f6f8fc83dc1051b5f3cfb38e88b1 Mon Sep 17 00:00:00 2001 +From: Chase Douglas +Date: Wed, 4 Apr 2012 12:57:40 -0700 +Subject: [PATCH 2/3] Check core event mask properly for pointer emulated + touch events + +The current code checks the core event mask as though it were an XI2 +mask. This change fixes the checks so the proper client and event masks +are used. + +Signed-off-by: Chase Douglas + +Conflicts: + + Xi/exevents.c +--- + Xi/exevents.c | 13 +++++++++---- + 1 files changed, 9 insertions(+), 4 deletions(-) + +diff --git a/Xi/exevents.c b/Xi/exevents.c +index f390f67..72e6d91 100644 +--- a/Xi/exevents.c ++++ b/Xi/exevents.c +@@ -1342,6 +1342,8 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti, + BUG_WARN(!iclients); + if (!iclients) + return FALSE; ++ ++ *client = rClient(iclients); + } else if (listener->level == XI) + { + int xi_type = GetXIType(TouchGetPointerEventType(ev)); +@@ -1352,19 +1354,22 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti, + BUG_WARN(!iclients); + if (!iclients) + return FALSE; ++ ++ *client = rClient(iclients); + } else + { + int coretype = GetCoreType(TouchGetPointerEventType(ev)); + Mask core_filter = event_get_filter_from_type(dev, coretype); ++ OtherClients *oclients; + + /* all others */ +- nt_list_for_each_entry(iclients, (InputClients*)wOtherClients(*win), next) +- if (iclients->mask[XIAllDevices] & core_filter) ++ nt_list_for_each_entry(oclients, (InputClients*)wOtherClients(*win), next) ++ if (oclients->mask & core_filter) + break; +- /* if owner selected, iclients is NULL */ ++ /* if owner selected, oclients is NULL */ ++ *client = oclients ? rClient(oclients) : wClient(*win); + } + +- *client = iclients ? rClient(iclients) : wClient(*win); + *mask = iclients ? iclients->xi2mask : NULL; + *grab = NULL; + } +-- +1.7.9.1 + +From 4b4c88b247c6435578c983d74a90f35472849f3a Mon Sep 17 00:00:00 2001 +From: Chase Douglas +Date: Wed, 4 Apr 2012 12:59:55 -0700 +Subject: [PATCH 3/3] Only set XI2 mask if pointer emulation is for XI2 client + +The current code returns a reference to memory that may not actually be +an XI2 mask. Instead, only return a value when an XI2 client has +selected for events. + +Signed-off-by: Chase Douglas + +Conflicts: + + Xi/exevents.c +--- + Xi/exevents.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/Xi/exevents.c b/Xi/exevents.c +index 72e6d91..fe06efa 100644 +--- a/Xi/exevents.c ++++ b/Xi/exevents.c +@@ -1293,6 +1293,7 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti, + { + int rc; + InputClients *iclients = NULL; ++ *mask = NULL; + + if (listener->type == LISTENER_GRAB || + listener->type == LISTENER_POINTER_GRAB) +@@ -1343,6 +1344,7 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti, + if (!iclients) + return FALSE; + ++ *mask = iclients->xi2mask; + *client = rClient(iclients); + } else if (listener->level == XI) + { +@@ -1370,7 +1372,6 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti, + *client = oclients ? rClient(oclients) : wClient(*win); + } + +- *mask = iclients ? iclients->xi2mask : NULL; + *grab = NULL; + } + +-- +1.7.9.1 + diff --git a/debian/patches/series b/debian/patches/series index 120a81a..e07cbea 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -37,3 +37,4 @@ 503_fix_mouse_warp.patch 504_implement_passive_touch_ungrab.patch 505_query_pointer_touchscreen.patch +506_touchscreen_pointer_emulation_checks.patch -- 2.39.2