From: Jason Gerecke <[email protected]>

As a pen leaves, we need to be sure to reset all events back to zero
so that userspace is able to get the complete pen state when it enters
proximity again.

Signed-off-by: Jason Gerecke <[email protected]>
Reviewed-by: Ping Cheng <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
[[email protected]: Imported into input-wacom repository (5b40104edfb0)]
Signed-off-by: Aaron Armstrong Skomra <[email protected]>
[[email protected]: Backported from input-wacom repository (80c2b9b562ee)]
Signed-off-by: Aaron Armstrong Skomra <[email protected]>
---
 3.17/wacom_wac.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/3.17/wacom_wac.c b/3.17/wacom_wac.c
index da95ea7097b6..944f74d44b8d 100644
--- a/3.17/wacom_wac.c
+++ b/3.17/wacom_wac.c
@@ -2227,10 +2227,10 @@ static void wacom_wac_pen_event(struct hid_device 
*hdev, struct hid_field *field
                return;
 
        /* send pen events only when the pen is in range */
-       if (!wacom_wac->hid_data.inrange_state)
-               return;
-
-       input_event(input, usage->type, usage->code, value);
+       if (wacom_wac->hid_data.inrange_state)
+               input_event(input, usage->type, usage->code, value);
+       else if (wacom_wac->shared->stylus_in_proximity && 
!wacom_wac->hid_data.sense_state)
+               input_event(input, usage->type, usage->code, 0);
 }
 
 static void wacom_wac_pen_pre_report(struct hid_device *hdev,
-- 
2.7.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to