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

Unified Diff: ui/views/controls/menu/menu_controller.cc

Issue 159713012: Don't track mouse events in HWNDMessageHandler when they are forwarded by the LegacyRenderWidgetHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/legacy_render_widget_host_win.cc ('k') | ui/views/event_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_controller.cc
===================================================================
--- ui/views/controls/menu/menu_controller.cc (revision 250790)
+++ ui/views/controls/menu/menu_controller.cc (working copy)
@@ -2130,16 +2130,15 @@
gfx::Screen* screen = gfx::Screen::GetScreenFor(native_view);
gfx::NativeWindow window = screen->GetWindowAtScreenPoint(screen_loc);
- if (!window)
- return;
-
+ // On Windows, it is ok for window to be NULL. Please refer to the
+ // RepostLocatedEvent function for more information.
#if defined(OS_WIN)
// Release the capture.
SubmenuView* submenu = state_.item->GetRootMenuItem()->GetSubmenu();
submenu->ReleaseCapture();
gfx::NativeView view = submenu->GetWidget()->GetNativeView();
- if (view) {
+ if (view && window) {
DWORD view_tid = GetWindowThreadProcessId(HWNDForNativeView(view), NULL);
if (view_tid != GetWindowThreadProcessId(HWNDForNativeView(window), NULL)) {
// Even though we have mouse capture, windows generates a mouse event if
@@ -2149,6 +2148,9 @@
return;
}
}
+#else
+ if (!window)
+ return;
#endif
scoped_ptr<ui::LocatedEvent> clone;
« no previous file with comments | « content/browser/renderer_host/legacy_render_widget_host_win.cc ('k') | ui/views/event_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698