diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-03 23:00:16 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-03 23:00:16 +0000 |
commit | c44058dd2583d031a76a2187ebfb5292386a5299 (patch) | |
tree | 655b1b2130be8df1604a5bb2ae9a37556740744a /ui/views/corewm | |
parent | 0d3bf0a8f21d938133400ce7de44de2e8cca9322 (diff) | |
download | chromium_src-c44058dd2583d031a76a2187ebfb5292386a5299.zip chromium_src-c44058dd2583d031a76a2187ebfb5292386a5299.tar.gz chromium_src-c44058dd2583d031a76a2187ebfb5292386a5299.tar.bz2 |
Tooltips on Windows high DPI machines need to be displayed using pixel locations. We were passing in logical coordinates which caused the tooltips to be displayed incorrectly when Chrome runs in high dpi mode.
BUG=348242
R=sky@chromium.org, sky
Review URL: https://codereview.chromium.org/184843006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254593 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/corewm')
-rw-r--r-- | ui/views/corewm/tooltip_win.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/views/corewm/tooltip_win.cc b/ui/views/corewm/tooltip_win.cc index c774139..34ea171 100644 --- a/ui/views/corewm/tooltip_win.cc +++ b/ui/views/corewm/tooltip_win.cc @@ -12,6 +12,8 @@ #include "ui/base/l10n/l10n_util_win.h" #include "ui/gfx/rect.h" #include "ui/gfx/screen.h" +#include "ui/gfx/win/dpi.h" + namespace views { namespace corewm { @@ -90,6 +92,10 @@ void TooltipWin::PositionTooltip() { tooltip_bounds.AdjustToFit(display.work_area()); if (tooltip_bounds.y() < initial_y) tooltip_bounds.set_y(initial_y - tooltip_bounds.height() - 2); + + // Convert the tooltip bounds to pixel coordinates. SetWindowPos works in + // pixel coordinates. + tooltip_bounds = gfx::win::DIPToScreenRect(tooltip_bounds); SetWindowPos(tooltip_hwnd_, NULL, tooltip_bounds.x(), tooltip_bounds.y(), 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); } |