Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-58723

Hiding main window on Ubuntu breaks global menu

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.9.0 RC
    • 5.8.0
    • QPA: X11/XCB
    • 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

        Activity

          People

            mandriver Dmitry Shachnev
            phoerious Janek Bevendorff
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes