Tabbed document windows

I recently got a new iMac and it came preloaded with High Sierra. I was on Sierra.
High Sierra seems a lot more aggressive about the type of window it is going to merge into a tabbed display; seems any window that is resizable is a candidate, even windows (within the same app obviously) that have nothing to do with each other are being merged. In one case I have two windows that can have their height adjusted but not width. High Sierra merges them but because the width is fixed the feature doesn’t work properly, there is no close X icon on the tab and you can’t drag the window out. This is a pain in itself but when it starts merging windows from different parts of the app it gets really confusing.
Generally I like the facility, in the right context it is great but is there any way of controlling it better, either within macOS of Xojo (ie a hidden flag that says don’t open in tabs)
Any reply would be appreciated.


Create a method with the name “App_AllowsAutomaticWindowTabbing” with parameter “pbAllowTabGrouping As Boolean”.
Add the code below to the method:

[code]#if TargetMacOS and TargetCocoa then
Soft Declare Function objc_getClass lib “libobjc.dylib” (name As CString) As Ptr
Soft Declare Function sel_registerName lib “libobjc.dylib” (name As CString) As Ptr
Soft Declare Function RespondsToSelector Lib “Cocoa” selector “respondsToSelector:” (target As Ptr, Sel As Ptr) As Boolean

Dim nsWindowClass As Ptr = objc_getClass(“NSWindow”)
if RespondsToSelector(nsWindowClass, sel_registerName(“setAllowsAutomaticWindowTabbing:”)) then
Soft Declare Sub AllowTabGrouping lib “AppKit” selector “setAllowsAutomaticWindowTabbing:” (classPtr As Ptr, enableDisable As Boolean)
AllowTabGrouping(nsWindowClass, pbAllowTabGrouping)
end if

Call the method above in the open event of the main window of the application like this to block automatic tabbing:


Note: I did not invent this code. I found this example somewhere in a forum or feedback post but I can not remember where.

Don’t recall that behaviour at all on High Sierra. In any case it should be something that can be switched off in your system preferences (can’t check as I moved back to Sierra)

By default it’s on, but sure it can be turned off system wise.

IMHO I would seriously think about how you want your application to operate, I personally have applied similar code to the above to all my applications as I don’t want the system tabbing. In the one app that does use tabbing, I’ve built my own solution anyway.

Either create a test account with the default settings (or just tabbing enabled) or set-up another machine to test on. I still do all of my development on 10.11.6 as that’s been the most stable for me so far (still requires restarting periodically).

Now if you do want the system tabbing, there is more work to be done as the solution Apple give you is about as fully baked as High Sierra (not even half baked). I’ve included the code in issue 14.5.

Thanks the replies.
I know I can turn the feature off in the system preferences but as I said, generally I like it. It’s one or two apps I’ve written that have multiple windows and when they start merging completely different legs its very confusing. The solution to turn it off at the application level is exactly what I was looking for.

I have looked at other apps I’ve written but never compiled under High Sierra (or the latest incarnation of Xojo) and they exhibit the same problem. May have to look at them at some point - or completely redesign the interface.


Tabbing in general has been around for a few OSX versions now.
Im keeping clear of High Sierra for now - wish my customers would!
The biggest problem I found even when tabbing document windows, is that Xojo doesnt get (or maybe doesnt pass on) a ‘resize’ event when an existing window is shovelled into a tab
And since the tab area is smaller than the existing window was, status bar style controls along the bottom of the window suddenly aren’t visible any more.
They become visible if you resize the entire tabbed app, but I havent found a way to make that happen automatically.
So I too turn off the tabbed behaviour for my app.

Apple: please stop trying to turn my macbook into an iPad, or I WILL buy a Surface.