D11586: libdbusmenu-qt: Remove nonexistant actions directly from the menu
This revision was automatically updated to reflect the committed changes. Closed by commit R120:8827bb38806e: libdbusmenu-qt: Remove nonexistant actions directly from the menu (authored by fvogt). REPOSITORY R120 Plasma Workspace CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D11586?vs=30249=30294 REVISION DETAIL https://phabricator.kde.org/D11586 AFFECTED FILES libdbusmenuqt/dbusmenuimporter.cpp To: fvogt, #plasma, davidedmundson, broulik Cc: plasma-devel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
D11586: libdbusmenu-qt: Remove nonexistant actions directly from the menu
fvogt added a comment. Looking at the `WAYLAND_DEBUG` output I think I'm closer to understanding the issue now. When the `QMenu::popup` method is called, the chain "opened Event -> LayoutChanged -> GetLayout" gets started. The menu calculates its size and position, and sometime later creates the zxdg_positioner and finally gets the zxdg_popup_v6. At some point later, the DBus call completes and the menu changes size. This happens with the surface, but the popup position can't retroactively be adjusted to fit. I'm not sure why the menu size calculation reliably occurs after this method got called, though. That's the only point when the menu's sizeHint is wrong (exactly by the Y offset). REPOSITORY R120 Plasma Workspace REVISION DETAIL https://phabricator.kde.org/D11586 To: fvogt, #plasma Cc: plasma-devel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
D11586: libdbusmenu-qt: Remove nonexistant actions directly from the menu
fvogt created this revision. fvogt added a reviewer: Plasma. Restricted Application added a project: Plasma. fvogt requested review of this revision. REVISION SUMMARY The getLayout response handler compares the new list of actions with the current actions in the menu and calls deleteLater on all actions which aren't part of the new list anymore. Then, it adds all actions from the new list which aren't part of the menu yet. As deleteLater only has an effect after the next event processing, the menu still contains them together with the added actions. This resulted in broken size calculations, as even for static menus the item count changed during aboutToShow. Note that this is not a proper solution for the resize issue, as the aboutToShow handler changes the menus content for a reason, the application is free to add/remove items at any point in time. TEST PLAN The context menu for SNI items in the system tray shows at the correct position now. Only tested the wayland session. REPOSITORY R120 Plasma Workspace BRANCH snifix REVISION DETAIL https://phabricator.kde.org/D11586 AFFECTED FILES libdbusmenuqt/dbusmenuimporter.cpp To: fvogt, #plasma Cc: plasma-devel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart