Issue 129638 in chromium: Touch sends fake mouse events on Windows with --enable-touch-events

12 views
Skip to first unread message

chro...@googlecode.com

unread,
May 24, 2012, 6:25:52 PM5/24/12
to chromi...@chromium.org
Status: Assigned
Owner: gir...@chromium.org
CC: p...@google.com, gideonw...@chromium.org, rjkr...@chromium.org
Labels: OS-Windows Area-UI Type-Bug Pri-2 Touch

New issue 129638 by rby...@chromium.org: Touch sends fake mouse events on
Windows with --enable-touch-events
http://code.google.com/p/chromium/issues/detail?id=129638

Chrome Version : 21.0.1150 canary
OS Version: Win8 consumer preview
URLs (if applicable) : http://chrome.angrybirds.com/

What steps will reproduce the problem?
1. Enable the experimental touch events support
2. Go to a site/page designed only to consume mousemove events (eg.
http://chrome.angrybirds.com)
3. Notice that you can trigger mouse behavior with touch dragging

What is the expected result? What happens instead?

It's a tough trade-off, but the current plan is that touch should NOT send
mouse events (except for the special case of a tap turning into a click
event). In general you can't get a good UX with touch without designing
for it, and trying to pretend touch is a mouse cursor will break down and
potentially cause subtle issues. So when Chrome supports touch, it should
not (by default anyway) be sending mouse events.

Note that ChromeOS already behaves the way we want - Windows and ChromeOS
should behave the same.



chro...@googlecode.com

unread,
May 25, 2012, 10:02:13 AM5/25/12
to chromi...@chromium.org

Comment #2 on issue 129638 by rby...@chromium.org: Touch sends fake mouse
events on Windows with --enable-touch-events
http://code.google.com/p/chromium/issues/detail?id=129638

In case it's not obvious, this means that with --enable-touch-events it's
impossible to scroll using touch (I verified I can still scroll with touch
when this flag is disabled).

Note also that without --enable-touch-events I still see
touchstart/touchend (but not touchmove) events. See
htttp://www.rbyers.net/eventTest.html

chro...@googlecode.com

unread,
May 29, 2012, 10:44:47 AM5/29/12
to chromi...@chromium.org
Updates:
Status: Accepted

Comment #3 on issue 129638 by gir...@chromium.org: Touch sends fake mouse
events on Windows with --enable-touch-events
http://code.google.com/p/chromium/issues/detail?id=129638

I'll handle this one.

chro...@googlecode.com

unread,
May 31, 2012, 12:47:34 AM5/31/12
to chromi...@chromium.org

Comment #5 on issue 129638 by bugdro...@chromium.org: Touch sends fake
mouse events on Windows with --enable-touch-events
http://code.google.com/p/chromium/issues/detail?id=129638#c5

The following revision refers to this bug:
http://src.chromium.org/viewvc/chrome?view=rev&revision=139730

------------------------------------------------------------------------
r139730 | gir...@chromium.org | Wed May 30 21:40:53 PDT 2012

Changed paths:
M
http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/renderer_host/render_widget_host_view_win.cc?r1=139730&r2=139729&pathrev=139730

Ignore (fake) mouse events that are created during a touch (iff we will
handle the touch elsewhere.)

BUG=129638
TEST=


Review URL: https://chromiumcodereview.appspot.com/10454082
------------------------------------------------------------------------

chro...@googlecode.com

unread,
May 31, 2012, 10:48:39 AM5/31/12
to chromi...@chromium.org
Updates:
Status: Fixed

Comment #6 on issue 129638 by gir...@chromium.org: Touch sends fake mouse
events on Windows with --enable-touch-events
http://code.google.com/p/chromium/issues/detail?id=129638

(No comment was entered for this change.)

chro...@googlecode.com

unread,
May 31, 2012, 3:44:18 PM5/31/12
to chromi...@chromium.org

Comment #9 on issue 129638 by rjkr...@chromium.org: Touch sends fake mouse
events on Windows with --enable-touch-events
http://code.google.com/p/chromium/issues/detail?id=129638

I think we should not generate mouse moves for touch.


chro...@googlecode.com

unread,
Jun 7, 2012, 5:21:05 PM6/7/12
to chromi...@chromium.org
Updates:
Status: Assigned

Comment #10 on issue 129638 by rby...@chromium.org: Touch sends fake mouse
events on Windows with --enable-touch-events
http://code.google.com/p/chromium/issues/detail?id=129638

I verified (on the latest canary, build r140957) that this is indeed still
a problem - with --enable-touch-events we get mousemove events whenever you
move your finger (perhaps related, you can't scroll with touch). Use
http://www.rbyers.net/eventTest.html to repro.

chro...@googlecode.com

unread,
Jun 7, 2012, 11:28:52 PM6/7/12
to chromi...@chromium.org

Comment #11 on issue 129638 by gir...@chromium.org: Touch sends fake mouse
events on Windows with --enable-touch-events
http://code.google.com/p/chromium/issues/detail?id=129638

This is true. Windows generates several "mouse" events when the user
touches the screen, and we now ignore most of them (WM_LBUTTONDOWN/UP), but
there are some messages that aren't flag as emulated.

We _might_ be able to track the locations of fake WM_LBUTTONDOWN calls, and
ignore WM_MOUSEMOVE's that happen in the same location.

chro...@googlecode.com

unread,
Jun 12, 2012, 11:38:48 AM6/12/12
to chromi...@chromium.org

Comment #12 on issue 129638 by gir...@chromium.org: Touch sends fake mouse
events on Windows with --enable-touch-events
http://code.google.com/p/chromium/issues/detail?id=129638

Ooof! The first CL ignored the simulated button-down/button-up events, but
let WM_MOUSEMOVE pass. CL forthcoming.

chro...@googlecode.com

unread,
Jun 15, 2012, 10:00:12 AM6/15/12
to chromi...@chromium.org

Comment #13 on issue 129638 by gir...@chromium.org: Touch sends fake mouse
events on Windows with --enable-touch-events
http://code.google.com/p/chromium/issues/detail?id=129638

CL needs to be tested on Win7/touch. This will be done on June 18th.

https://chromiumcodereview.appspot.com/10535131/

chro...@googlecode.com

unread,
Jun 18, 2012, 11:40:40 AM6/18/12
to chromi...@chromium.org

Comment #14 on issue 129638 by gir...@chromium.org: Touch sends fake mouse
events on Windows with --enable-touch-events
http://code.google.com/p/chromium/issues/detail?id=129638

Win8 seems to work perfectly with this patch. Touching the screen does not
fire any touch events, unless you tap the screen (which generates a mouse
messages as per the spec.)

Win7 _mostly_ works. The OS generates a lot of mouse messages, and most of
them are ignored by chrome, except:
(1) when the user first touches an inactive window, a WM_MOUSEOVER and
WM_MOUSEMOVE are fired by the OS, without any flags. This is presumably
sent to activate the window. We have no means to identify that these are
touches.
(2) when a user starts touching an active window, a WM_MOUSEMOVE is sent
at the initial touch location without flags. Subsequent move messages get
flagged. Thus we get one "unflagged" mouse event for each touch.

We could possibly add some logic under Win7 to identify these simulated
mouse messages. We could test to see if the WM_MOUSEMOVE is near a
previous mouse move, we could watch for WM_MOUSEOVER messages that are not
at the edge of the window, we could wait for a second mousemove before we
send the message on.... In all of these cases, I expect that we'd be
introducing some fairly complex and flakey code, and so I recommend against
this kind of kludge.

chro...@googlecode.com

unread,
Jun 18, 2012, 11:47:40 AM6/18/12
to chromi...@chromium.org
Updates:
Status: Fixed

Comment #15 on issue 129638 by gir...@chromium.org: Touch sends fake mouse
events on Windows with --enable-touch-events
http://code.google.com/p/chromium/issues/detail?id=129638

Flagging as fixed. Gideon, please reopen if the remaining issues (from
comment 14) are still a concern.

chro...@googlecode.com

unread,
Jun 18, 2012, 11:54:40 AM6/18/12
to chromi...@chromium.org
Updates:
Status: Started

Comment #16 on issue 129638 by gir...@chromium.org: Touch sends fake mouse
events on Windows with --enable-touch-events
http://code.google.com/p/chromium/issues/detail?id=129638

chro...@googlecode.com

unread,
Jun 18, 2012, 2:11:40 PM6/18/12
to chromi...@chromium.org

Comment #17 on issue 129638 by gideonw...@chromium.org: Touch sends fake
mouse events on Windows with --enable-touch-events
http://code.google.com/p/chromium/issues/detail?id=129638

Awesome! Thanks a lot, Gene. I'll find a way to play around with this later
today and let you know what we find on Win8.

chro...@googlecode.com

unread,
Jun 18, 2012, 2:45:40 PM6/18/12
to chromi...@chromium.org

Comment #18 on issue 129638 by bugdro...@chromium.org: Touch sends fake
mouse events on Windows with --enable-touch-events
http://code.google.com/p/chromium/issues/detail?id=129638#c18

The following revision refers to this bug:
http://src.chromium.org/viewvc/chrome?view=rev&revision=142757

------------------------------------------------------------------------
r142757 | gir...@chromium.org | Mon Jun 18 11:13:57 PDT 2012

Changed paths:
M
http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/renderer_host/render_widget_host_view_win.cc?r1=142757&r2=142756&pathrev=142757

Ignore simulated mouse move messages.


BUG=129638
TEST=


Review URL: https://chromiumcodereview.appspot.com/10535131
------------------------------------------------------------------------

chro...@googlecode.com

unread,
Jun 18, 2012, 4:45:40 PM6/18/12
to chromi...@chromium.org
Updates:
Status: Fixed

Comment #19 on issue 129638 by gir...@chromium.org: Touch sends fake mouse
events on Windows with --enable-touch-events
Reply all
Reply to author
Forward
0 new messages