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

MacOS: QSystemTrayIcon not responding to the actions

XMLWordPrintable

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

      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. 

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

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

              Created:
              Updated:

                There are no open Gerrit changes