Chromium Code Reviews| Index: chrome/browser/ui/views/tabs/window_finder_x11.cc |
| diff --git a/chrome/browser/ui/views/tabs/window_finder_x11.cc b/chrome/browser/ui/views/tabs/window_finder_x11.cc |
| index f7511233d856a2b11d78bfcd0a7a1e62455f5d1e..c800287408cb6da66db6e2e99444928c00dae5c9 100644 |
| --- a/chrome/browser/ui/views/tabs/window_finder_x11.cc |
| +++ b/chrome/browser/ui/views/tabs/window_finder_x11.cc |
| @@ -4,6 +4,8 @@ |
| #include "chrome/browser/ui/views/tabs/window_finder.h" |
| +#include "ui/gfx/geometry/point_conversions.h" |
| +#include "ui/gfx/screen.h" |
| #include "ui/views/widget/desktop_aura/x11_topmost_window_finder.h" |
| #if defined(USE_ASH) |
| @@ -12,6 +14,15 @@ gfx::NativeWindow GetLocalProcessWindowAtPointAsh( |
| const std::set<gfx::NativeWindow>& ignore); |
| #endif |
| +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())); |
| +} |
| + |
|
sadrul
2015/03/20 22:02:03
These two functions should be in anonymous namespa
stapelberg
2015/03/20 23:17:05
Done.
|
| gfx::NativeWindow GetLocalProcessWindowAtPoint( |
| chrome::HostDesktopType host_desktop_type, |
| const gfx::Point& screen_point, |
| @@ -24,5 +35,5 @@ gfx::NativeWindow GetLocalProcessWindowAtPoint( |
| // The X11 server is the canonical state of what the window stacking order |
| // is. |
| views::X11TopmostWindowFinder finder; |
| - return finder.FindLocalProcessWindowAt(screen_point, ignore); |
| + return finder.FindLocalProcessWindowAt(DIPToPixelPoint(screen_point), ignore); |
| } |