New issue
Advanced search Search tips

Issue 746581 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: 7
NextAction: 2017-07-28
OS: Windows
Pri: 1
Type: Bug

Blocking:
issue 714183



Sign in to add a comment

Make pen inputs behave like touch inputs on Windows

Project Member Reported by lanwei@chromium.org, Jul 19 2017

Issue description

Right now, we are sending mouse events when we receive WM_POINTER message from pen input devices. We should make pen inputs behave like touch inputs on Windows to support scroll, so we should send touch events instead. 
 
The NextAction date has arrived: 2017-07-28
Blocking: 714183
Labels: -Pri-3 M-62 Pri-1
Project Member

Comment 4 by bugdroid1@chromium.org, Aug 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3704d0e52397cbe9f22c4bc56400a85b4c8873b5

commit 3704d0e52397cbe9f22c4bc56400a85b4c8873b5
Author: Dave Tapuska <dtapuska@chromium.org>
Date: Wed Aug 09 04:12:39 2017

Make pen inputs behave like touch inputs

We should send touch events and pointer events instead of mouse events
when we receive WM_POINTER message from pen input devices. The touch
events are sent when the pen presses the tablet or screen, otherwise
send the pointer events when pen is hovering in the range of the tablet.

This breaks the text selection,
https://bugs.chromium.org/p/chromium/issues/detail?id=749119

This CL was originally written as
https://chromium-review.googlesource.com/c/575720

Bug:  746581 
Change-Id: If4d4dd3a8e83ac7b2200e48cfd38034edaf0ba71
Reviewed-on: https://chromium-review.googlesource.com/606947
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#492820}
[modify] https://crrev.com/3704d0e52397cbe9f22c4bc56400a85b4c8873b5/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
[modify] https://crrev.com/3704d0e52397cbe9f22c4bc56400a85b4c8873b5/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
[modify] https://crrev.com/3704d0e52397cbe9f22c4bc56400a85b4c8873b5/ui/views/win/hwnd_message_handler.cc
[modify] https://crrev.com/3704d0e52397cbe9f22c4bc56400a85b4c8873b5/ui/views/win/hwnd_message_handler.h
[modify] https://crrev.com/3704d0e52397cbe9f22c4bc56400a85b4c8873b5/ui/views/win/hwnd_message_handler_delegate.h

Comment 5 by rbyers@chromium.org, Aug 10 2017

Cc: -dtapu...@chromium.org lanwei@chromium.org rbyers@chromium.org
Owner: dtapu...@chromium.org
Project Member

Comment 6 by bugdroid1@chromium.org, Aug 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bfdc3e1f495e659edf213e6a3aa8ad74703b3638

commit bfdc3e1f495e659edf213e6a3aa8ad74703b3638
Author: Dave Tapuska <dtapuska@chromium.org>
Date: Fri Aug 18 14:41:07 2017

Make pen behave like touch when in contact.

In order to enable a good interaction with the rest of Chrome it was
too difficult to teach views about PointerEvents everywhere. To enable
selecting text when the barrel button is down I chose the approach as to
1) If the stylus is hovering; dispatch MouseEvents
2) When contact is first made with the digitizer:
  a) If any button is down (except the tip) dispatch MouseEvents until
     the pen is removed from in contact.
  b) Dispatch TouchEvents until pen is removed from contact.

I've also added code to always handle the pointer events so we don't get
double handling of the pointer events. (Windows will repost the event
as a WM_MOUSE event if the WM_POINTER isn't handled).

BUG= 746581 

Change-Id: I8334971cfff0158d86fad3f849332b400989f923
Reviewed-on: https://chromium-review.googlesource.com/614869
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#495546}
[modify] https://crrev.com/bfdc3e1f495e659edf213e6a3aa8ad74703b3638/ui/views/BUILD.gn
[modify] https://crrev.com/bfdc3e1f495e659edf213e6a3aa8ad74703b3638/ui/views/win/hwnd_message_handler.cc
[modify] https://crrev.com/bfdc3e1f495e659edf213e6a3aa8ad74703b3638/ui/views/win/hwnd_message_handler.h
[add] https://crrev.com/bfdc3e1f495e659edf213e6a3aa8ad74703b3638/ui/views/win/pen_event_processor.cc
[add] https://crrev.com/bfdc3e1f495e659edf213e6a3aa8ad74703b3638/ui/views/win/pen_event_processor.h
[add] https://crrev.com/bfdc3e1f495e659edf213e6a3aa8ad74703b3638/ui/views/win/pen_event_processor_unittest.cc

Project Member

Comment 7 by bugdroid1@chromium.org, Aug 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d72be829918df21e7707bad9781ec31c310b6006

commit d72be829918df21e7707bad9781ec31c310b6006
Author: Dave Tapuska <dtapuska@chromium.org>
Date: Fri Aug 18 21:09:26 2017

Make pen behave like touch for input.

Avoid gesture show/long press on touch events generated from pen.
Selection will be done via the barrel button.

Avoid resetting the touch selection controller on mouse events that
are synthesized or generated from touch.

BUG= 746581 

Change-Id: Ibc52c4005f50bc112f1e77f7585ed4889c6f3984
Reviewed-on: https://chromium-review.googlesource.com/615468
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Timothy Dresser <tdresser@chromium.org>
Cr-Commit-Position: refs/heads/master@{#495683}
[modify] https://crrev.com/d72be829918df21e7707bad9781ec31c310b6006/content/browser/renderer_host/input/touch_selection_controller_client_aura.cc
[modify] https://crrev.com/d72be829918df21e7707bad9781ec31c310b6006/ui/events/gesture_detection/gesture_detector.cc
[modify] https://crrev.com/d72be829918df21e7707bad9781ec31c310b6006/ui/events/gesture_detection/gesture_detector.h
[modify] https://crrev.com/d72be829918df21e7707bad9781ec31c310b6006/ui/events/gesture_detection/gesture_provider_unittest.cc

Project Member

Comment 8 by bugdroid1@chromium.org, Aug 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1a91c488845c9b304ef81fd5a12f4433339f3dff

commit 1a91c488845c9b304ef81fd5a12f4433339f3dff
Author: Dave Tapuska <dtapuska@chromium.org>
Date: Fri Aug 18 23:02:35 2017

Enable pen behaving like touch by default.

Flip setting to enabled. This behavior is intended to match changes
in Windows 10 how pens behave coming in the Fall Creators Update.

BUG= 746581 

Change-Id: Ibf1af5e05778da4843adf20819bee17376464320
Reviewed-on: https://chromium-review.googlesource.com/619990
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#495726}
[modify] https://crrev.com/1a91c488845c9b304ef81fd5a12f4433339f3dff/ui/views/win/hwnd_message_handler.cc

Project Member

Comment 9 by bugdroid1@chromium.org, Aug 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/14f440183c8fff65e443083cb2fcc6a05565ad78

commit 14f440183c8fff65e443083cb2fcc6a05565ad78
Author: Dave Tapuska <dtapuska@chromium.org>
Date: Sat Aug 19 14:31:19 2017

Make text selection work with barrel selection.

Select text with the barrel button with stylus. Text selection will no
longer work with the tip of the stylus but the barrel button needs to be
pressed.

BUG= 746581 

Change-Id: I65b50a68f816b39cfe183c8fc7fbd0e1003053b6
Reviewed-on: https://chromium-review.googlesource.com/615540
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Rick Byers <rbyers@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#495815}
[add] https://crrev.com/14f440183c8fff65e443083cb2fcc6a05565ad78/third_party/WebKit/LayoutTests/fast/events/selectstart-by-drag-stylus.html
[modify] https://crrev.com/14f440183c8fff65e443083cb2fcc6a05565ad78/third_party/WebKit/Source/core/input/MouseEventManager.cpp
[modify] https://crrev.com/14f440183c8fff65e443083cb2fcc6a05565ad78/third_party/WebKit/public/platform/WebPointerProperties.h

Project Member

Comment 11 by bugdroid1@chromium.org, Aug 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a59fdb6f6cc574085c0d7940a1d70e3253d69da3

commit a59fdb6f6cc574085c0d7940a1d70e3253d69da3
Author: Dave Tapuska <dtapuska@chromium.org>
Date: Wed Aug 23 16:28:27 2017

Add setting for barrel button drag.

To enable the exact behaviour before changing the direct manipulation
stylus allow the user to turn off barrel button drag for selection.

BUG= 746581 

Change-Id: I24312e9af4158a026cd8a255d045a8814713a764
Reviewed-on: https://chromium-review.googlesource.com/624715
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496705}
[modify] https://crrev.com/a59fdb6f6cc574085c0d7940a1d70e3253d69da3/content/browser/renderer_host/render_view_host_impl.cc
[modify] https://crrev.com/a59fdb6f6cc574085c0d7940a1d70e3253d69da3/content/public/common/common_param_traits_macros.h
[modify] https://crrev.com/a59fdb6f6cc574085c0d7940a1d70e3253d69da3/content/public/common/web_preferences.h
[modify] https://crrev.com/a59fdb6f6cc574085c0d7940a1d70e3253d69da3/content/renderer/render_view_impl.cc
[modify] https://crrev.com/a59fdb6f6cc574085c0d7940a1d70e3253d69da3/third_party/WebKit/LayoutTests/fast/events/selectstart-by-drag-stylus.html
[modify] https://crrev.com/a59fdb6f6cc574085c0d7940a1d70e3253d69da3/third_party/WebKit/Source/core/exported/WebSettingsImpl.cpp
[modify] https://crrev.com/a59fdb6f6cc574085c0d7940a1d70e3253d69da3/third_party/WebKit/Source/core/exported/WebSettingsImpl.h
[modify] https://crrev.com/a59fdb6f6cc574085c0d7940a1d70e3253d69da3/third_party/WebKit/Source/core/frame/Settings.json5
[modify] https://crrev.com/a59fdb6f6cc574085c0d7940a1d70e3253d69da3/third_party/WebKit/Source/core/input/MouseEventManager.cpp
[modify] https://crrev.com/a59fdb6f6cc574085c0d7940a1d70e3253d69da3/third_party/WebKit/public/web/WebSettings.h

Status: Fixed (was: Started)

Sign in to add a comment