Cocoa "Auto-window tab" default behavior wrong for JUCE

windows

#1

Are you folks aware of the (relatively) new Cocoa “Auto-window tab” feature? Apparently, it is not Opt-in, but Opt-out (e.g. it is enabled by default) and if the user has the appropriate setting turned on in the Dock Prefs Panel, the OS will automatically stuff all your native JUCE windows into one window with tabs (I found this out because a user ran into it).

Apparently the solution to disable this is:

if([window respondsToSelector:@selector(setTabbingMode:)]) {
    // this particular window doesn't support tabbing in Sierra.
    [window setTabbingMode:NSWindowTabbingModeDisallowed];
}

I guess that ideally it would be good to have some native support for native tabs (e.g. for multiple document windows) - by either adding some support to JUCE or mapping something in juce to the native tabbing API (documented at):

https://developer.apple.com/documentation/appkit/nswindowtab

but at the very least, I think JUCE should automatically opt its windows out of the native tabbing as this leads to UI problems when the UI wasn’t designed to deal with it; probably just insert that code snippet in the NSJuceWindow creation code in the Peer…


#2

Interesting. I hadn’t noticed this before but running the windows demo in the JUCE demo exhibits this behaviour for the native DocumentWindow. I’ll take a look at this


#3

OK I’ve disabled the auto-tabbing behaviour for now. It would be nice to add support for this to JUCE at some point but the current documentation for the NSWindowTab class is pretty sparse…


#4

Yeah – I agree. Seems like the tab group stuff allows you to define what windows should get combined, but it is definitely not particularly clear, and I haven’t found any sample code about it either. I think that IB created windows probably do require an Opt-In, so this behaviour has something to do with the way that the windows are created programmatically. Thanks for taking a look at it…