Commit cc86c54f authored by Mike Wasserman's avatar Mike Wasserman Committed by Commit Bot

Revert incorrect WindowTargeter screen location cleanup

This CL reverts my recent cleanup changes here:
  https://crrev.com/c/1246826/7/ui/aura/window_targeter.cc#b140
The event target may not be |root_window| nor one of its descendants.

Bug: 890062
Test: Touch input on linux desktop works correctly.
Change-Id: Icf49255b55797488ecc186597de910ecde600efc
Reviewed-on: https://chromium-review.googlesource.com/1251467
Commit-Queue: Michael Wasserman <msw@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595206}
parent 5837f940
...@@ -137,9 +137,12 @@ Window* WindowTargeter::FindTargetInRootWindow(Window* root_window, ...@@ -137,9 +137,12 @@ Window* WindowTargeter::FindTargetInRootWindow(Window* root_window,
// This is used for bezel gesture events (eg. swiping in from screen edge). // This is used for bezel gesture events (eg. swiping in from screen edge).
display::Display display = display::Display display =
display::Screen::GetScreen()->GetDisplayNearestWindow(root_window); display::Screen::GetScreen()->GetDisplayNearestWindow(root_window);
const gfx::Point screen_location = // The window target may be null, so use the root's ScreenPositionClient.
event.target() ? event.target()->GetScreenLocation(event) gfx::Point screen_location = event.root_location();
: event.root_location(); if (client::GetScreenPositionClient(root_window)) {
client::GetScreenPositionClient(root_window)
->ConvertPointToScreen(root_window, &screen_location);
}
if (!display.bounds().Contains(screen_location)) if (!display.bounds().Contains(screen_location))
return root_window; return root_window;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment