Cocoa: Allow CMD+H to hide the application when a tooltip is visible

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ø <tor.arne.vestbo@qt.io>
bb10
Andy Shaw 2020-11-09 15:37:35 +01:00
parent 5b136abd21
commit 5f2b53f13c
1 changed files with 2 additions and 1 deletions

View File

@ -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];
}