Skip to content

Commit 3941d79

Browse files
committed
Mark pinned child windows as fullscreen-auxiliary
Adding a child window without NSWindowCollectionBehaviorFullScreenAuxiliary to a fullscreen parent forces AppKit to demote the parent out of fullscreen so the two can coexist on the regular desktop. Result: opening Preferences from fullscreen kicked the emulator out of fullscreen rather than overlaying Preferences on the fullscreen Space. OR the auxiliary flag into the child's collection behavior in pinAsChildOf:. The bit is harmless when the parent is windowed and gives every utility window the right Space-sharing semantics for free, since they all reach the fullscreen state through this single choke point.
1 parent 15e0965 commit 3941d79

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

fusepb/views/DisplayOpenGLView.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,6 +1433,13 @@ @implementation NSWindow (FuseChildPinning)
14331433
- (void)pinAsChildOf:(NSWindow *)parent
14341434
{
14351435
if( !parent || parent == self ) return;
1436+
/* Without FullScreenAuxiliary, adding self as a child of a fullscreen
1437+
parent forces AppKit to exit fullscreen so the two can coexist on
1438+
the regular desktop. With it, both windows share the parent's
1439+
fullscreen Space. Harmless when the parent is windowed. */
1440+
[self setCollectionBehavior:
1441+
[self collectionBehavior] |
1442+
NSWindowCollectionBehaviorFullScreenAuxiliary];
14361443
NSWindow *currentParent = [self parentWindow];
14371444
if( currentParent == parent ) return;
14381445
if( currentParent ) {

0 commit comments

Comments
 (0)