Skip to content

Commit

Permalink
Cocoa: Allow CMD+H to hide the application when a tooltip is visible
Browse files Browse the repository at this point in the history
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ø <[email protected]>
  • Loading branch information
AndyShawQt committed Nov 10, 2020
1 parent 5b136ab commit 5f2b53f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/plugins/platforms/cocoa/qcocoamenuloader.mm
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ - (BOOL)validateMenuItem:(NSMenuItem*)menuItem
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];
}
Expand Down

0 comments on commit 5f2b53f

Please sign in to comment.