File fix-appmenu.patch of Package plasmoid-active-window-control
diff -ur a/plugin/libdbusmenuqt/dbusmenuimporter.cpp b/plugin/libdbusmenuqt/dbusmenuimporter.cpp
--- a/plugin/libdbusmenuqt/dbusmenuimporter.cpp 2018-11-18 23:06:23.546073389 +0100
+++ b/plugin/libdbusmenuqt/dbusmenuimporter.cpp 2018-11-19 10:36:49.684868492 +0100
@@ -410,7 +410,9 @@
for (QAction *action: menu->actions()) {
int id = action->property(DBUSMENU_PROPERTY_ID).toInt();
if (! newDBusMenuItemIds.contains(id)) {
- menu->removeAction(action);
+ // Not calling removeAction() as QMenu will immediately close when it becomes empty,
+ // which can happen when an application completely reloads this menu.
+ // When the action is deleted deferred, it is removed from the menu.
action->deleteLater();
d->m_actionForId.remove(id);
}