summaryrefslogtreecommitdiffstats
path: root/win8
diff options
context:
space:
mode:
authorshrikant@chromium.org <shrikant@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-22 22:39:20 +0000
committershrikant@chromium.org <shrikant@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-22 22:39:20 +0000
commit91e9a97b12a4b45956df0e73c12459c2cdaa6529 (patch)
tree18f55807f350488cb476d4937446fc95dabbc553 /win8
parent1ea4f46ac2c6c187037def224c624848d37a4ad3 (diff)
downloadchromium_src-91e9a97b12a4b45956df0e73c12459c2cdaa6529.zip
chromium_src-91e9a97b12a4b45956df0e73c12459c2cdaa6529.tar.gz
chromium_src-91e9a97b12a4b45956df0e73c12459c2cdaa6529.tar.bz2
Modified to capture pixel values in onsizechange notification using GetWindowRect. IWindowSizeChangedEventArgs was returning scaled parameters in HiDPI mode which was causing the issue.
R=ananta@chromium.org, ananta, cpu BUG=306697 Review URL: https://codereview.chromium.org/246483004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265390 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'win8')
-rw-r--r--win8/metro_driver/chrome_app_view_ash.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/win8/metro_driver/chrome_app_view_ash.cc b/win8/metro_driver/chrome_app_view_ash.cc
index 69c4555..a82ab1f 100644
--- a/win8/metro_driver/chrome_app_view_ash.cc
+++ b/win8/metro_driver/chrome_app_view_ash.cc
@@ -1328,13 +1328,14 @@ HRESULT ChromeAppViewAsh::OnSizeChanged(winui::Core::ICoreWindow* sender,
return S_OK;
}
- winfoundtn::Size size;
- HRESULT hr = args->get_Size(&size);
- if (FAILED(hr))
- return hr;
+ // winui::Core::IWindowSizeChangedEventArgs args->Size appears to return
+ // scaled values under HiDPI. We will instead use GetWindowRect() which
+ // should always return values in Pixels.
+ RECT rect = {0};
+ ::GetWindowRect(core_window_hwnd_, &rect);
- uint32 cx = static_cast<uint32>(size.Width);
- uint32 cy = static_cast<uint32>(size.Height);
+ uint32 cx = static_cast<uint32>(rect.right - rect.left);
+ uint32 cy = static_cast<uint32>(rect.bottom - rect.top);
DVLOG(1) << "Window size changed: width=" << cx << ", height=" << cy;
ui_channel_->Send(new MetroViewerHostMsg_WindowSizeChanged(cx, cy));