History

Revert "HID: wacom: generic: Send BTN_TOOL_PEN in prox once the pen enters range"

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).

Jason Gerecke committed 9 years ago

Commit 2f847231 parent 5b401041 file · +0 −11Browse files

Unified · Split

drivers/hid/wacom_wac.c+0−11
@@ -2247,17 +2247,6 @@ static void wacom_wac_pen_report(struct hid_device *hdev, · 2246 unmodified lines
2247 wacom_wac->tool[0] = wacom_intuos_get_tool_type(wacom_wac->id[0]);2247 wacom_wac->tool[0] = wacom_intuos_get_tool_type(wacom_wac->id[0]);
2248 else2248 else
2249 wacom_wac->tool[0] = BTN_TOOL_PEN;2249 wacom_wac->tool[0] = BTN_TOOL_PEN;
2250
2251 if (wacom_wac->shared->stylus_in_proximity &&
2252 wacom_wac->tool[0] != BTN_TOOL_PEN) {
2253 input_report_key(input, BTN_TOOL_PEN, 0);
2254 input_sync(input);
2255 }
2256 }
2257 else if (!wacom_wac->tool[0] && !range) { /* entering in sense */
2258 input_report_key(input, BTN_TOOL_PEN, sense);
2259 input_report_key(input, BTN_TOUCH, 0);
2260 input_sync(input);
2261 }2250 }
2262 2251
2263 /* keep pen state for touch events */2252 /* keep pen state for touch events */