diff options
author | Ionen Wolkens <ionen@gentoo.org> | 2024-11-04 23:14:14 -0500 |
---|---|---|
committer | Ionen Wolkens <ionen@gentoo.org> | 2024-11-04 23:28:45 -0500 |
commit | d9fd350987a72f9b8c442f4114df342b5a033cd5 (patch) | |
tree | f282ec9c07ab6cbdc9e2d33aa6ce282d43e62fe7 /dev-qt/qtdeclarative | |
parent | media-libs/opencv: add patchelf dep (diff) | |
download | gentoo-d9fd350987a72f9b8c442f4114df342b5a033cd5.tar.gz gentoo-d9fd350987a72f9b8c442f4114df342b5a033cd5.tar.bz2 gentoo-d9fd350987a72f9b8c442f4114df342b5a033cd5.zip |
dev-qt/qtdeclarative: backport fix for QTBUG-129500 in 6.8.0
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
Diffstat (limited to 'dev-qt/qtdeclarative')
-rw-r--r-- | dev-qt/qtdeclarative/files/qtdeclarative-6.8.0-QTBUG-129500.patch | 80 | ||||
-rw-r--r-- | dev-qt/qtdeclarative/qtdeclarative-6.8.0-r5.ebuild (renamed from dev-qt/qtdeclarative/qtdeclarative-6.8.0-r4.ebuild) | 1 |
2 files changed, 81 insertions, 0 deletions
diff --git a/dev-qt/qtdeclarative/files/qtdeclarative-6.8.0-QTBUG-129500.patch b/dev-qt/qtdeclarative/files/qtdeclarative-6.8.0-QTBUG-129500.patch new file mode 100644 index 000000000000..45f165f374d2 --- /dev/null +++ b/dev-qt/qtdeclarative/files/qtdeclarative-6.8.0-QTBUG-129500.patch @@ -0,0 +1,80 @@ +Prevents crashes in Neochat and other kirigami-based applications. +https://bugreports.qt.io/browse/QTBUG-129500 +https://codereview.qt-project.org/c/qt/qtdeclarative/+/595278 +--- a/src/quick/items/qquickitem.cpp ++++ b/src/quick/items/qquickitem.cpp +@@ -8757,7 +8757,8 @@ + QPointF p = mapToScene(point); + if (item) { +- const QQuickWindow *itemWindow = item->window(); +- if (itemWindow != nullptr && itemWindow != window()) +- p = itemWindow->mapFromGlobal(window()->mapToGlobal(p)); ++ const auto *itemWindow = item->window(); ++ const auto *thisWindow = window(); ++ if (thisWindow && itemWindow && itemWindow != thisWindow) ++ p = itemWindow->mapFromGlobal(thisWindow->mapToGlobal(p)); + + p = item->mapFromScene(p); +@@ -8864,7 +8865,8 @@ + if (item) { + p = item->mapToScene(point); +- +- if (item->window() != window()) +- p = window()->mapFromGlobal(item->window()->mapToGlobal(p)); ++ const auto *itemWindow = item->window(); ++ const auto *thisWindow = window(); ++ if (thisWindow && itemWindow && itemWindow != thisWindow) ++ p = thisWindow->mapFromGlobal(itemWindow->mapToGlobal(p)); + } + return mapFromScene(p); +--- a/tests/auto/quick/qquickitem2/data/mapCoordinatesWithWindows.qml ++++ b/tests/auto/quick/qquickitem2/data/mapCoordinatesWithWindows.qml +@@ -49,3 +49,14 @@ + } + } ++ ++ property Item itemWithoutWindowA: Item { ++ x: 20; y: 20 ++ } ++ property Item itemWithoutWindowB: Item { ++ x: 40; y: 40 ++ Item { ++ objectName: "childItemWithoutWindow" ++ x: 30; y: 30 ++ } ++ } + } +--- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp ++++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp +@@ -2884,4 +2884,31 @@ + QCOMPARE(childItemInChildWindow->mapFromItem(childItemInOtherWindow, {0, 0}), + globalItemOffset(childItemInOtherWindow, childItemInChildWindow)); ++ ++ // If one or both of the items are not in a scene (yet), they are assumed ++ // to eventually be in the same scene. ++ ++ auto *itemWithoutWindowA = root->property("itemWithoutWindowA").value<QQuickItem*>(); ++ QVERIFY(itemWithoutWindowA); ++ auto *itemWithoutWindowB = root->property("itemWithoutWindowB").value<QQuickItem*>(); ++ QVERIFY(itemWithoutWindowB); ++ auto *childItemWithoutWindow = itemWithoutWindowB->findChild<QQuickItem*>("childItemWithoutWindow"); ++ QVERIFY(childItemWithoutWindow); ++ ++ QPoint itemWithoutWindowAPos = itemWithoutWindowA->position().toPoint(); ++ QPoint itemWithoutWindowBPos = itemWithoutWindowB->position().toPoint(); ++ ++ QCOMPARE(itemWithoutWindowA->mapToItem(childItemWithoutWindow, {0, 0}), ++ itemWithoutWindowAPos - (itemWithoutWindowBPos + childItemWithoutWindow->position())); ++ QCOMPARE(itemWithoutWindowA->mapFromItem(childItemWithoutWindow, {0, 0}), ++ (itemWithoutWindowBPos + childItemWithoutWindow->position()) - itemWithoutWindowAPos); ++ ++ QCOMPARE(itemWithoutWindowA->mapToItem(childItem, {0, 0}), ++ itemWithoutWindowAPos - itemPos); ++ QCOMPARE(itemWithoutWindowA->mapFromItem(childItem, {0, 0}), ++ itemPos - itemWithoutWindowAPos); ++ QCOMPARE(childItem->mapToItem(itemWithoutWindowA, {0, 0}), ++ itemPos - itemWithoutWindowAPos); ++ QCOMPARE(childItem->mapFromItem(itemWithoutWindowA, {0, 0}), ++ itemWithoutWindowAPos - itemPos); + } + diff --git a/dev-qt/qtdeclarative/qtdeclarative-6.8.0-r4.ebuild b/dev-qt/qtdeclarative/qtdeclarative-6.8.0-r5.ebuild index 84d5899b33b6..3dcd70472b17 100644 --- a/dev-qt/qtdeclarative/qtdeclarative-6.8.0-r4.ebuild +++ b/dev-qt/qtdeclarative/qtdeclarative-6.8.0-r5.ebuild @@ -38,6 +38,7 @@ PATCHES=( "${FILESDIR}"/${PN}-6.7.3-QTBUG-125053.patch "${FILESDIR}"/${PN}-6.7.3-QTBUG-129622.patch "${FILESDIR}"/${PN}-6.8.0-QTBUG-129797.patch + "${FILESDIR}"/${PN}-6.8.0-QTBUG-129500.patch ) src_configure() { |