Chromium Code Reviews| Index: ui/views/widget/desktop_aura/x11_topmost_window_finder.cc |
| diff --git a/ui/views/widget/desktop_aura/x11_topmost_window_finder.cc b/ui/views/widget/desktop_aura/x11_topmost_window_finder.cc |
| index d59b46cf3798755f1bfc8a11995b0723e64cbc18..71330483e6037851fa47aa6b2e7317ccd569d163 100644 |
| --- a/ui/views/widget/desktop_aura/x11_topmost_window_finder.cc |
| +++ b/ui/views/widget/desktop_aura/x11_topmost_window_finder.cc |
| @@ -8,10 +8,20 @@ |
| #include "ui/aura/client/screen_position_client.h" |
| #include "ui/aura/window.h" |
| +#include "ui/gfx/screen.h" |
| #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" |
| namespace views { |
| +float GetDeviceScaleFactor() { |
| + gfx::Display display = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay(); |
| + return display.device_scale_factor(); |
| +} |
| + |
| +gfx::Point DIPToPixelPoint(const gfx::Point& dip_point) { |
| + return ToFlooredPoint(gfx::ScalePoint(dip_point, GetDeviceScaleFactor())); |
| +} |
| + |
| X11TopmostWindowFinder::X11TopmostWindowFinder() : toplevel_(None) { |
| } |
| @@ -21,7 +31,7 @@ X11TopmostWindowFinder::~X11TopmostWindowFinder() { |
| aura::Window* X11TopmostWindowFinder::FindLocalProcessWindowAt( |
| const gfx::Point& screen_loc, |
| const std::set<aura::Window*>& ignore) { |
| - screen_loc_ = screen_loc; |
| + screen_loc_ = DIPToPixelPoint(screen_loc); |
|
sadrul
2015/03/19 23:46:58
Since FindWindowAt() takes screen_loc in physical-
stapelberg
2015/03/20 08:34:40
Done.
|
| ignore_ = ignore; |
| std::vector<aura::Window*> local_process_windows = |