From c66732b979a4e9fb34bda062747f84e099a4fcee Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Fri, 30 Aug 2019 13:13:15 +0200 Subject: [PATCH] QSystemTrayIcon: on macOS, hide messages when the user clicks them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is default behavior on macOS, and also the behavior on Windows. [ChangeLog][QtWidgets][QSystemTrayIcon] On macOS, clicking on the message will remove the notification. Change-Id: Ie30f7dacf478af76ccb53d16aea8f122869072c8 Fixes: QTBUG-77150 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm index db64702b8d..b805fad0fe 100644 --- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm +++ b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm @@ -434,8 +434,7 @@ QT_END_NAMESPACE } - (void)userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification { - Q_UNUSED(center); - Q_UNUSED(notification); + [center removeDeliveredNotification:notification]; emit systray->messageClicked(); }