* [PATCH] Revert "HID: wacom: generic: Send BTN_TOOL_PEN in prox once the pen enters range"
@ 2017-10-05 18:14 Jason Gerecke
2017-10-06 7:43 ` Benjamin Tissoires
2017-10-11 13:18 ` Jiri Kosina
0 siblings, 2 replies; 3+ messages in thread
From: Jason Gerecke @ 2017-10-05 18:14 UTC (permalink / raw)
To: linux-input, Jiri Kosina
Cc: Benjamin Tissoires, Ping Cheng, Aaron Skomra, Jason Gerecke,
Jason Gerecke
This reverts commit 3e70969e44ee52d72053145dab2cbad74109c685.
This commit causes a few problems for userspace. The most noteworthy are
problems related to the distinguishing of different pens and pointer jumps
when entering proximity. Userspace is written with the expectation that a
pen will provide its tool ID and serial number (if available) in the very
first in-prox report. By sending BTN_TOOL_PEN when the tablet starts
communicating rather than waiting until a tool ID/serial number is
available, userspace ends up treating all pens as being the same and
lacking a serial number. Similarly, userspace assumes that the first
report will contain X/Y data, but by marking the pen as being in-prox
without an X/Y coordinate, userspace ends up warping the pen to the last-
known X/Y location. As of commit 5b40104edfb0 ("HID: wacom: generic: Reset
events back to zero when pen leaves") this means warping to (0,0).
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
---
drivers/hid/wacom_wac.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 2926e36cb684..e3223b0c4f90 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -2247,17 +2247,6 @@ static void wacom_wac_pen_report(struct hid_device *hdev,
wacom_wac->tool[0] = wacom_intuos_get_tool_type(wacom_wac->id[0]);
else
wacom_wac->tool[0] = BTN_TOOL_PEN;
-
- if (wacom_wac->shared->stylus_in_proximity &&
- wacom_wac->tool[0] != BTN_TOOL_PEN) {
- input_report_key(input, BTN_TOOL_PEN, 0);
- input_sync(input);
- }
- }
- else if (!wacom_wac->tool[0] && !range) { /* entering in sense */
- input_report_key(input, BTN_TOOL_PEN, sense);
- input_report_key(input, BTN_TOUCH, 0);
- input_sync(input);
}
/* keep pen state for touch events */
--
2.14.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Revert "HID: wacom: generic: Send BTN_TOOL_PEN in prox once the pen enters range"
2017-10-05 18:14 [PATCH] Revert "HID: wacom: generic: Send BTN_TOOL_PEN in prox once the pen enters range" Jason Gerecke
@ 2017-10-06 7:43 ` Benjamin Tissoires
2017-10-11 13:18 ` Jiri Kosina
1 sibling, 0 replies; 3+ messages in thread
From: Benjamin Tissoires @ 2017-10-06 7:43 UTC (permalink / raw)
To: Jason Gerecke
Cc: linux-input, Jiri Kosina, Ping Cheng, Aaron Skomra, Jason Gerecke
On Oct 05 2017 or thereabouts, Jason Gerecke wrote:
> This reverts commit 3e70969e44ee52d72053145dab2cbad74109c685.
>
> This commit causes a few problems for userspace. The most noteworthy are
> problems related to the distinguishing of different pens and pointer jumps
> when entering proximity. Userspace is written with the expectation that a
> pen will provide its tool ID and serial number (if available) in the very
> first in-prox report. By sending BTN_TOOL_PEN when the tablet starts
> communicating rather than waiting until a tool ID/serial number is
> available, userspace ends up treating all pens as being the same and
> lacking a serial number. Similarly, userspace assumes that the first
> report will contain X/Y data, but by marking the pen as being in-prox
> without an X/Y coordinate, userspace ends up warping the pen to the last-
> known X/Y location. As of commit 5b40104edfb0 ("HID: wacom: generic: Reset
> events back to zero when pen leaves") this means warping to (0,0).
>
> Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> ---
> drivers/hid/wacom_wac.c | 11 -----------
> 1 file changed, 11 deletions(-)
>
> diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
> index 2926e36cb684..e3223b0c4f90 100644
> --- a/drivers/hid/wacom_wac.c
> +++ b/drivers/hid/wacom_wac.c
> @@ -2247,17 +2247,6 @@ static void wacom_wac_pen_report(struct hid_device *hdev,
> wacom_wac->tool[0] = wacom_intuos_get_tool_type(wacom_wac->id[0]);
> else
> wacom_wac->tool[0] = BTN_TOOL_PEN;
> -
> - if (wacom_wac->shared->stylus_in_proximity &&
> - wacom_wac->tool[0] != BTN_TOOL_PEN) {
> - input_report_key(input, BTN_TOOL_PEN, 0);
> - input_sync(input);
> - }
> - }
> - else if (!wacom_wac->tool[0] && !range) { /* entering in sense */
> - input_report_key(input, BTN_TOOL_PEN, sense);
> - input_report_key(input, BTN_TOUCH, 0);
> - input_sync(input);
> }
>
> /* keep pen state for touch events */
> --
> 2.14.2
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Revert "HID: wacom: generic: Send BTN_TOOL_PEN in prox once the pen enters range"
2017-10-05 18:14 [PATCH] Revert "HID: wacom: generic: Send BTN_TOOL_PEN in prox once the pen enters range" Jason Gerecke
2017-10-06 7:43 ` Benjamin Tissoires
@ 2017-10-11 13:18 ` Jiri Kosina
1 sibling, 0 replies; 3+ messages in thread
From: Jiri Kosina @ 2017-10-11 13:18 UTC (permalink / raw)
To: Jason Gerecke
Cc: linux-input, Benjamin Tissoires, Ping Cheng, Aaron Skomra, Jason Gerecke
On Thu, 5 Oct 2017, Jason Gerecke wrote:
> This reverts commit 3e70969e44ee52d72053145dab2cbad74109c685.
Applied to for-4.15/wacom. Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-10-11 13:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-05 18:14 [PATCH] Revert "HID: wacom: generic: Send BTN_TOOL_PEN in prox once the pen enters range" Jason Gerecke
2017-10-06 7:43 ` Benjamin Tissoires
2017-10-11 13:18 ` Jiri Kosina
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.