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

Unified Diff: chrome/browser/ui/views/tabs/window_finder_x11.cc

Issue 1003863005: Fix tab drag and drop with hi-dpi. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tab drag and drop with hi-dpi. Created 5 years, 9 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 | « no previous file | ui/views/widget/desktop_aura/desktop_screen_x11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..db7a4cc2527594ac7c3a0dbe90b236fde942d06d 100644
--- a/chrome/browser/ui/views/tabs/window_finder_x11.cc
+++ b/chrome/browser/ui/views/tabs/window_finder_x11.cc
@@ -4,8 +4,23 @@
#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"
+namespace {
+
+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()));
+}
+
+} // anonymous namespace
+
#if defined(USE_ASH)
gfx::NativeWindow GetLocalProcessWindowAtPointAsh(
const gfx::Point& screen_point,
@@ -24,5 +39,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);
}
« no previous file with comments | « no previous file | ui/views/widget/desktop_aura/desktop_screen_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698