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

Issue 159713012: Don't track mouse events in HWNDMessageHandler when they are forwarded by the LegacyRenderWidgetHost (Closed)

Created:
6 years, 10 months ago by ananta
Modified:
6 years, 10 months ago
Reviewers:
cpu_(ooo_6.6-7.5), sky
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam, tfarina
Visibility:
Public.

Description

Don't track mouse events in HWNDMessageHandler when they are forwarded by the LegacyRenderWidgetHostHWND class. We use the TrackMouseEvent API in HWNDMessageHandler when we receive a WM_MOUSEMOVE message. This is to ensure that Windows sends us a WM_MOUSELEAVE message when the cursor leaves our window bounds. Tooltips use this message to dismiss the tooltip for e.g. Technically when the mouse enters the child window (LegacyRenderWidgetHostHWND) it has left the parent window. We end up getting WM_MOUSELEAVE messages for WM_MOUSEMOVES which are sent to the parent window by the LegacyRenderWidgetHostHWND class causing tooltips to not show up and some other bugs. Fixes as below:- 1. Add a special marker in the hiword of the WPARAM in WM_MOUSEMOVE messages sent by the LegacyRenderWidgetHostHWND class. This is to indicate to the parent that it should not track these mouse moves. 2. When we lose activation in HWNDMessageHandler we post a dummy WM_MOUSELEAVE message. This is enable tooltips if they were visible to be dismissed for e.g Based on code inspection a WM_MOUSELEAVE message should not cause any issues. 3. Forward WM_MOUSEWHEEL and WM_MOUSEHWHEEL messages via SendMessage to the parent without mucking with the parameters. The offsets are in screen coordinates in these messages. 4. Reposting events today fails when we click on the (LegacyRenderWidgetHostHWND) HWND. This is because the current code attempts to find an aura Window at the location which fails. I changed the RepostLocatedEvent function to allow a NULL window parameter on Windows. We attempt to forward the event to the HWND at the current location if it is on the same thread. BUG=342323, 342298, 342299, 341879, 343246 R=cpu@chromium.org, sky@chromium.org, sky Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=251190

Patch Set 1 : #

Total comments: 2

Patch Set 2 : #

Patch Set 3 : #

Total comments: 8

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 3

Patch Set 7 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+90 lines, -24 lines) Patch
M base/win/win_util.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/renderer_host/legacy_render_widget_host_win.h View 1 2 3 4 3 chunks +5 lines, -0 lines 0 comments Download
M content/browser/renderer_host/legacy_render_widget_host_win.cc View 1 2 3 4 4 chunks +53 lines, -11 lines 0 comments Download
M ui/views/controls/menu/menu_controller.cc View 1 2 3 2 chunks +6 lines, -4 lines 0 comments Download
M ui/views/event_utils.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M ui/views/event_utils_aura.cc View 1 2 1 chunk +17 lines, -7 lines 0 comments Download
M ui/views/win/hwnd_message_handler.cc View 1 2 3 4 5 6 2 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
ananta
6 years, 10 months ago (2014-02-12 02:04:33 UTC) #1
sky
Superclassing like this makes me extremely nervous. Is there no other way? https://codereview.chromium.org/159713012/diff/120001/content/browser/renderer_host/legacy_render_widget_host_win.cc File content/browser/renderer_host/legacy_render_widget_host_win.cc ...
6 years, 10 months ago (2014-02-12 14:36:31 UTC) #2
ananta
On 2014/02/12 14:36:31, sky wrote: > Superclassing like this makes me extremely nervous. Is there ...
6 years, 10 months ago (2014-02-12 22:17:05 UTC) #3
sky
https://codereview.chromium.org/159713012/diff/330001/content/browser/renderer_host/legacy_render_widget_host_win.cc File content/browser/renderer_host/legacy_render_widget_host_win.cc (right): https://codereview.chromium.org/159713012/diff/330001/content/browser/renderer_host/legacy_render_widget_host_win.cc#newcode136 content/browser/renderer_host/legacy_render_widget_host_win.cc:136: // Mark the WM_MOUSEMOVE message with a special flag ...
6 years, 10 months ago (2014-02-12 22:51:29 UTC) #4
ananta
https://codereview.chromium.org/159713012/diff/330001/content/browser/renderer_host/legacy_render_widget_host_win.cc File content/browser/renderer_host/legacy_render_widget_host_win.cc (right): https://codereview.chromium.org/159713012/diff/330001/content/browser/renderer_host/legacy_render_widget_host_win.cc#newcode136 content/browser/renderer_host/legacy_render_widget_host_win.cc:136: // Mark the WM_MOUSEMOVE message with a special flag ...
6 years, 10 months ago (2014-02-12 23:17:07 UTC) #5
sky
I thought that if you didn't do a TrackMouse you're not guaranteed to get an ...
6 years, 10 months ago (2014-02-12 23:45:10 UTC) #6
ananta
Added code to track mouse events in the child. We send the WM_MOUSELEAVE to the ...
6 years, 10 months ago (2014-02-13 19:52:31 UTC) #7
cpu_(ooo_6.6-7.5)
lgtm I think part of the confusion is that wm_mouseleave is not in the range ...
6 years, 10 months ago (2014-02-13 22:35:17 UTC) #8
sky
LGTM
6 years, 10 months ago (2014-02-13 22:39:07 UTC) #9
ananta
https://codereview.chromium.org/159713012/diff/1030001/ui/views/win/hwnd_message_handler.cc File ui/views/win/hwnd_message_handler.cc (right): https://codereview.chromium.org/159713012/diff/1030001/ui/views/win/hwnd_message_handler.cc#newcode1640 ui/views/win/hwnd_message_handler.cc:1640: if (event.type() == ui::ET_MOUSE_MOVED && !HasCapture() && On 2014/02/13 ...
6 years, 10 months ago (2014-02-13 22:47:34 UTC) #10
ananta
6 years, 10 months ago (2014-02-13 22:47:37 UTC) #11
ananta
6 years, 10 months ago (2014-02-13 23:49:27 UTC) #12
Message was sent while issue was closed.
Committed patchset #7 manually as r251190 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698