diff --git a/docs/changes.txt b/docs/changes.txt index f3c9b416d1..4884631dcf 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -175,6 +175,7 @@ wxOSX: - supporting native image formst like NSImage and UIImage in wxBitmap - native implementation for wxStaticBitmap for correct rendering of template images - Fill column value in wxEVT_DATAVIEW_ITEM_ACTIVATED events (Igor Korot). +- Make wxFrame::EnableFullScreenView() work under macOS 10.11+ (Andy Robinson). wxQt: diff --git a/src/osx/cocoa/nonownedwnd.mm b/src/osx/cocoa/nonownedwnd.mm index a1084ccc15..61ea6270a0 100644 --- a/src/osx/cocoa/nonownedwnd.mm +++ b/src/osx/cocoa/nonownedwnd.mm @@ -1092,10 +1092,18 @@ bool wxNonOwnedWindowCocoaImpl::EnableFullScreenView(bool enable) if (enable) { collectionBehavior |= NSWindowCollectionBehaviorFullScreenPrimary; + collectionBehavior &= ~NSWindowCollectionBehaviorFullScreenAuxiliary; } else { + // Note that just turning "Full Screen Primary" is not enough, the + // window would still be made full screen when the green button in the + // title bar is pressed, and we need to explicitly turn on the "Full + // Screen Auxiliary" style to prevent this from happening. This works, + // at least under 10.11 and 10.14, even though it's not really clear + // from the documentation that it should. collectionBehavior &= ~NSWindowCollectionBehaviorFullScreenPrimary; + collectionBehavior |= NSWindowCollectionBehaviorFullScreenAuxiliary; } [m_macWindow setCollectionBehavior: collectionBehavior];