summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2014-09-16 16:37:32 +0200
committerTony Sarajärvi <tony.sarajarvi@digia.com>2014-09-16 22:42:50 +0200
commite409eafe23c8f90a01ed198090c2d7df0d07e708 (patch)
treed01609a7c1f70eb4b6298b013756d322f86ebc69 /src/plugins/platforms
parentbb3d2ca9f18071537888622310ca0cb7f587e61d (diff)
OSX: emit aboutToShow signal for top-level dock menu.
Qt sets a QCocoaMenuDelegate on every menu it creates in order to emit the (OSX specific) aboutToShow signal. However, there are a few cases where OSX will copy a menu without copying the delegate. One of those cases is the dock: the result of -[NSApplication applicationDockMenu:] is used to create a new menu, to which a few more items are copied. This copy is then send back to the dock. This patch invokes the delegate's -menuWillOpen: method when -[NSApplication applicationDockMenu:] is called. Note that sub-menus won't receive the call-back, because the dock doesn't tell the application what happens after returning from applicationDockMenu:. Task-number: QTBUG-39604 Change-Id: I0e06df371a3d77342ae4b7148041214e5c4579d7 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
index 92358ecc74..24ad75ceec 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
+++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
@@ -163,6 +163,9 @@ static void cleanupCocoaApplicationDelegate()
- (NSMenu *)applicationDockMenu:(NSApplication *)sender
{
Q_UNUSED(sender);
+ // Manually invoke the delegate's -menuWillOpen: method.
+ // See QTBUG-39604 (and its fix) for details.
+ [[dockMenu delegate] menuWillOpen:dockMenu];
return [[dockMenu retain] autorelease];
}