From ed44fd1002e9657e3a9baa4835f4d2dfd9f8ffd7 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Thu, 2 Apr 2026 16:13:27 -0400 Subject: [PATCH 1/2] fix: prevent use-after-free by using QPointer for widget and focus frame --- ...61-fix-focus-frame-mapto-on-reparent.patch | 44 ++++++++++++++++--- 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/patches/161-fix-focus-frame-mapto-on-reparent.patch b/patches/161-fix-focus-frame-mapto-on-reparent.patch index 435fb30..14d91e5 100644 --- a/patches/161-fix-focus-frame-mapto-on-reparent.patch +++ b/patches/161-fix-focus-frame-mapto-on-reparent.patch @@ -1,8 +1,25 @@ diff --git a/lib/src/style/eventFilters/WidgetWithFocusFrameEventFilter.hpp b/lib/src/style/eventFilters/WidgetWithFocusFrameEventFilter.hpp -index 1234567..abcdefg 100644 +index 1722b4c..1582739 100644 --- a/lib/src/style/eventFilters/WidgetWithFocusFrameEventFilter.hpp +++ b/lib/src/style/eventFilters/WidgetWithFocusFrameEventFilter.hpp -@@ -32,8 +32,16 @@ public: +@@ -5,6 +5,7 @@ + + #include + #include ++#include + #include + #include + +@@ -28,13 +29,27 @@ public: + if (type == QEvent::Paint && !_added) { + QTimer::singleShot(0, this, [this]() { + if (!_added) { +- _added = true; +- _focusFrame->setWidget(_widget); ++ if (_widget && _focusFrame) { ++ _added = true; ++ _focusFrame->setWidget(_widget); ++ } } }); } else if (type == QEvent::Show && _added) { @@ -11,13 +28,28 @@ index 1234567..abcdefg 100644 + // Defer to avoid mapTo() on a partially-connected hierarchy + // after reparenting (same pattern as the Paint path above). + QTimer::singleShot(0, this, [this]() { -+ _focusFrame->setWidget(nullptr); -+ _focusFrame->setWidget(_widget); ++ if (_widget && _focusFrame) { ++ _focusFrame->setWidget(nullptr); ++ _focusFrame->setWidget(_widget); ++ } + }); + } else if (type == QEvent::Hide && _added) { + // Disconnect the focus frame when the widget is hidden (e.g. + // during reparenting) to prevent stale mapTo() calls. -+ _focusFrame->setWidget(nullptr); ++ if (_focusFrame) { ++ _focusFrame->setWidget(nullptr); ++ } } } - + +@@ -42,8 +57,8 @@ public: + } + + private: +- QWidget* _widget{ nullptr }; +- QFocusFrame* _focusFrame{ nullptr }; ++ QPointer _widget; ++ QPointer _focusFrame; + bool _added{ false }; + }; + } // namespace oclero::qlementine From f31aafe9803da04ea85c82635e59f684951135b0 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Fri, 3 Apr 2026 09:59:16 -0400 Subject: [PATCH 2/2] pin pyside6 --- packages/PySide6-Qlementine/pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/PySide6-Qlementine/pyproject.toml b/packages/PySide6-Qlementine/pyproject.toml index 43eb7c6..87568f8 100644 --- a/packages/PySide6-Qlementine/pyproject.toml +++ b/packages/PySide6-Qlementine/pyproject.toml @@ -1,8 +1,8 @@ [build-system] requires = [ "scikit-build-core>=0.10", - "shiboken6-generator>=6.10,<6.11", - "PySide6>=6.10,<6.11", + "shiboken6-generator==6.10.2", + "PySide6==6.10.2", "ruff>=0.4", ] build-backend = "scikit_build_core.build" @@ -15,7 +15,7 @@ description = "PySide6 bindings for Qlementine, a modern QStyle for desktop Qt6 license = "MIT" license-files = ["LICENSE"] readme = "../../README.md" -dependencies = ["PySide6>=6.10,<6.11"] +dependencies = ["PySide6==6.10.2"] classifiers = [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers",