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

This was a regression from 395e2d9bc4.

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
Pick-to: 6.0 5.15
Change-Id: Ia4dc5356bf0377a9d55f238caf5bf1becd95648d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
bb10
Tor Arne Vestbø 2021-01-25 14:09:56 +01:00
parent 37b0bad8ad
commit fce391fefb
1 changed files with 1 additions and 1 deletions

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()