sfx2/source/appl/shutdowniconaqua.mm | 4 +--- vcl/osx/salframe.cxx | 12 +++++++++++- 2 files changed, 12 insertions(+), 4 deletions(-)
New commits: commit be1b03a4b0f61b49a3aba8d6b78ae69be7295785 Author: Douglas Mencken <[email protected]> Date: Thu Oct 29 20:09:40 2015 -0400 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 <[email protected]> Reviewed-by: Norbert Thiebaud <[email protected]> diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm index 4fd1ee5..e231aac 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 1ce314e..8634ce9 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: @"" _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
