Re-register global D-Bus menu when restoring window from tray #276
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This resolves issue #271
Description
Ubuntu Unity unregisters global menus when the connected window is hidden. This leaves KeePassXC without a working menu bar when the the window is restored from the system tray.
This patch manually sends a D-Bus call to re-register the window. Unfortunately, it adds D-Bus as a direct dependency on Linux, but I couldn't find another working solution except for disabling native menus altogether.
How Has This Been Tested?
I compiled an AppImage with Qt 5.8 and tested it in an Ubuntu 16.04 virtual machine and on Arch with KDE Plasma 5.9. Plasma 5.9 has never had issues to begin with (because windows weren't automatically unregistered), but it also doesn't show duplicate menus or any other weird behavior after this patch.
Types of changes
Checklist: