Skip to content

Commit

Permalink
Revert "HID: wacom: generic: Send BTN_TOOL_PEN in prox once the pen e…
Browse files Browse the repository at this point in the history
…nters range"

This reverts commit 3e70969.

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 5b40104 ("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>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Jason Gerecke authored and Jiri Kosina committed Oct 11, 2017
1 parent 5b40104 commit 2f84723
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions drivers/hid/wacom_wac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 2f84723

Please sign in to comment.