Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: non-client windows messages on legacy widget host (again) #33444

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -13,7 +13,7 @@ messages in the legacy window handle layer.
These conditions are regularly hit with WCO-enabled windows on Windows.

diff --git a/content/browser/renderer_host/legacy_render_widget_host_win.cc b/content/browser/renderer_host/legacy_render_widget_host_win.cc
index 4a894ef70eeb1d8489049aef552c9bae4f24ae62..f5049d730a850f2947023f976b25fb772e42107a 100644
index 4a894ef70eeb1d8489049aef552c9bae4f24ae62..df101c53861a83f107d459270c37b3b497a00cb0 100644
--- a/content/browser/renderer_host/legacy_render_widget_host_win.cc
+++ b/content/browser/renderer_host/legacy_render_widget_host_win.cc
@@ -288,12 +288,12 @@ LRESULT LegacyRenderWidgetHostHWND::OnMouseRange(UINT message,
Expand All @@ -31,19 +31,15 @@ index 4a894ef70eeb1d8489049aef552c9bae4f24ae62..f5049d730a850f2947023f976b25fb77
tme.hwndTrack = hwnd();
tme.dwHoverTime = 0;
TrackMouseEvent(&tme);
@@ -319,12 +319,11 @@ LRESULT LegacyRenderWidgetHostHWND::OnMouseRange(UINT message,
message, w_param, l_param, &msg_handled);
handled = msg_handled;
// If the parent did not handle non client mouse messages, we call
- // DefWindowProc on the message with the parent window handle. This
- // ensures that WM_SYSCOMMAND is generated for the parent and we are
- // out of the picture.
+ // DefWindowProc on the message. This ensures that WM_SYSCOMMAND is
+ // generated.
@@ -324,7 +324,10 @@ LRESULT LegacyRenderWidgetHostHWND::OnMouseRange(UINT message,
// out of the picture.
if (!handled &&
(message >= WM_NCMOUSEMOVE && message <= WM_NCXBUTTONDBLCLK)) {
- ret = ::DefWindowProc(GetParent(), message, w_param, l_param);
+ ret = ::DefWindowProc(hwnd(), message, w_param, l_param);
+ // Send WM_NCMOUSEMOVE messages using the LegacyRenderWidgetHostHWND's
+ // handle so mouse tracking on non-client areas doesn't break.
+ HWND target = message == WM_NCMOUSEMOVE ? hwnd() : GetParent();
+ ret = ::DefWindowProc(target, message, w_param, l_param);
handled = TRUE;
}
}
Expand Down