Kaydet (Commit) be1b03a4 authored tarafından Douglas Mencken's avatar Douglas Mencken Kaydeden (comit) Norbert Thiebaud

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/19677Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNorbert Thiebaud <nthiebaud@gmail.com>
üst 021a5e71
......@@ -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
......
......@@ -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: @""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment