From 9553493c55ff35215601de794e396605ae39a0e4 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 22 Sep 2015 18:22:04 +0200 Subject: make the render process DPI-aware On Windows, system calls that retrieve screen properties (like GetSystemMetrics to get the size of a scroll bar button) are dependent on the DPI awareness setting of the calling process. The render process must use the same DPI awareness setting as the browser process. Retrieve the DPI awareness of the parent process in the render process and set it accordingly. Task-number: QTBUG-48380 Change-Id: Ic17d29d0f584e3cf230ac6ea2b08e3aa0d87ccdd Reviewed-by: Allan Sandfeld Jensen --- src/process/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/process/main.cpp') diff --git a/src/process/main.cpp b/src/process/main.cpp index 446465ef7..8328c0022 100644 --- a/src/process/main.cpp +++ b/src/process/main.cpp @@ -146,8 +146,16 @@ int stat64_proxy(const char *path, struct stat64 *buf) #endif #endif // defined(OS_LINUX) +#ifdef Q_OS_WIN +void initDpiAwareness(); +#endif // defined(Q_OS_WIN) + int main(int argc, const char **argv) { +#ifdef Q_OS_WIN + initDpiAwareness(); +#endif + // QCoreApplication needs a non-const pointer, while the // ContentMain in Chromium needs the pointer to be const. QCoreApplication qtApplication(argc, const_cast(argv)); -- cgit v1.2.3