macOS: Show system tray icon on mouse button press, not release

This was a regression from 395e2d9bc48941d6.

The system behavior is to show the menu on press, so we follow that.

This is also documented at:

 https://doc.qt.io/qt-5/qsystemtrayicon.html#ActivationReason-enum

Fixes: QTBUG-86518
Change-Id: Ia4dc5356bf0377a9d55f238caf5bf1becd95648d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit fce391fefb0bbdea220aa2c935ca6f154f6121cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tor Arne Vestbø 2021-01-25 14:09:56 +01:00 committed by Qt Cherry-pick Bot
parent 11ceb901d5
commit a6a8a4e06e

View File

@ -102,7 +102,7 @@ void QCocoaSystemTrayIcon::init()
m_statusItem.button.target = m_delegate;
m_statusItem.button.action = @selector(statusItemClicked);
[m_statusItem.button sendActionOn:NSEventMaskLeftMouseUp | NSEventMaskRightMouseUp | NSEventMaskOtherMouseUp];
[m_statusItem.button sendActionOn:NSEventMaskLeftMouseDown | NSEventMaskRightMouseDown | NSEventMaskOtherMouseDown];
}
void QCocoaSystemTrayIcon::cleanup()