summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/widgets/util/qsystemtrayicon_win.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/widgets/util/qsystemtrayicon_win.cpp b/src/widgets/util/qsystemtrayicon_win.cpp
index d110cb8be4..3f007f24c1 100644
--- a/src/widgets/util/qsystemtrayicon_win.cpp
+++ b/src/widgets/util/qsystemtrayicon_win.cpp
@@ -49,7 +49,9 @@
#include <private/qsystemlibrary_p.h>
#include <private/qguiapplication_p.h>
+#include <private/qhighdpiscaling_p.h>
#include <qpa/qplatformnativeinterface.h>
+#include <qpa/qplatformscreen.h>
#include <QSettings>
#include <QDebug>
#include <QHash>
@@ -335,6 +337,13 @@ bool QSystemTrayIconSys::winEvent( MSG *m, long *result )
Q_ASSERT(q_uNOTIFYICONID == HIWORD(m->lParam));
message = LOWORD(m->lParam);
gpos = QPoint(GET_X_LPARAM(m->wParam), GET_Y_LPARAM(m->wParam));
+ // Drop this chunk when merging to 5.10; code has been moved to Windows QPA.
+ if (const QScreen *primaryScreen = QGuiApplication::primaryScreen()) {
+ if (const QPlatformScreen *screen = primaryScreen->handle()->screenForPosition(gpos)) {
+ gpos = QHighDpi::fromNative(gpos, QHighDpiScaling::factor(screen),
+ screen->geometry().topLeft());
+ }
+ }
} else {
Q_ASSERT(q_uNOTIFYICONID == m->wParam);
message = m->lParam;