usb: quickfix pointer-emulation for touch screen

Move button-event reporting behind pointer-position update.

This is just a quickfix to restore correct pointer emulation with
dde_linux usb_drv. It does not change usb_hid_drv because the approach
is a questionable workaround of the current input event handling, which
reports events promptly on occurrence of inputs events and ignores
synchronization events completely. The original contrib code reported
the button press before absolute x and y positioning followed by a sync
event.

Issue #3019
This commit is contained in:
Christian Helmuth 2018-10-19 16:08:10 +02:00
parent 9557e64822
commit 9ca214eee8
5 changed files with 28 additions and 3 deletions

View File

@ -60,7 +60,7 @@ hid xml tag:
!...
!<hid>
! <touchscreen width="1024" height="768" multitouch="no"/>
!<hid/>
!</hid>
!...
If a touchscreen is multi-touch-capable than the multitouch attribute gears

View File

@ -0,0 +1,24 @@
--- a/drivers/input/input-mt.c
+++ b/drivers/input/input-mt.c
@@ -217,10 +217,6 @@
count++;
}
- input_event(dev, EV_KEY, BTN_TOUCH, count > 0);
- if (use_count)
- input_mt_report_finger_count(dev, count);
-
if (oldest) {
int x = input_mt_get_value(oldest, ABS_MT_POSITION_X);
int y = input_mt_get_value(oldest, ABS_MT_POSITION_Y);
@@ -236,6 +232,10 @@
if (test_bit(ABS_MT_PRESSURE, dev->absbit))
input_event(dev, EV_ABS, ABS_PRESSURE, 0);
}
+
+ input_event(dev, EV_KEY, BTN_TOUCH, count > 0);
+ if (use_count)
+ input_mt_report_finger_count(dev, count);
}
EXPORT_SYMBOL(input_mt_report_pointer_emulation);

View File

@ -1 +1 @@
85b33124266df46e53981153e5014fd372d0680d
4832c9de27d57c6e6eb3c04a6ff6be61b0237216

View File

@ -178,6 +178,7 @@ USB_OPT = -p1 -d$(SRC_DIR_USB)
PATCH_OPT(patches/usb_ax88179.patch) := $(USB_OPT)
PATCH_OPT(patches/usb_csum.patch) := $(USB_OPT)
PATCH_OPT(patches/usb_evdev.patch) := $(USB_OPT)
PATCH_OPT(patches/usb_input_mt.patch) := $(USB_OPT)
PATCH_OPT(patches/usb_mem.patch) := $(USB_OPT)
PATCH_OPT(patches/usb_usbnet.patch) := $(USB_OPT)
PATCH_OPT(patches/usb_rndis.patch) := $(USB_OPT)

View File

@ -133,7 +133,7 @@ static void handle_absolute_axis(input_dev *dev, unsigned code, int value, Axis
{
slots[slot].event = code;
input_event_type type;
input_event_type type = EVENT_TYPE_MOTION;
switch (axis) {
case AXIS_X: