!15 合并双屏登录页面锁屏异常patch

Merge pull request !15 from hanpinlong/openkylin/yangtze
This commit is contained in:
hanpinlong 2023-06-19 06:55:40 +00:00 committed by Gitee
commit 3072411b62
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 23 additions and 13 deletions

View File

@ -59,6 +59,10 @@
# define ARCH_PROCESSOR "x86_64" # define ARCH_PROCESSOR "x86_64"
#elif defined(Q_PROCESSOR_IA64) #elif defined(Q_PROCESSOR_IA64)
# define ARCH_PROCESSOR "ia64" # define ARCH_PROCESSOR "ia64"
#elif defined(Q_PROCESSOR_LOONGARCH_64)
# define ARCH_PROCESSOR "loongarch64"
#elif defined(Q_PROCESSOR_LOONGARCH)
# define ARCH_PROCESSOR "loongarch"
#elif defined(Q_PROCESSOR_MIPS_64) #elif defined(Q_PROCESSOR_MIPS_64)
# define ARCH_PROCESSOR "mips64" # define ARCH_PROCESSOR "mips64"
#elif defined(Q_PROCESSOR_MIPS) #elif defined(Q_PROCESSOR_MIPS)

View File

@ -228,6 +228,13 @@
# define Q_PROCESSOR_WORDSIZE 8 # define Q_PROCESSOR_WORDSIZE 8
// Q_BYTE_ORDER not defined, use endianness auto-detection // Q_BYTE_ORDER not defined, use endianness auto-detection
#elif defined(_loongarch) || defined(__loongarch__)
# define Q_PROCESSOR_LOONGARCH
# if defined(__loongarch64)
# define Q_PROCESSOR_LOONGARCH_64
# define Q_PROCESSOR_WORDSIZE 8
# endif
/* /*
MIPS family, known revisions: I, II, III, IV, 32, 64 MIPS family, known revisions: I, II, III, IV, 32, 64

View File

@ -396,10 +396,7 @@ qreal QHighDpiScaling::roundScaleFactor(qreal rawFactor)
} }
// Check application object if no environment value was set. // Check application object if no environment value was set.
if (scaleFactorRoundingPolicy == Qt::HighDpiScaleFactorRoundingPolicy::Unset) { if (scaleFactorRoundingPolicy != Qt::HighDpiScaleFactorRoundingPolicy::Unset) {
scaleFactorRoundingPolicy = QGuiApplication::highDpiScaleFactorRoundingPolicy();
} else {
// Make application setting reflect environment
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(scaleFactorRoundingPolicy); QGuiApplication::setHighDpiScaleFactorRoundingPolicy(scaleFactorRoundingPolicy);
} }
} }
@ -460,8 +457,6 @@ QDpi QHighDpiScaling::effectiveLogicalDpi(const QPlatformScreen *screen, qreal r
policyText.constData(), values.constData()); policyText.constData(), values.constData());
} }
} }
if (dpiAdjustmentPolicy == DpiAdjustmentPolicy::Unset)
dpiAdjustmentPolicy = DpiAdjustmentPolicy::UpOnly;
} }
// Apply adjustment policy. // Apply adjustment policy.
@ -539,7 +534,7 @@ void QHighDpiScaling::updateHighDpiScaling()
++i; ++i;
} }
} }
m_active = m_globalScalingActive || m_screenFactorSet || m_pixelDensityScalingActive; m_active = m_globalScalingActive || m_usePixelDensity;
} }
/* /*
@ -684,9 +679,7 @@ QDpi QHighDpiScaling::logicalDpi(const QScreen *screen)
return QDpi(96, 96); return QDpi(96, 96);
if (!m_usePixelDensity) { if (!m_usePixelDensity) {
const qreal screenScaleFactor = screenSubfactor(screen->handle()); return screen->handle()->logicalDpi();
const QDpi dpi = QPlatformScreen::overrideDpi(screen->handle()->logicalDpi());
return QDpi{ dpi.first / screenScaleFactor, dpi.second / screenScaleFactor };
} }
const qreal scaleFactor = rawScaleFactor(screen->handle()); const qreal scaleFactor = rawScaleFactor(screen->handle());

View File

@ -159,12 +159,12 @@ inline QVector2D scale(const QVector2D &value, qreal scaleFactor, QPointF /* ori
inline QPointF scale(const QPointF &pos, qreal scaleFactor, QPointF origin = QPointF(0, 0)) inline QPointF scale(const QPointF &pos, qreal scaleFactor, QPointF origin = QPointF(0, 0))
{ {
return (pos - origin) * scaleFactor + origin; return (pos - origin) * scaleFactor + origin * scaleFactor;
} }
inline QPoint scale(const QPoint &pos, qreal scaleFactor, QPoint origin = QPoint(0, 0)) inline QPoint scale(const QPoint &pos, qreal scaleFactor, QPoint origin = QPoint(0, 0))
{ {
return (pos - origin) * scaleFactor + origin; return (pos - origin) * scaleFactor + origin * scaleFactor;
} }
inline QRect scale(const QRect &rect, qreal scaleFactor, QPoint origin = QPoint(0, 0)) inline QRect scale(const QRect &rect, qreal scaleFactor, QPoint origin = QPoint(0, 0))

View File

@ -410,6 +410,12 @@ QSize QScreen::availableSize() const
QRect QScreen::geometry() const QRect QScreen::geometry() const
{ {
Q_D(const QScreen); Q_D(const QScreen);
if (d->platformScreen)
{
return QHighDpi::fromNativePixels(d->platformScreen->geometry(), this);
}
return d->geometry; return d->geometry;
} }

View File

@ -1568,7 +1568,7 @@ QRegion QTransform::map(const QRegion &r) const
} }
QPainterPath p = map(qt_regionToPath(r)); QPainterPath p = map(qt_regionToPath(r));
return p.toFillPolygon(QTransform()).toPolygon(); return p.toFillPolygon().toPolygon();
} }
struct QHomogeneousCoordinate struct QHomogeneousCoordinate