diff -u xorg-server-21.1.3/debian/changelog xorg-server-21.1.3/debian/changelog --- xorg-server-21.1.3/debian/changelog +++ xorg-server-21.1.3/debian/changelog @@ -1,3 +1,10 @@ +xorg-server (2:21.1.3-2ubuntu2.3) UNRELEASED; urgency=medium + + * dix-Don-t-send-touch-end-to-clients-that-do-async-grab.patch: + Fixes touchscreen issue on xorg. (LP: #1994027) + + -- Bin Li Mon, 21 Nov 2022 09:33:46 +0800 + xorg-server (2:21.1.3-2ubuntu2.2) jammy; urgency=medium * 001_fedora_extramodes.patch: Dropped, causes issues with NVIDIA and diff -u xorg-server-21.1.3/debian/patches/series xorg-server-21.1.3/debian/patches/series --- xorg-server-21.1.3/debian/patches/series +++ xorg-server-21.1.3/debian/patches/series @@ -28,3 +28,4 @@ CVE-2022-2319-pre1.patch CVE-2022-2319.patch CVE-2022-2320.patch +dix-Don-t-send-touch-end-to-clients-that-do-async-grab.patch only in patch2: unchanged: --- xorg-server-21.1.3.orig/debian/patches/dix-Don-t-send-touch-end-to-clients-that-do-async-grab.patch +++ xorg-server-21.1.3/debian/patches/dix-Don-t-send-touch-end-to-clients-that-do-async-grab.patch @@ -0,0 +1,51 @@ +From 43e934a19f644cddedae73602e86429c9dc5074a Mon Sep 17 00:00:00 2001 +From: Povilas Kanapickas +Date: Sun, 16 Jan 2022 10:42:15 +0200 +Subject: [PATCH] dix: Don't send touch end to clients that do async grab + without touches + +GTK3 menu widget creates a selection for touch and other events and +after receiving touch events creates an async grab that excludes touch +events. Unfortunately it relies on X server not sending the touch end +event in order to function properly. Sending touch end event will cause +it to think that the initiating touch ended and when it actually ends, +the ButtonRelease event will make it think that the menu should be +closed. As a result, the menu will be open only for the duration of the +touch making it useless. + +This commit reverts f682e0563f736ed2c2c612ed575e05b6e3db945e. + +Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1255 + +Signed-off-by: Povilas Kanapickas +--- + dix/events.c | 15 ++++++--------- + 1 file changed, 6 insertions(+), 9 deletions(-) + +Index: xorg-server/dix/events.c +=================================================================== +--- xorg-server.orig/dix/events.c ++++ xorg-server/dix/events.c +@@ -1491,16 +1491,13 @@ UpdateTouchesForGrab(DeviceIntPtr mouse) + CLIENT_BITS(listener->listener) == grab->resource) { + if (grab->grabtype == CORE || grab->grabtype == XI || + !xi2mask_isset(grab->xi2mask, mouse, XI_TouchBegin)) { ++ /* Note that the grab will override any current listeners and if these listeners ++ already received touch events then this is the place to send touch end event ++ to complete the touch sequence. + +- if (listener->type == TOUCH_LISTENER_REGULAR && +- listener->state != TOUCH_LISTENER_AWAITING_BEGIN && +- listener->state != TOUCH_LISTENER_HAS_END) { +- /* if the listener already got any events relating to the touch, we must send +- a touch end because the grab overrides the previous listener and won't +- itself send any touch events. +- */ +- TouchEmitTouchEnd(mouse, ti, 0, listener->listener); +- } ++ Unfortunately GTK3 menu widget implementation relies on not getting touch end ++ event, so we can't fix the current behavior. ++ */ + listener->type = TOUCH_LISTENER_POINTER_GRAB; + } else { + listener->type = TOUCH_LISTENER_GRAB;