From 5f2b53f13c40c31da21d8352312962bb97cb8c97 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 9 Nov 2020 15:37:35 +0100 Subject: [PATCH] Cocoa: Allow CMD+H to hide the application when a tooltip is visible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since native applications allow CMD+H to hide an application when the tooltip is visible then we should do too. Other popup windows will still block the call. Pick-to: 5.15 Fixes: QTBUG-82626 Change-Id: Ieac86d6b3cb2152a3ba82d8bd850f13bfeedb7c8 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qcocoamenuloader.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qcocoamenuloader.mm b/src/plugins/platforms/cocoa/qcocoamenuloader.mm index 56e5b4bdee..ba37b40f5e 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuloader.mm +++ b/src/plugins/platforms/cocoa/qcocoamenuloader.mm @@ -324,7 +324,8 @@ return [NSApp validateMenuItem:menuItem]; if (menuItem.action == @selector(hide:)) { - if (QCocoaIntegration::instance()->activePopupWindow()) + auto *w = QCocoaIntegration::instance()->activePopupWindow(); + if (w && (w->window()->type() != Qt::ToolTip)) return NO; return [NSApp validateMenuItem:menuItem]; }