summaryrefslogtreecommitdiffstats
path: root/src/process/main.cpp
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@theqtcompany.com>2015-09-22 18:22:04 +0200
committerJake Petroules <jake.petroules@theqtcompany.com>2015-10-13 17:04:07 +0000
commit9553493c55ff35215601de794e396605ae39a0e4 (patch)
tree2d24aff392b44d4692fd869135404fdb8dc188e2 /src/process/main.cpp
parent378c588ccb9659c1c5066ab0da7d956d3843751e (diff)
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 <allan.jensen@theqtcompany.com>
Diffstat (limited to 'src/process/main.cpp')
-rw-r--r--src/process/main.cpp8
1 files changed, 8 insertions, 0 deletions
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<char**>(argv));