Summary:
The previous code worked as follows:
- when we show a menu we would emit aboutToShow on the root item
- we would then recursively load the /entire/ menu structure before
emitting we were done.
Because we only sent aboutToShow on the root menu, any clients that were connected to
a submenu's aboutToShow never got an aboutToShow signal.
This patch does the (in retrospect far more obvious) fix of just
calling aboutToShow dynamically on each submenu when it's time to show,
then updating the menu whilst it's showing.
Test Plan: Dynamic menus now work, DBus traffic is considerably down
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: broulik, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D4059
Summary:
When updating a menu we would always delete all the actions and recreate
them.
This caused a problem that we would also be deleting submenus and
recreating them, meaning when we update the applet's submenu before
showing it, our submenu will always be destroyed.
This patch uses the DBusMenuItem IDs to re-use existing QAction / QMenu
objects and only create new instances when needed. It should also be (in
theory) faster as there's a lot less object creation every update.
Also replace QSignalMapper with a lambda and replace replace QMap<int,
QPointer<QAction*> with QMap<int, QAction*> and a lambda to do cleanup
on deletion.
Test Plan:
Tweked the applet to update before showing
Original QMenu object used before showing still has all the items
Reviewers: #plasma
Subscribers: broulik, markg, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D4057
Summary:
libdbusmenu-qt had a quirkin it that meant it would spawn a nested
event loop when updating a menu.
In order to fix StatusNotifierItem I ended up making a fork of the 3
small classes that we needed and applying a fix, whilst we waited for
upstream.
We also were including a complicated library+plugin that handled import
and exporting, just to do importing which is rather pointless.
When appmenu support was restored, we ended up re-linking the original
dbusmenu-qt library. The original still had the same bug, manifesting in
a whole new way of Kate's bookmarks menu automatically closing when you
click on it.
This patch shares the same libdbusmenu-qt lib we have for the SNI
dataengine with the one for appmenu.
Test Plan:
Everything compiles after removing the find package for old libdbusmenu-
qt
Menu in the Plasma applet works a lot better, and doesn't have the bug
of menus randomly closing.
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3926
This contains a temporary fork of the importer, with the main paths
fixed.
The old code spawned a new event loop in the signal QMenu::aboutToShow()
This refetched the menu, even though we had already fetched it, before
calling show.
Spawning new event loops from a QML function, leads to all sorts of
crashes. This
fixes that, and saves some pointless DBus traffic
BUG: 343971
BUG: 345838
BUG: 345933
REVIEW: 123992