summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2017-12-13 12:10:39 +0100
committerKai Koehne <kai.koehne@qt.io>2018-01-04 09:45:24 +0000
commit196ae04aa7c9b274880409fb38a050db99197900 (patch)
tree5f3401fd34af9906ba2ff37841e7a71120e0bda1
parent6f242a9389369242b23a61dcb59fc610dc27bb05 (diff)
Initialize ScreenWin singleton to fix dpi glitches on Windows
Static function ScreenWin::GetSystemMetricsInDIP returned an incorrect (already scaled) size for the scrollbars. To take system scaling into account an instance of the ScreenWin singleton has to be created once. So let's use ScreenWin directly, instead of DesktopScreenQt, which is just a mock object anyway. [ChangeLog][Windows] Fixed issues with too large scrollbars on Hi-DPI monitors. Task-number: QTBUG-60705 Change-Id: I7cbc10e98b2a5217b0a0e78afb32818c1cb199d7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Viktor Engelmann <viktor.engelmann@qt.io>
-rw-r--r--src/core/content_browser_client_qt.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index d446d8ff4..14ec42fb7 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -102,6 +102,10 @@
#include "web_engine_context.h"
#include "web_engine_library_info.h"
+#if defined(Q_OS_WIN)
+#include "ui/display/win/screen_win.h"
+#endif
+
#if defined(Q_OS_LINUX)
#include "global_descriptors_qt.h"
#include "ui/base/resource/resource_bundle.h"
@@ -292,8 +296,11 @@ public:
{
base::ThreadRestrictions::SetIOAllowed(true);
// Like ChromeBrowserMainExtraPartsViews::PreCreateThreads does.
+#if defined(Q_OS_WIN)
+ display::Screen::SetScreenInstance(new display::win::ScreenWin);
+#else
display::Screen::SetScreenInstance(new DesktopScreenQt);
-
+#endif
return 0;
}