Please show me where I’ve gone amiss in MacCatalyst and UIScenes with regard to the macOS green zoom/fullscreen button.
-
Originally the MacCatalyst App used a secondary AppKit bundle for its NSWindow work, but at some point in time AppStore Connect complained about this secondary bundle which prevented new App uploads.
-
To continue receiving green button notifications I switched to UINSWindow. That worked.
-
Now that I’m forced to use UIScenes I’m in a pickle: a click on the green button forces an automatic jump to fullscreen, nothing I can do about it AFAIK.
-
A poor, poor compromise would be to disable the green button but I have no idea how even to do that.
-
I’d like my App to exist in two states, any suggestions?
Thanks.
Perhaps ending with that question was a mistake; obviously, I should use a new control. But I have used the zoom/no zoom feature since the birth of MacCat in 2019, ...
There are two UISceneWindowDelegate methods didUpdateCoordinateSpace and didUpdateEffectiveGeometry, and by inspection it's possible to infer which of the two states the App should configure itself. The problem is that these methods are both “did” variants, there are no “will” methods. My App should never be in fullscreen. (Note Xcode 26.4.1 is aware of willUpdateEffectiveGeometry, but it was never called - maybe in the future.)
The new zoom button control worked fine, by setting the scene’s size restriction minimumSize and maximumSize attributes appropriately. Positioning the new zoom control precisely over the green button didn’t work, the green guy intercepted events. Hovering over the green button posts a dialog showing all 15 possible action variations, none useful to me.
But, of course, I had long ago missed windowScene.sizeRestrictions.allowsFullScreen = NO. With fullscreen disabled the overlay-zoom-button-over-green-button kludge worked, and the zoom button rapidly became small, round and green.