diff --git a/src/MacVim/MMFullscreenWindow.m b/src/MacVim/MMFullscreenWindow.m index ca6ceeeb59..75d2c20350 100644 --- a/src/MacVim/MMFullscreenWindow.m +++ b/src/MacVim/MMFullscreenWindow.m @@ -116,12 +116,6 @@ { ASLogDebug(@"Enter full screen now"); - // HACK! Put window on all Spaces to avoid Spaces from moving the full - // screen window to a separate Space from the one the decorated window is - // occupying. The collection behavior is restored further down. - NSWindowCollectionBehavior wcb = [self collectionBehavior]; - [self setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces]; - // fade to black Boolean didBlend = NO; CGDisplayFadeReservationToken token; @@ -227,19 +221,30 @@ // move vim view to the window's center [self centerView]; +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) + // HACK! Put window on all Spaces to avoid Spaces (available on OS X 10.5 + // and later) from moving the full screen window to a separate Space from + // the one the decorated window is occupying. The collection behavior is + // restored further down. + NSWindowCollectionBehavior wcb = [self collectionBehavior]; + [self setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces]; +#endif + // make us visible and target invisible [target orderOut:self]; [self makeKeyAndOrderFront:self]; +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) + // Restore collection behavior (see hack above). + [self setCollectionBehavior:wcb]; +#endif + // fade back in if (didBlend) { CGDisplayFade(token, .25, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, .0, .0, .0, false); CGReleaseDisplayFadeReservation(token); } - - // Restore collection behavior (see hack at start of this method). - [self setCollectionBehavior:wcb]; } - (void)leaveFullscreen