[Libreoffice-commits] core.git: sfx2/source vcl/osx
Douglas Mencken
dougmencken at gmail.com
Mon Nov 2 03:38:20 PST 2015
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 <dougmencken at gmail.com>
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 <ci at libreoffice.org>
Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>
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: @""
More information about the Libreoffice-commits
mailing list