“Merge windows” and “Put tab in a separate window” menu items implementation

Under the “Window” menu of Cocoa apps, there are various items to deal with tabbing (the tab system built into mac OS).
Ideally, those should be available in “other” apps, like Xojo-made ones.

Many of them are already doable using plugins (and possibly declares), but “Merge windows” and “Put tab in a separate window” (captions guessed from my french OS) look hard to implement.

As an example, if you have two tabs in a single tab bar and you choose “Put tab in a separate window”, even if the OS can actually duplicate the window for us, how would Xojo be aware of this new window?
Would WindowCount automatically get the change?

It is not difficult to handle tabbed windows because the OS does everything. For your application, each window appears as a window no matter if it is displayed as a tab or as a standalone window.

If a window becomes a tabbed window, all your application will see is that that window will resize to fit.