QSystemTrayIcon: Fix geometry() to work with scaling enabled
Add missing call to QHighDpi::fromNativePixels(), retrieving the screen from the menu. Task-number: QTBUG-79248 Change-Id: I9f358c8010615c3f96ed9dc3b6666013ae9a0ed9 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>bb10
parent
e52239f525
commit
78d2a04a01
|
|
@ -42,6 +42,7 @@
|
|||
#include <QtGui/qpa/qplatformsystemtrayicon.h>
|
||||
#include <qpa/qplatformtheme.h>
|
||||
#include <private/qguiapplication_p.h>
|
||||
#include <private/qhighdpiscaling_p.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QStyle>
|
||||
|
|
@ -75,10 +76,14 @@ void QSystemTrayIconPrivate::remove_sys()
|
|||
|
||||
QRect QSystemTrayIconPrivate::geometry_sys() const
|
||||
{
|
||||
if (qpa_sys)
|
||||
return qpa_sys->geometry();
|
||||
else
|
||||
if (!qpa_sys)
|
||||
return QRect();
|
||||
auto screen = QGuiApplication::primaryScreen();
|
||||
#if QT_CONFIG(menu)
|
||||
if (menu)
|
||||
screen = menu->screen();
|
||||
#endif
|
||||
return QHighDpi::fromNativePixels(qpa_sys->geometry(), screen);
|
||||
}
|
||||
|
||||
void QSystemTrayIconPrivate::updateIcon_sys()
|
||||
|
|
|
|||
Loading…
Reference in New Issue