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

Unified Diff: ui/views/controls/native/native_view_host_win.cc

Issue 16336027: Enable high dpi in win/views. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 7 years, 6 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 | « ui/gfx/canvas_paint_win.h ('k') | ui/views/widget/aero_tooltip_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/native/native_view_host_win.cc
diff --git a/ui/views/controls/native/native_view_host_win.cc b/ui/views/controls/native/native_view_host_win.cc
index 7f0c92e9ac029b959cb373cfd7934f7f4a9f23e4..24ea19e7ca6affd75960ef1776660fa66c10f2de 100644
--- a/ui/views/controls/native/native_view_host_win.cc
+++ b/ui/views/controls/native/native_view_host_win.cc
@@ -7,6 +7,7 @@
#include <oleacc.h>
#include "base/logging.h"
+#include "ui/base/win/dpi.h"
#include "ui/base/win/hidden_window.h"
#include "ui/base/win/window_impl.h"
#include "ui/gfx/canvas.h"
@@ -90,6 +91,8 @@ void NativeViewHostWin::ShowWidget(int x, int y, int w, int h) {
SWP_NOCOPYBITS |
SWP_NOOWNERZORDER |
SWP_NOZORDER;
+ gfx::Rect bounds = ui::win::DIPToScreenRect(gfx::Rect(x,y,w,h));
+
// Only send the SHOWWINDOW flag if we're invisible, to avoid flashing.
if (!IsWindowVisible(host_->native_view()))
swp_flags = (swp_flags | SWP_SHOWWINDOW) & ~SWP_NOREDRAW;
@@ -99,12 +102,14 @@ void NativeViewHostWin::ShowWidget(int x, int y, int w, int h) {
RECT win_rect;
GetWindowRect(host_->native_view(), &win_rect);
gfx::Rect rect(win_rect);
- SetWindowPos(host_->native_view(), 0, x, y, rect.width(), rect.height(),
+ SetWindowPos(host_->native_view(), 0, bounds.x(), bounds.y(),
+ rect.width(), rect.height(),
swp_flags);
- InstallClip(0, 0, w, h);
+ InstallClip(0, 0, bounds.width(), bounds.height());
} else {
- SetWindowPos(host_->native_view(), 0, x, y, w, h, swp_flags);
+ SetWindowPos(host_->native_view(), 0, bounds.x(), bounds.y(),
+ bounds.width(), bounds.height(), swp_flags);
}
}
« no previous file with comments | « ui/gfx/canvas_paint_win.h ('k') | ui/views/widget/aero_tooltip_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698