Avoid switching Spaces when leaving full screen

This fixes a bug where if the full screen window was moved to another
Space a Space switch would occur when leaving full screen.
This commit is contained in:
Bjorn Winckler
2011-01-08 19:12:29 +01:00
parent 8ca9999ea6
commit 6863b04a52
+15
View File
@@ -273,8 +273,23 @@
// button on the tabline steals the first responder status.
[target setInitialFirstResponder:[view textView]];
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
// HACK! Put decorated window on all Spaces (available on OS X 10.5 and
// later) so that the decorated window stays on the same Space as the full
// screen window (they may occupy different Spaces e.g. if the full screen
// window was dragged to another Space). The collection behavior is
// restored further down.
NSWindowCollectionBehavior wcb = [target collectionBehavior];
[target setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces];
#endif
[target makeKeyAndOrderFront:self];
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
// Restore collection behavior (see hack above).
[target setCollectionBehavior:wcb];
#endif
// ...but we don't want a focus gained message either, so don't set this
// sooner
[target setDelegate:delegate];