From 6c9208d611587e589852d143139ea354d9cd439c Mon Sep 17 00:00:00 2001 From: kkz Date: Fri, 8 Apr 2022 11:18:21 +0800 Subject: [PATCH] sync patch QTBUG-82601-Fix-under-non-integer-scaling-incorrect-update-area.patch from openEuler-20.03-LTS-SP2 --- ...nteger-scaling-incorrect-update-area.patch | 63 +++++++++++++++++++ qt5-qtbase.spec | 10 ++- 2 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 QTBUG-82601-Fix-under-non-integer-scaling-incorrect-update-area.patch diff --git a/QTBUG-82601-Fix-under-non-integer-scaling-incorrect-update-area.patch b/QTBUG-82601-Fix-under-non-integer-scaling-incorrect-update-area.patch new file mode 100644 index 0000000..db018a2 --- /dev/null +++ b/QTBUG-82601-Fix-under-non-integer-scaling-incorrect-update-area.patch @@ -0,0 +1,63 @@ +Index: qtbase-opensource-src/src/gui/kernel/qhighdpiscaling_p.h +=================================================================== +--- qtbase-opensource-src.orig/src/gui/kernel/qhighdpiscaling_p.h ++++ qtbase-opensource-src/src/gui/kernel/qhighdpiscaling_p.h +@@ -416,8 +416,10 @@ inline QRegion toNativeLocalRegion(const + qreal scaleFactor = QHighDpiScaling::factor(window); + QRegion pixelRegon; + for (const QRect &rect : pointRegion) { +- pixelRegon += QRect(toNative(rect.topLeft(), scaleFactor), +- toNative(rect.size(), scaleFactor)); ++ const QPointF topLeftF = rect.topLeft(); ++ const QSizeF sizeF = rect.size(); ++ pixelRegon += QRectF(toNative(topLeftF, scaleFactor, QPointF(0,0)), ++ toNative(sizeF, scaleFactor)).toRect(); + } + return pixelRegon; + } +Index: qtbase-opensource-src/src/gui/painting/qpaintengine_raster.cpp +=================================================================== +--- qtbase-opensource-src.orig/src/gui/painting/qpaintengine_raster.cpp ++++ qtbase-opensource-src/src/gui/painting/qpaintengine_raster.cpp +@@ -1333,7 +1333,7 @@ void QRasterPaintEngine::clip(const QRec + QPaintEngineEx::clip(rect, op); + return; + +- } else if (!setClipRectInDeviceCoords(s->matrix.mapRect(rect), op)) { ++ } else if (!setClipRectInDeviceCoords(s->matrix.mapRect(QRectF(rect)).toRect(), op)) { + QPaintEngineEx::clip(rect, op); + return; + } +Index: qtbase-opensource-src/src/gui/painting/qtransform.cpp +=================================================================== +--- qtbase-opensource-src.orig/src/gui/painting/qtransform.cpp ++++ qtbase-opensource-src/src/gui/painting/qtransform.cpp +@@ -1518,7 +1518,27 @@ QRegion QTransform::map(const QRegion &r + } + + if (t == TxScale && r.rectCount() == 1) +- return QRegion(mapRect(r.boundingRect())); ++ { ++ QRegion res; ++ if(m11() < 0 || m22() < 0) ++ { ++ for(const QRect& rect : r) ++ res += mapRect(QRectF(rect)).toRect(); ++ } ++ else { ++ QVarLengthArray rects; ++ rects.reserve(r.rectCount()); ++ for(const QRect& rect : r) ++ { ++ QRect nr = mapRect(QRectF(rect)).toRect(); ++ if(!nr.isEmpty()) ++ rects.append(nr); ++ } ++ res.setRects(rects.constData(),rects.count()); ++ } ++ return res; ++ } ++ + + QPainterPath p = map(qt_regionToPath(r)); + return p.toFillPolygon(QTransform()).toPolygon(); diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index e8090a8..b6279c5 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -13,7 +13,7 @@ Name: qt5-qtbase Summary: Core component of Qt toolkit Version: 5.11.1 -Release: 12 +Release: 13 License: LGPLv2 with exceptions or GPLv3 with exceptions Url: http://qt-project.org/ Source0: https://download.qt.io/new_archive/qt/5.11/%{version}/submodules/qtbase-everywhere-src-%{version}.tar.xz @@ -33,8 +33,9 @@ Patch0008: qt5-qtbase-cxxflag.patch Patch0009: qt5-qtbase-5.9.1-firebird.patch Patch0010: qtbase-everywhere-src-5.11.1-python3.patch Patch0011: qt5-qtbase-glibc.patch +Patch0012: QTBUG-82601-Fix-under-non-integer-scaling-incorrect-update-area.patch -Patch6000: CVE-2018-15518.patch +Patch6000: CVE-2018-15518.patch Patch6001: CVE-2015-9541.patch Patch6002: CVE-2019-18281.patch @@ -403,6 +404,9 @@ fi %changelog +* Tue Feb 8 2022 zhaoshuang - 5.11.1-13 +- add a patch to fix cursor shifting related issue + * Thu Apr 22 2021 wangyue - 5.11.1-12 - fix CVE-2019-18281 @@ -410,7 +414,7 @@ fi - fix CVE-2015-9541 * Fri Sep 18 2020 liuweibo - 5.11.1-10 -- Fix Source0 +- Fix Source0 * Wed Dec 25 2019 fengbing - 5.11.1-9 - Type:cves -- Gitee