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

dbus systray: toggling icon visibility does not work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.12
    • Fix Version/s: None
    • Labels:
      None
    • Platform/s:
      Linux/X11

      Description

      Test on Ubuntu 18.04 with Gnome. Run:

      QT_LOGGING_RULES=qt.qpa.tray.debug=true ./systray
      

      Verify that dbus tray is used:

      qt.qpa.tray: D-Bus tray available: true
      

      Try toggling "Show Icon" checkbox in the test application, icon is always visible.

      To test X11 systray, install TopIcons Plus gnome extension. Force Qt to use X11 systray (Is there an envvar for switching code paths? ):

      diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
      index 1003812767..8719e432fe 100644
      --- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
      +++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
      @@ -100,6 +100,7 @@ enum { defaultSystemFontSize = 9 };
       
       #if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON)
       static bool isDBusTrayAvailable() {
      +    return false;
           static bool dbusTrayAvailable = false;
           static bool dbusTrayAvailableKnown = false;
           if (!dbusTrayAvailableKnown) {
      @@ -116,6 +117,7 @@ static bool isDBusTrayAvailable() {
       #ifndef QT_NO_DBUS
       static bool checkDBusGlobalMenuAvailable()
       {
      +    return false;
           const QDBusConnection connection = QDBusConnection::sessionBus();
           static const QString registrarService = QStringLiteral("com.canonical.AppMenu.Registrar");
           if (const auto iface = connection.interface())
      @@ -125,6 +127,7 @@ static bool checkDBusGlobalMenuAvailable()
       
       static bool isDBusGlobalMenuAvailable()
       {
      +    return false;
           static bool dbusGlobalMenuAvailable = checkDBusGlobalMenuAvailable();
           return dbusGlobalMenuAvailable;
       }
      

      Now toggling works.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            srutledg Shawn Rutledge
            Reporter:
            paeglis Gatis Paeglis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes