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

Unified Diff: chrome/app/chrome_exe_main_win.cc

Issue 2118953002: Add Per-Monitor DPI Switches for Windows 10 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@framefix
Patch Set: CR Feedback 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 | « no previous file | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/chrome_exe_main_win.cc
diff --git a/chrome/app/chrome_exe_main_win.cc b/chrome/app/chrome_exe_main_win.cc
index 86677bf87e7255515594a1417cf827e4257dc42f..944849fcbdd1d159bd45003bb056dc0f8487374f 100644
--- a/chrome/app/chrome_exe_main_win.cc
+++ b/chrome/app/chrome_exe_main_win.cc
@@ -127,7 +127,20 @@ BOOL SetProcessDPIAwareWrapper() {
}
void EnableHighDPISupport() {
- if (!SetProcessDpiAwarenessWrapper(PROCESS_SYSTEM_DPI_AWARE)) {
+ // Enable per-monitor DPI for Win10 or above instead of Win8.1 since Win8.1
+ // does not have EnableChildWindowDpiMessage, necessary for correct non-client
+ // area scaling across monitors.
+ bool allowed_platform = base::win::GetVersion() >= base::win::VERSION_WIN10;
+ const base::CommandLine* command_line =
+ base::CommandLine::ForCurrentProcess();
+ bool per_monitor_dpi_switch =
+ command_line->HasSwitch(switches::kEnablePerMonitorDpi) &&
+ !command_line->HasSwitch(switches::kDisablePerMonitorDpi);
+ PROCESS_DPI_AWARENESS process_dpi_awareness =
+ allowed_platform && per_monitor_dpi_switch
+ ? PROCESS_PER_MONITOR_DPI_AWARE
+ : PROCESS_SYSTEM_DPI_AWARE;
+ if (!SetProcessDpiAwarenessWrapper(process_dpi_awareness)) {
SetProcessDPIAwareWrapper();
}
}
« no previous file with comments | « no previous file | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698