Avoid switching Spaces when entering full screen

This fixes a bug where MacVim would switch Space when entering full
screen (which only occurred when MacVim was assigned to a specific
Space in the System Preferences).
This commit is contained in:
Bjorn Winckler
2010-12-30 21:23:13 +01:00
parent 1cb9a4ffb9
commit 3bcd07d562
+9
View File
@@ -116,6 +116,12 @@
{
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;
@@ -231,6 +237,9 @@
kCGDisplayBlendNormal, .0, .0, .0, false);
CGReleaseDisplayFadeReservation(token);
}
// Restore collection behavior (see hack at start of this method).
[self setCollectionBehavior:wcb];
}
- (void)leaveFullscreen