summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Mencken <dougmencken@gmail.com>2015-10-29 20:09:40 -0400
committerNorbert Thiebaud <nthiebaud@gmail.com>2015-11-02 11:37:56 +0000
commitbe1b03a4b0f61b49a3aba8d6b78ae69be7295785 (patch)
treebc38554996f5605ed827bd9cb4806dbf7339a14b
parenttoolkit: pMouseEvt must not be captured (diff)
downloadcore-be1b03a4b0f61b49a3aba8d6b78ae69be7295785.tar.gz
core-be1b03a4b0f61b49a3aba8d6b78ae69be7295785.zip
dock icon's menu doesn't begin with separator anymore
... even when there's no open windows Change-Id: I8c1d8f254e621d1867a100ad984f8b77ed8cfc5a Reviewed-on: https://gerrit.libreoffice.org/19677 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
-rw-r--r--sfx2/source/appl/shutdowniconaqua.mm4
-rw-r--r--vcl/osx/salframe.cxx12
2 files changed, 12 insertions, 4 deletions
diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm
index 4fd1ee54839f..e231aac97a2b 100644
--- a/sfx2/source/appl/shutdowniconaqua.mm
+++ b/sfx2/source/appl/shutdowniconaqua.mm
@@ -487,9 +487,7 @@ void aqua_init_systray()
if( [NSApp respondsToSelector: @selector(addDockMenuItem:)] )
{
[pDockSubMenu setSubmenu: pDockMenu];
- // insert a separator to the dock menu
- [NSApp performSelector:@selector(addDockMenuItem:) withObject: [NSMenuItem separatorItem]];
- // and now add the submenu
+ // add the submenu
[NSApp performSelector:@selector(addDockMenuItem:) withObject: pDockSubMenu];
}
else
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 1ce314ee2b85..8634ce9ee0df 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -114,8 +114,13 @@ AquaSalFrame::~AquaSalFrame()
delete mpGraphics;
if( mpDockMenuEntry )
+ {
+ NSMenu* pDock = AquaSalInstance::GetDynamicDockMenu();
// life cycle comment: the menu has ownership of the item, so no release
- [AquaSalInstance::GetDynamicDockMenu() removeItem: mpDockMenuEntry];
+ [pDock removeItem: mpDockMenuEntry];
+ if ( [[pDock itemAtIndex: 0] isSeparatorItem] )
+ [pDock removeItemAtIndex: 0];
+ }
if ( mpNSView ) {
[AquaA11yFactory revokeView: mpNSView];
[mpNSView release];
@@ -298,6 +303,11 @@ void AquaSalFrame::SetTitle(const OUString& rTitle)
if( mpDockMenuEntry == NULL )
{
NSMenu* pDock = AquaSalInstance::GetDynamicDockMenu();
+
+ NSMenuItem* pTopItem = [pDock itemAtIndex: 0];
+ if ( [pTopItem hasSubmenu] )
+ [pDock insertItem: [NSMenuItem separatorItem] atIndex: 0];
+
mpDockMenuEntry = [pDock insertItemWithTitle: pTitle
action: @selector(dockMenuItemTriggered:)
keyEquivalent: @""