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

Unified Diff: ui/views/event_utils_aura.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
Index: ui/views/event_utils_aura.cc
===================================================================
--- ui/views/event_utils_aura.cc (revision 250790)
+++ ui/views/event_utils_aura.cc (working copy)
@@ -18,16 +18,26 @@
bool RepostLocatedEvent(gfx::NativeWindow window,
const ui::LocatedEvent& event) {
+#if defined(OS_WIN)
+ // On Windows, if the |window| parameter is NULL, then we attempt to repost
+ // the event to the window at the current location, if it is on the current
+ // thread.
+ HWND target_window = NULL;
+ if (!window) {
+ target_window = ::WindowFromPoint(event.location().ToPOINT());
+ if (::GetWindowThreadProcessId(target_window, NULL) !=
+ ::GetCurrentThreadId())
+ return false;
+ } else {
+ if (ViewsDelegate::views_delegate &&
+ !ViewsDelegate::views_delegate->IsWindowInMetro(window))
+ target_window = window->GetDispatcher()->host()->GetAcceleratedWidget();
+ }
+ return RepostLocatedEventWin(target_window, event);
+#endif
if (!window)
return false;
-#if defined(OS_WIN)
- if (ViewsDelegate::views_delegate &&
- !ViewsDelegate::views_delegate->IsWindowInMetro(window)) {
- return RepostLocatedEventWin(
- window->GetDispatcher()->host()->GetAcceleratedWidget(), event);
- }
-#endif
aura::Window* root_window = window->GetRootWindow();
gfx::Point root_loc(event.location());

Powered by Google App Engine
This is Rietveld 408576698