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

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

Issue 256923002: Fixed tab dragging which was broken on high DPI windows for scales other than 100%. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 years, 8 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/app_list/views/apps_grid_view.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_win.cc
diff --git a/chrome/browser/ui/views/tabs/window_finder_win.cc b/chrome/browser/ui/views/tabs/window_finder_win.cc
index eff768ef2747e22a1bded33bab6a49fd970a491a..6d365bdc7e5dee5f936d44f923a5da138109fa68 100644
--- a/chrome/browser/ui/views/tabs/window_finder_win.cc
+++ b/chrome/browser/ui/views/tabs/window_finder_win.cc
@@ -8,6 +8,7 @@
#include "base/win/windows_version.h"
#include "ui/aura/window.h"
#include "ui/gfx/screen.h"
+#include "ui/gfx/win/dpi.h"
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h"
#include "ui/views/win/hwnd_util.h"
@@ -126,16 +127,16 @@ class TopMostFinder : public BaseWindowFinder {
const std::set<HWND>& ignore)
: BaseWindowFinder(ignore),
target_(window),
- screen_loc_(screen_loc),
is_top_most_(false),
tmp_region_(CreateRectRgn(0, 0, 0, 0)) {
+ screen_loc_ = gfx::win::DIPToScreenPoint(screen_loc);
EnumWindows(WindowCallbackProc, as_lparam());
}
// The window we're looking for.
HWND target_;
- // Location of window to find.
+ // Location of window to find in pixel coordinates.
gfx::Point screen_loc_;
// Is target_ the top most window? This is initially false but set to true
@@ -165,7 +166,8 @@ class LocalProcessWindowFinder : public BaseWindowFinder {
if (finder.result_ &&
((base::win::OSInfo::GetInstance()->version() >=
base::win::VERSION_WIN8) ||
- TopMostFinder::IsTopMostWindowAtPoint(finder.result_, screen_loc,
+ TopMostFinder::IsTopMostWindowAtPoint(finder.result_,
+ screen_loc,
ignore))) {
return views::DesktopWindowTreeHostWin::GetContentWindowForHWND(
finder.result_);
@@ -188,12 +190,12 @@ class LocalProcessWindowFinder : public BaseWindowFinder {
LocalProcessWindowFinder(const gfx::Point& screen_loc,
const std::set<HWND>& ignore)
: BaseWindowFinder(ignore),
- screen_loc_(screen_loc),
result_(NULL) {
+ screen_loc_ = gfx::win::DIPToScreenPoint(screen_loc);
EnumThreadWindows(GetCurrentThreadId(), WindowCallbackProc, as_lparam());
}
- // Position of the mouse.
+ // Position of the mouse in pixel coordinates.
gfx::Point screen_loc_;
// The resulting window. This is initially null but set to true in
« no previous file with comments | « no previous file | ui/app_list/views/apps_grid_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698