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

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

Issue 2093993003: Add Plumbing for WM_DPICHANGED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screenprepare
Patch Set: Adjust Non-Square Scaling Factor Check Created 4 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/views/win/hwnd_message_handler.h ('k') | ui/views/win/hwnd_message_handler_delegate.h » ('j') | 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 d8c14ee9b2776f12091f4af804e3da9a69df6ff0..6c926d5166018a53c6e9c4b1c93b403f31e15f12 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -28,6 +28,7 @@
#include "ui/base/win/mouse_wheel_util.h"
#include "ui/base/win/shell.h"
#include "ui/base/win/touch_input.h"
+#include "ui/display/win/dpi.h"
#include "ui/events/event.h"
#include "ui/events/event_utils.h"
#include "ui/events/keycodes/keyboard_code_conversion_win.h"
@@ -1395,6 +1396,18 @@ LRESULT HWNDMessageHandler::OnDwmCompositionChanged(UINT msg,
return 0;
}
+LRESULT HWNDMessageHandler::OnDpiChanged(UINT msg,
+ WPARAM w_param,
+ LPARAM l_param) {
+ if (LOWORD(w_param) != HIWORD(w_param))
+ NOTIMPLEMENTED() << "Received non-square scaling factors";
+
+ SetBoundsInternal(gfx::Rect(*reinterpret_cast<RECT*>(l_param)), false);
+ delegate_->HandleWindowScaleFactorChanged(
+ display::win::GetScalingFactorFromDPI(LOWORD(w_param)));
+ return 0;
+}
+
void HWNDMessageHandler::OnEnterMenuLoop(BOOL from_track_popup_menu) {
if (menu_depth_++ == 0)
delegate_->HandleMenuLoop(true);
« no previous file with comments | « ui/views/win/hwnd_message_handler.h ('k') | ui/views/win/hwnd_message_handler_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698