Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.8.0
-
None
-
Ubuntu 14.04/16.04
-
41750492db58ca30a70a685cd6a4ee180c0b4959
Description
Hiding the main window (e.g. for implementing "minimize to tray") breaks the global D-Bus menu on Ubuntu.
When starting the application, the menu is registered via D-Bus:
method call time=1486563446.131639 sender=:1.322 -> destination=com.canonical.AppMenu.Registrar serial=10 path=/com/canonical/AppMenu/Registrar; interface=com.canonical.AppMenu.Registrar; member=RegisterWindow uint32 81788932 object path "/MenuBar/1" signal time=1486563446.132247 sender=:1.19 -> destination=(null destination) serial=7645 path=/com/canonical/AppMenu/Registrar; interface=com.canonical.AppMenu.Registrar; member=WindowRegistered uint32 81788932 string ":1.322" object path "/MenuBar/1"
However, when the window is hidden (hide()), it is unregistered from the AppMenu registrar
signal time=1486563627.268775 sender=:1.19 -> destination=(null destination) serial=7742 path=/com/canonical/AppMenu/Registrar; interface=com.canonical.AppMenu.Registrar; member=WindowUnregistered uint32 81788932
and not re-registered once shown again.
Unfortunately, I can't call QDBusMenuBar::registerMenuBar() because it isn't exported to the public Qt library. My only options are therefore to either implement the D-Bus interface myself or disable native menus.
This issue does not happen on KDE Plasma 5.9, which also supports global menus, since hidden windows are not unregistered.
Attachments
For Gerrit Dashboard: QTBUG-58723 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
188677,3 | Make sure QDBusMenuBar is restored when the window is hidden and shown | 5.8 | qt/qtbase | Status: MERGED | +2 | 0 |
189657,2 | WIP systray example: add hide button and menubar | 5.8 | qt/qtbase | Status: ABANDONED | -2 | 0 |