diff --git a/src/MacVim/MMFullscreenWindow.m b/src/MacVim/MMFullscreenWindow.m index 3b1f10271b..a0e9891a30 100644 --- a/src/MacVim/MMFullscreenWindow.m +++ b/src/MacVim/MMFullscreenWindow.m @@ -148,9 +148,14 @@ // NOTE: Calling setTitle:nil causes an exception to be raised (and it is // possible that 'target' has no title when we get here). - if ([target title]) + if ([target title]) { [self setTitle:[target title]]; + // NOTE: Cocoa does not add borderless windows to the "Window" menu so + // we have to do it manually. + [NSApp changeWindowsItem:self title:[target title] filename:NO]; + } + [self setOpaque:[target isOpaque]]; // don't set this sooner, so we don't get an additional diff --git a/src/MacVim/MMWindowController.m b/src/MacVim/MMWindowController.m index f367145551..29dd92b144 100644 --- a/src/MacVim/MMWindowController.m +++ b/src/MacVim/MMWindowController.m @@ -360,8 +360,17 @@ - (void)setTitle:(NSString *)title { - if (title) - [decoratedWindow setTitle:title]; + if (!title) + return; + + [decoratedWindow setTitle:title]; + if (fullscreenEnabled) { + [fullscreenWindow setTitle:title]; + + // NOTE: Cocoa does not update the "Window" menu for borderless windows + // so we have to do it manually. + [NSApp changeWindowsItem:fullscreenWindow title:title filename:NO]; + } } - (void)setDocumentFilename:(NSString *)filename