diff --git a/src/macosx/native/sun/awt/AWTWindow.m b/src/macosx/native/sun/awt/AWTWindow.m index f0d689b546ec05c17f4e3f91cc939cbcf21c3bae..2e2b854f35b7930ae7dc871baf51c4346a7ca453 100644 --- a/src/macosx/native/sun/awt/AWTWindow.m +++ b/src/macosx/native/sun/awt/AWTWindow.m @@ -178,8 +178,8 @@ AWT_NS_WINDOW_IMPLEMENTATION [self.nsWindow setDocumentEdited:IS(bits, DOCUMENT_MODIFIED)]; } - if ([self.nsWindow respondsToSelector:@selector(toggleFullScreen:)]) { - if (IS(mask, FULLSCREENABLE)) { + if (IS(mask, FULLSCREENABLE) && [self.nsWindow respondsToSelector:@selector(toggleFullScreen:)]) { + if (IS(bits, FULLSCREENABLE)) { [self.nsWindow setCollectionBehavior:(1 << 7) /*NSWindowCollectionBehaviorFullScreenPrimary*/]; } else { [self.nsWindow setCollectionBehavior:NSWindowCollectionBehaviorDefault];