client: Utilize new handleWindowDevicePixelRatioChanged
Rather than assuming window scale should match the screen scale use an explicit notification system. This fixes issues caused by drift between the two: Task-number: QTBUG-101656 Task-number: QTBUG-93380 Change-Id: I9edb5fd95b8ceeca8073db1f56d81a31bbc9c549 Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
parent
6e7de758be
commit
c2cd7eb609
@ -104,12 +104,17 @@ void QWaylandWindow::initWindow()
|
||||
if (mDisplay->fractionalScaleManager() && qApp->highDpiScaleFactorRoundingPolicy() == Qt::HighDpiScaleFactorRoundingPolicy::PassThrough) {
|
||||
mFractionalScale.reset(new QWaylandFractionalScale(mDisplay->fractionalScaleManager()->get_fractional_scale(mSurface->object())));
|
||||
|
||||
mScale = mFractionalScale->preferredScale();
|
||||
if (mScale != mFractionalScale->preferredScale()) {
|
||||
mScale = mFractionalScale->preferredScale();
|
||||
QWindowSystemInterface::handleWindowDevicePixelRatioChanged(window());
|
||||
}
|
||||
|
||||
connect(mFractionalScale.data(), &QWaylandFractionalScale::preferredScaleChanged, this, [this]() {
|
||||
if (mScale == mFractionalScale->preferredScale()) {
|
||||
return;
|
||||
}
|
||||
mScale = mFractionalScale->preferredScale();
|
||||
QWindowSystemInterface::handleWindowDevicePixelRatioChanged(window());
|
||||
ensureSize();
|
||||
if (mViewport)
|
||||
updateViewport();
|
||||
@ -1326,6 +1331,7 @@ void QWaylandWindow::handleScreensChanged()
|
||||
|
||||
if (scale != mScale) {
|
||||
mScale = scale;
|
||||
QWindowSystemInterface::handleWindowDevicePixelRatioChanged(window());
|
||||
if (mSurface) {
|
||||
if (mViewport)
|
||||
updateViewport();
|
||||
|
Loading…
x
Reference in New Issue
Block a user