Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Issue 237893002: Fix behavior of WindowEventDispatcher::SynthesizeMouseMoveEvent(). (Closed)

Created:
6 years, 8 months ago by hshi1
Modified:
6 years, 8 months ago
Reviewers:
oshima, Daniel Erat, sadrul
CC:
chromium-reviews, ben+aura_chromium.org, kalyank
Visibility:
Public.

Description

Fix behavior of WindowEventDispatcher::SynthesizeMouseMoveEvent(). Synthetic mouse events should be generated when window bounds changes such that the cursor previously outside the window becomes inside, or vice versa, but subject to the following conditions: - If one or more mouse buttons is down, we should synthesize MOUSE_DRAGGED event instead of MOUSE_MOVED, and also set the appropriate mouse button flags. - Do not generate synthesized mouse move events for windows that ignore events, such as the cursor window, because they do not accept synthesized events and pass them directly to the windows beneath. After this fix we can safely re-enable cursor compositing mode. BUG=363651 TEST=trybot and manual testing R=derat@chromium.org, sadrul@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=264669

Patch Set 1 #

Patch Set 2 : Rebased at trunk. #

Patch Set 3 : Add unit test. #

Patch Set 4 : Synthesize DRAGGED events when mouse button is down. Add more unit tests. #

Total comments: 2

Patch Set 5 : Use ASSERT_FALSE instead of EXPECT_FALSE to prevent crashes in test. #

Patch Set 6 : Obtain mouse button flags at the same time we post synthesized events. #

Patch Set 7 : Re-enable cursor compositing. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+124 lines, -22 lines) Patch
M ash/display/mouse_cursor_event_filter.cc View 1 1 chunk +2 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/accessibility/accessibility_manager.cc View 1 2 3 4 5 6 1 chunk +11 lines, -2 lines 0 comments Download
M ui/aura/env.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M ui/aura/window_event_dispatcher.h View 1 2 3 4 5 1 chunk +3 lines, -2 lines 0 comments Download
M ui/aura/window_event_dispatcher.cc View 1 2 3 4 5 8 chunks +17 lines, -14 lines 0 comments Download
M ui/aura/window_event_dispatcher_unittest.cc View 1 2 3 4 6 chunks +90 lines, -0 lines 0 comments Download

Messages

Total messages: 41 (0 generated)
hshi1
PTAL. I propose that we do not synthesize mouse-move event when the OnWindowBoundsChanged occurs for ...
6 years, 8 months ago (2014-04-14 21:54:49 UTC) #1
Daniel Erat
lgtm (although i don't know much about this, so you should hold off for sadrul's ...
6 years, 8 months ago (2014-04-14 21:56:39 UTC) #2
sadrul
Can you explain why the synthesized mouse-move event breaks text-dragging? You should add test coverage ...
6 years, 8 months ago (2014-04-14 22:21:10 UTC) #3
hshi1
On 2014/04/14 22:21:10, sadrul wrote: > Can you explain why the synthesized mouse-move event breaks ...
6 years, 8 months ago (2014-04-14 22:23:57 UTC) #4
sadrul
On 2014/04/14 22:23:57, hshi1 wrote: > On 2014/04/14 22:21:10, sadrul wrote: > > Can you ...
6 years, 8 months ago (2014-04-14 22:27:33 UTC) #5
hshi1
On 2014/04/14 22:27:33, sadrul wrote: > Sounds like we don't want to generate synth-mouse-moves when ...
6 years, 8 months ago (2014-04-14 22:37:57 UTC) #6
sadrul
On 2014/04/14 22:37:57, hshi1 wrote: > On 2014/04/14 22:27:33, sadrul wrote: > > Sounds like ...
6 years, 8 months ago (2014-04-14 23:00:21 UTC) #7
hshi1
sadrul: I tried to override the event_type to MOUSE_DRAGGED for the synthesized event but text ...
6 years, 8 months ago (2014-04-15 00:06:50 UTC) #8
hshi1
On 2014/04/15 00:06:50, hshi1 wrote: > sadrul: I tried to override the event_type to MOUSE_DRAGGED ...
6 years, 8 months ago (2014-04-15 00:27:03 UTC) #9
hshi1
Alternatively, if there's any way to make the cursor "window" not generate any events when ...
6 years, 8 months ago (2014-04-15 00:37:30 UTC) #10
hshi1
@sadrul: PTAL patch set #2. I propose to remove the previous hack in mouse_cursor_event_filter.cc. Instead, ...
6 years, 8 months ago (2014-04-15 01:05:22 UTC) #11
sadrul
not lgtm. We should not need to add to the aura api for this. Perhaps ...
6 years, 8 months ago (2014-04-15 01:33:19 UTC) #12
hshi1
On 2014/04/15 01:33:19, sadrul wrote: > not lgtm. We should not need to add to ...
6 years, 8 months ago (2014-04-15 01:40:13 UTC) #13
hshi1
On 2014/04/15 01:40:13, hshi1 wrote: > On 2014/04/15 01:33:19, sadrul wrote: > > not lgtm. ...
6 years, 8 months ago (2014-04-15 01:45:59 UTC) #14
hshi1
+sky (OWNER of ui/aura) because sadrul has shot down my patch set. I think we ...
6 years, 8 months ago (2014-04-15 02:23:16 UTC) #15
hshi1
See also (internal partner bug: https://code.google.com/p/chrome-os-partner/issues/detail?id=28034) This shows that simply generating DRAG event when mouse ...
6 years, 8 months ago (2014-04-15 04:35:34 UTC) #16
oshima
https://codereview.chromium.org/237893002/diff/20001/ui/aura/window_event_dispatcher.cc File ui/aura/window_event_dispatcher.cc (right): https://codereview.chromium.org/237893002/diff/20001/ui/aura/window_event_dispatcher.cc#newcode688 ui/aura/window_event_dispatcher.cc:688: !window->disallow_synthesize_events()) { can't we simply check ignore_events here?
6 years, 8 months ago (2014-04-15 07:21:29 UTC) #17
hshi1
On 2014/04/15 07:21:29, oshima (OOO April 11 - 21) wrote: > https://codereview.chromium.org/237893002/diff/20001/ui/aura/window_event_dispatcher.cc > File ui/aura/window_event_dispatcher.cc ...
6 years, 8 months ago (2014-04-15 07:41:49 UTC) #18
hshi1
Note that in principle I believe it is 100% correct to disallow generating synthesized events ...
6 years, 8 months ago (2014-04-15 08:29:47 UTC) #19
sadrul
On 2014/04/15 08:29:47, hshi1 wrote: > Note that in principle I believe it is 100% ...
6 years, 8 months ago (2014-04-15 11:03:12 UTC) #20
hshi1
On 2014/04/15 11:03:12, sadrul wrote: > On 2014/04/15 08:29:47, hshi1 wrote: > > Note that ...
6 years, 8 months ago (2014-04-15 13:44:16 UTC) #21
hshi1
On 2014/04/15 13:44:16, hshi1 wrote: > On 2014/04/15 11:03:12, sadrul wrote: > > As I ...
6 years, 8 months ago (2014-04-15 17:11:10 UTC) #22
hshi1
sadrul - PTAL patch set #3. I have added aura unittest WindowEventDispatcherTest.SynthesizeMouseEventsOnWindowBoundsChanged to verify that: ...
6 years, 8 months ago (2014-04-15 22:11:09 UTC) #23
sadrul
On 2014/04/15 17:11:10, hshi1 wrote: > On 2014/04/15 13:44:16, hshi1 wrote: > > On 2014/04/15 ...
6 years, 8 months ago (2014-04-16 16:17:55 UTC) #24
hshi1
On 2014/04/16 16:17:55, sadrul wrote: > On 2014/04/15 17:11:10, hshi1 wrote: > > On 2014/04/15 ...
6 years, 8 months ago (2014-04-16 17:52:27 UTC) #25
hshi1
@sadrul: oh I see what the problem is. It is not enough to set event ...
6 years, 8 months ago (2014-04-16 19:12:55 UTC) #26
hshi1
sadrul: PTAL Patch Set 4. I have fixed the problem with synthetic MOUSE_DRAGGED events when ...
6 years, 8 months ago (2014-04-16 20:34:52 UTC) #27
sadrul
Thanks! lgtm https://codereview.chromium.org/237893002/diff/100001/ui/aura/window_event_dispatcher_unittest.cc File ui/aura/window_event_dispatcher_unittest.cc (right): https://codereview.chromium.org/237893002/diff/100001/ui/aura/window_event_dispatcher_unittest.cc#newcode875 ui/aura/window_event_dispatcher_unittest.cc:875: EXPECT_FALSE(filter->mouse_event_flags().empty()); The above two should be ASSERT, ...
6 years, 8 months ago (2014-04-17 15:39:54 UTC) #28
hshi1
https://codereview.chromium.org/237893002/diff/100001/ui/aura/window_event_dispatcher_unittest.cc File ui/aura/window_event_dispatcher_unittest.cc (right): https://codereview.chromium.org/237893002/diff/100001/ui/aura/window_event_dispatcher_unittest.cc#newcode875 ui/aura/window_event_dispatcher_unittest.cc:875: EXPECT_FALSE(filter->mouse_event_flags().empty()); On 2014/04/17 15:39:54, sadrul wrote: > The above ...
6 years, 8 months ago (2014-04-17 17:24:25 UTC) #29
hshi1
Unfortunately it looks like the synthesized DRAGGED event is crashing DragDropController unit tests. The synthesized ...
6 years, 8 months ago (2014-04-17 18:11:02 UTC) #30
hshi1
sadrul - are you familiar with the DragDropControllerTest? There's a "for" loop in the test ...
6 years, 8 months ago (2014-04-17 18:19:12 UTC) #31
hshi1
I propose Patch Set #6 to address the issue with DragDropControllerTest. I have already verified ...
6 years, 8 months ago (2014-04-17 18:48:56 UTC) #32
hshi1
The CQ bit was checked by hshi@chromium.org
6 years, 8 months ago (2014-04-17 19:47:29 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hshi@chromium.org/237893002/140001
6 years, 8 months ago (2014-04-17 19:48:06 UTC) #34
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-17 21:49:22 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on win_chromium_rel
6 years, 8 months ago (2014-04-17 21:49:22 UTC) #36
hshi1
The CQ bit was checked by hshi@chromium.org
6 years, 8 months ago (2014-04-17 21:53:49 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hshi@chromium.org/237893002/140001
6 years, 8 months ago (2014-04-17 21:54:36 UTC) #38
hshi1
The CQ bit was checked by hshi@chromium.org
6 years, 8 months ago (2014-04-17 22:33:37 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hshi@chromium.org/237893002/160001
6 years, 8 months ago (2014-04-17 22:35:46 UTC) #40
hshi1
6 years, 8 months ago (2014-04-17 23:24:06 UTC) #41
Message was sent while issue was closed.
Committed patchset #7 manually as r264669 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698