From 8b7a78a4caf7693db90d61e3530cd1ae3a497a3b Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Wed, 27 Jul 2011 13:59:58 +0200 Subject: [PATCH] Addendum to fix for open window in full-screen Don't switch window to full-screen after presenting it if for some reason the application is no longer in full-screen. Seems to happen sometimes when starting MacVim from a full-screen Terminal window. --- src/MacVim/MMWindowController.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/MacVim/MMWindowController.m b/src/MacVim/MMWindowController.m index 832cf5ff68..3811764d0e 100644 --- a/src/MacVim/MMWindowController.m +++ b/src/MacVim/MMWindowController.m @@ -341,10 +341,14 @@ #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) // HACK! See comment above. if (inFullScreen) { - // NOTE: If we get here the following API must be supported. + // NOTE: If we get here the following APIs must be supported. [decoratedWindow setCollectionBehavior: NSWindowCollectionBehaviorFullScreenPrimary]; - if (!delayEnterFullscreen) { + // Double-check if we're still in full-screen before turning the window + // itself into a full-screen window. + BOOL stillInFullScreen = ([NSApp currentSystemPresentationOptions] & + NSApplicationPresentationFullScreen) != 0; + if (stillInFullScreen && !delayEnterFullscreen) { // Set alpha to zero so that the decorated window doesn't pop up // before we enter full-screen. [decoratedWindow setAlphaValue:0];