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

MacOS: QSystemTrayIcon not responding to the actions

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.9
    • None
    • macOS

    Description

      I am initializing QSystemTrayIcon this way:

      //: Open application
          m_systemTrayMenu->addAction(tr("Open %1").arg(QGuiApplication::applicationName()), [] { Mvvm::Qml::Dialog::showMainWindow(); });
          m_statusAction = m_systemTrayMenu->addAction("...");
          m_statusAction->setEnabled(false);
          m_statusAction->setVisible(false);
          m_systemTrayMenu->addSeparator();
          //: Quit application
          m_systemTrayMenu->addAction(
                  tr("Quit %1").arg(QGuiApplication::applicationName()),
                  [] { Mvvm::Qml::Dialog::quitApplication(); },
                  QKeySequence::Quit);
          m_systemTrayIcon->setContextMenu(m_systemTrayMenu.get());
          m_systemTrayIcon->setToolTip(QGuiApplication::applicationName()); 

      On macos, when i am clicking the tray icon with the right mouse button (or with the left mouse button on older macos versions) and than clicking the action (for example "Open ...") with the left mouse button, that action is not being executed, menu hides, but the tray icon continues to be in the pressed state (its background is a bit darker).

      When I click the tray icon again, the action is executed and it becomes common state (background is transparent).

      Also after the application opens from the tray, the upper menu (File, Edit etc) stops responding to the clicks. 

      The bug is not present on the Qt 5.15.0. 

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            roma Roman Balayan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes