From patchwork Thu Oct 5 18:14:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gerecke, Jason" X-Patchwork-Id: 9987709 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8F8CA602B8 for ; Thu, 5 Oct 2017 18:14:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EF7A26E76 for ; Thu, 5 Oct 2017 18:14:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7382B27968; Thu, 5 Oct 2017 18:14:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5310926E76 for ; Thu, 5 Oct 2017 18:14:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751823AbdJESOX (ORCPT ); Thu, 5 Oct 2017 14:14:23 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:38677 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751816AbdJESOW (ORCPT ); Thu, 5 Oct 2017 14:14:22 -0400 Received: by mail-qk0-f196.google.com with SMTP id 17so3534234qkq.5 for ; Thu, 05 Oct 2017 11:14:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=wxQcr8cO+r/7g3eoHkOE4ArPdxrYhs+ALXvVEu3I1G0=; b=FhhqN8GTbmQ+kJ1RwLqq7DD80qNwGGBL1dm5/fc8J+AXfmNgUMCJlGJDVBtS5HgUBI E8w3QbPfZ4ZfCxmjslS3YoSA1xulKgsodWLkUmaNHqxJHTbx4q6yL8VOe8gUCMPqDpyQ rAO4ExFzV6ta30FRSnfVJ5CBkGChDf+atDRl4+iU3Gy8NjWpsGWLEAuAHEE7ztAKk7f3 Z0Hj5pUfUX2CZ+Gi+znIMYsTvI7azeDk2KMqXYmGA8Tz32OSBJlAL8voruo25JLcXemb GmsNLiJKyyHw9Eb4sS7t2gX7fciplQ4DqHq6OO6X+XhdO4XY3mVMxWBV/2qrltUh4IRs AYaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=wxQcr8cO+r/7g3eoHkOE4ArPdxrYhs+ALXvVEu3I1G0=; b=jfVNr6ghToyr7BUaeI+oDZNon4eWkUkulC1MCdrgQd4X7+uywWWclNHTQRWx3YZ5FI fS5//GLkVptVWV1Jw67fAqaKdMV9dVxNTqBQV5TtDYthP8uWFXBOdbdN8v1Bpn8/ChdA a7wergl5hhBLus3OeFXt9vtVRRXCWNckaqkXkLf62zk+1QIv20yev6TjzMFbIE84f78c pi3uFjhxfWOjNlIkayxCnW9+O78LvtFYvZUMqfnysTwhTG/RCUuRCvCK5Z2/t73vGKlH QndcGQCPg6Ax7DTQWBavzhe6gsUAzICnW9EaLB0WN5O5InB7evkMo5lzQbY9pI9llbHt X/zQ== X-Gm-Message-State: AMCzsaV01NAJqL8RPp5McJ9fJssWyTSVO7qGw+cPC7yufcElXxQ2Q1CJ U/49knHumTRTab6UWUFcaXTmkm4y X-Google-Smtp-Source: AOwi7QAp3JQ6BPHj7rRU85brfsbgOJRFWy6ThvQvpB3fG3hG2fHDb16CZwMmu/9Bmtb0PUp/d1UFCw== X-Received: by 10.55.104.132 with SMTP id d126mr31164157qkc.142.1507227261780; Thu, 05 Oct 2017 11:14:21 -0700 (PDT) Received: from wacom-arch2.corp.onewacom.com ([50.225.60.4]) by smtp.gmail.com with ESMTPSA id r58sm8688599qtr.93.2017.10.05.11.14.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Oct 2017 11:14:21 -0700 (PDT) From: Jason Gerecke To: linux-input@vger.kernel.org, Jiri Kosina Cc: Benjamin Tissoires , Ping Cheng , Aaron Skomra , Jason Gerecke , Jason Gerecke Subject: [PATCH] Revert "HID: wacom: generic: Send BTN_TOOL_PEN in prox once the pen enters range" Date: Thu, 5 Oct 2017 11:14:02 -0700 Message-Id: <20171005181402.11149-1-killertofu@gmail.com> X-Mailer: git-send-email 2.14.2 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Benjamin Tissoires --- 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 */