View menu adding Show Tab Bar and Enter Full Screen

I added a View menu to my desktop app, but was surprised to see it automatically add Show Tab Bar and also Enter Full Screen. Is there a way of getting rid of these? They don’t really fit with my app.

Current workaround-y hack is to change the name of the menu to "View " which throws off the automatic system, but for some odd reason still displays the same.

My recommended course of action though, is to design your window so that stretching to full screen it still looks correct, and you can disable the tab bar in your app properly with a declare.

Tab bar declare: https://forum.xojo.com/conversation/post/293052

As Tim says, these are automatically added by the macOS as every developer wants automatic tabbing (which lumps different windows together) and every macOS user wants full screen right?

So you have to opt-out, as Tim says there’s the declare for disabling automatic tabbing, which I’d recommend you use until you decide that you want the OS to provide this for you (and which case there’s more work to be done, as Apple only give you a half baked solution automatically).

As for disabling Full Screen, you need another declare to manipulate the window to disable it’s ability to go Full Screen. I don’t have the declare handy on this machine, but I’ll try to remember to share it from my work machine.

I’ve started to offer my users the option of changing the behavior of the maximize window button (green dot) and I’m quite thrilled that a lot of people appreciate it. Seems like consumers like Full Screen, where as prosumers prefer the classic method.

I’d recommend that you also consider who your audience is and what would they expect?

Adding a space seems to be the best solution for now. Thanks.

Here the code to disable the Full Screen button on the window.

#if targetMacOS then // --- Revert the Maximize button in modern macOS version back to it's original state. Declare Function collectionBehavior Lib "Cocoa" Selector "collectionBehavior" ( obj As Integer ) As UInteger Declare Sub setCollectionBehavior Lib "Cocoa" Selector "setCollectionBehavior:" ( obj As Integer, value As UInteger ) setCollectionBehavior( me.handle, collectionBehavior( me.Handle ) Or 512 ) #endif

Sam, does that remove View > Enter Full Screen or does it only change the green dot behavior?

Ah… good point, mainly the later.

Full Screen Menu Item
AppKit automatically creates an “Enter Full Screen” menu item after the application finishes launching if an equivalent menu item isn’t found. If this menu item should not be created for your app, before NSApplicationDidFinishLaunchingNotification is sent you may set the NSFullScreenMenuItemEverywhere default to NO.

- (void)applicationWillFinishLaunching:(nonnull NSNotification *)notification { [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSFullScreenMenuItemEverywhere"]; }