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

Unified Diff: ui/views/win/hwnd_message_handler.cc

Issue 2246643002: Only Call EnableChildWindowDpiMessage When Window Has A Frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/win/window_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/win/hwnd_message_handler.cc
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 9b40b5089d88dca57f1a446cb805ed2431a6d7e1..ab5b7ab25d9b903d0619d32c635e6a65acc6f0ad 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -349,6 +349,20 @@ void HWNDMessageHandler::Init(HWND parent, const gfx::Rect& bounds) {
// Create the window.
WindowImpl::Init(parent, bounds);
+ if (delegate_->HasFrame() && base::win::IsProcessPerMonitorDpiAware()) {
+ static auto enable_child_window_dpi_message_func = []() {
+ // Derived signature; not available in headers.
+ // This call gets Windows to scale the non-client area when WM_DPICHANGED
+ // is fired.
+ using EnableChildWindowDpiMessagePtr = LRESULT (WINAPI*)(HWND, BOOL);
+ return reinterpret_cast<EnableChildWindowDpiMessagePtr>(
+ GetProcAddress(GetModuleHandle(L"user32.dll"),
+ "EnableChildWindowDpiMessage"));
+ }();
+ if (enable_child_window_dpi_message_func)
+ enable_child_window_dpi_message_func(hwnd(), TRUE);
+ }
+
prop_window_target_.reset(new ui::ViewProp(hwnd(),
ui::WindowEventTarget::kWin32InputEventTarget,
static_cast<ui::WindowEventTarget*>(this)));
« no previous file with comments | « ui/gfx/win/window_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698