@bugaevc Do you know anything about the current landscape for implementing "tearable tabs" in Qt6, GTK4, and AppKit/Cocoa?

It's something I'd like to implement in Ladybird but I'm just not finding the right info in my google searches.

In essence, we have two+ windows in one process, and a tab view in each window. What's the magic sauce to tell the GUI to render either 1) a bounding box Or 2) a fancy shmancy preview attached to the mouse when drag n dropping a tab from one tab container to another?

@akaster ...oh I think I understand what you mean. You mean the user being able to "tear off" the tab and have *the whole tab content (the webview) move into its own window* while being dragged, like Chrome used to do. I don't know much about the client/toolkit side of this, but as far as Wayland protocols go you're going to need xdg-toplevel-drag, see this blog post https://blog.david-redondo.de/kde/wayland/qt/2023/08/08/xdg-toplevel-drag.html
The Qt pull request is here https://codereview.qt-project.org/c/qt/qtwayland/+/470673, see if you can make sense of it & figure out how to use it as an app/widget developer.

macOS, I don't know if there's a non-hacky way to do this (the hacky way would be creating a new NSWindow at just the right coordinates once you detect your tab is being torn off, and messing with events to keep the newly created window dragged), but I wouldn't advise you to do that either: let the system widgetry do its thing.

GTK/libadwaita, too, that's a feature that AdwTabView/AdwTabBar should implement (or not), not an individual app. You might want to talk to Alice M. about hooking up xdg-toplevel-drag to AdwTabBar.

Dragging Docks and Tugging Toolbars on Wayland

Most of our desktop applications have a toolbar, sometimes theyeven have multiple toolbars next to or stacked on top of each other.More complex desktop appli...

@bugaevc Right, creating a kind of window thing attached to the mouse when dragged. Here's how Safari does it on current macOS. So it's definitely possible. I do know that Safari likes to create all sorts of custom bespoke widgets and views that aren't publicly available and call all sorts of private APIs though, so "non-hacky' might be out of the question for mere mortals.

It looks like Chrome on macOS just instantly creates a new window when you drag a tab, and snap-merges it back in when you move the mouse over the tab-bar of another window while in a drag of a tab.

@bugaevc ehhh not sure what happened to that video but it's loading here https://youtu.be/ODVO1vd6V7c . Hopefully the screen recording actually captured the behavior I wanted.
Safari drag and drop

YouTube

@bugaevc It looks like Firefox on macOS just attaches a tiny picture of the current tab contents to your mouse, like a sneaky special cursor?

And then cleans up all the state at the time that the drag n drop is released. Seems a lot easier to implement than the other two browsers' behavior.

Safari seems to yoink the tab out of the window, then decide whether it gets its own window, or if it gets put into another window's tab bar when the drop ends.

Chrome seems to instantly give it a new window, and has a separate feature to merge tabs that are single-tab windows into other windows.