diff --git a/0001-Revert-QMenu-hide-when-a-QWidgetAction-fires-the-tri.patch b/0001-Revert-QMenu-hide-when-a-QWidgetAction-fires-the-tri.patch new file mode 100644 index 0000000..25eb4e4 --- /dev/null +++ b/0001-Revert-QMenu-hide-when-a-QWidgetAction-fires-the-tri.patch @@ -0,0 +1,139 @@ +From 9928d66764337494d0e99208a3418fcd01ac3e66 Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Wed, 27 May 2020 10:48:45 +0200 +Subject: [PATCH] Revert "QMenu: hide when a QWidgetAction fires the trigged + signal" + +This reverts commit b4669b919048c1dbdac2b3e9b2e79f3d023aa078. +--- + src/widgets/widgets/qmenu.cpp | 9 +-- + .../auto/widgets/widgets/qmenu/tst_qmenu.cpp | 79 ------------------- + 2 files changed, 4 insertions(+), 84 deletions(-) + +diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp +index 865e3b2fb6..2878344f07 100644 +--- a/src/widgets/widgets/qmenu.cpp ++++ b/src/widgets/widgets/qmenu.cpp +@@ -1470,9 +1470,6 @@ void QMenuPrivate::_q_actionTriggered() + } + } + activateCausedStack(list, action, QAction::Trigger, false); +- // if a widget action fires, we need to hide the menu explicitly +- if (qobject_cast(action)) +- hideUpToMenuBar(); + } + } + } +@@ -1640,8 +1637,10 @@ void QMenu::initStyleOption(QStyleOptionMenuItem *option, const QAction *action) + + Widgets can be inserted into menus with the QWidgetAction class. + Instances of this class are used to hold widgets, and are inserted +- into menus with the addAction() overload that takes a QAction. If the +- QWidgetAction fires the triggered() signal, the menu will close. ++ into menus with the addAction() overload that takes a QAction. ++ ++ Conversely, actions can be added to widgets with the addAction(), ++ addActions() and insertAction() functions. + + \warning To make QMenu visible on the screen, exec() or popup() should be + used instead of show(). +diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp +index 5a24995caf..22494f3d24 100644 +--- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp ++++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp +@@ -116,7 +116,6 @@ private slots: + void QTBUG20403_nested_popup_on_shortcut_trigger(); + void QTBUG47515_widgetActionEnterLeave(); + void QTBUG8122_widgetActionCrashOnClose(); +- void widgetActionTriggerClosesMenu(); + + void QTBUG_10735_crashWithDialog(); + #ifdef Q_OS_MAC +@@ -1408,84 +1407,6 @@ void tst_QMenu::QTBUG8122_widgetActionCrashOnClose() + QTRY_VERIFY(menu->isHidden()); + } + +-/*! +- Test that a QWidgetAction that fires closes the menus that it is in. +-*/ +-void tst_QMenu::widgetActionTriggerClosesMenu() +-{ +- class ButtonAction : public QWidgetAction +- { +- public: +- ButtonAction() +- : QWidgetAction(nullptr) +- {} +- +- void click() +- { +- if (pushButton) +- pushButton->click(); +- } +- +- protected: +- QWidget *createWidget(QWidget *parent) +- { +- QPushButton *button = new QPushButton(QLatin1String("Button"), parent); +- connect(button, &QPushButton::clicked, this, &QAction::trigger); +- +- if (!pushButton) +- pushButton = button; +- return button; +- } +- +- private: +- QPointer pushButton; +- }; +- +- QMenu menu; +- QMenu submenu; +- +- int menuTriggeredCount = 0; +- int menuAboutToHideCount = 0; +- QAction *actionTriggered = nullptr; +- +- connect(&menu, &QMenu::triggered, this, [&](QAction *action){ +- ++menuTriggeredCount; +- actionTriggered = action; +- }); +- connect (&menu, &QMenu::aboutToHide, this, [&](){ +- ++menuAboutToHideCount; +- }); +- +- QAction regularAction(QLatin1String("Action")); +- ButtonAction widgetAction; +- +- submenu.addAction(®ularAction); +- submenu.addAction(&widgetAction); +- +- menu.addMenu(&submenu); +- menu.addAction(®ularAction); +- menu.addAction(&widgetAction); +- +- menu.popup(QPoint(200,200)); +- submenu.popup(QPoint(250,250)); +- if (!QTest::qWaitForWindowExposed(&menu) || !QTest::qWaitForWindowExposed(&submenu)) +- QSKIP("Failed to show menus, aborting test"); +- +- regularAction.trigger(); +- QVERIFY(menu.isVisible()); +- QVERIFY(submenu.isVisible()); +- QCOMPARE(menuTriggeredCount, 1); +- QCOMPARE(actionTriggered, ®ularAction); +- menuTriggeredCount = 0; +- actionTriggered = nullptr; +- +- widgetAction.click(); +- QVERIFY(!menu.isVisible()); +- QVERIFY(!submenu.isVisible()); +- QCOMPARE(menuTriggeredCount, 1); +- QCOMPARE(menuAboutToHideCount, 1); +- QCOMPARE(actionTriggered, &widgetAction); +-} + + class MyMenu : public QMenu + { +-- +2.25.1 + diff --git a/libqt5-qtbase.changes b/libqt5-qtbase.changes index 96842d9..fe1b4cf 100644 --- a/libqt5-qtbase.changes +++ b/libqt5-qtbase.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 27 08:48:52 UTC 2020 - Fabian Vogt + +- Add patch to avoid behaviour change causing crashes (kde#419526): + * 0001-Revert-QMenu-hide-when-a-QWidgetAction-fires-the-tri.patch + ------------------------------------------------------------------- Tue May 26 09:44:55 UTC 2020 - Callum Farmer diff --git a/libqt5-qtbase.spec b/libqt5-qtbase.spec index 773534a..45331bf 100644 --- a/libqt5-qtbase.spec +++ b/libqt5-qtbase.spec @@ -55,6 +55,7 @@ Source99: libqt5-qtbase-rpmlintrc # patches 0-1000 are openSUSE and/or non-upstream(able) patches # Patch1: 0001-Lower-required-version-of-OpenSSL-to-1.1.0.patch Patch2: fix-build-openssl-1.1.0.patch +Patch3: 0001-Revert-QMenu-hide-when-a-QWidgetAction-fires-the-tri.patch # PATCH-FIX-OPENSUSE disable-rc4-ciphers-bnc865241.diff bnc#865241-- Exclude rc4 ciphers from being used by default Patch6: disable-rc4-ciphers-bnc865241.diff Patch8: tell-the-truth-about-private-api.patch