Who let this crap into Gtk? I’m really annoyed that such code ended up there, because that code not only works bad, but also is conceptual crap. I’m talking about the dnd code. So what’s wrong with it? I’ll start with the worst things:
- You have to provide a function that creates a new window if the tab is dragged off the notebook. So what’s wrong with gtk_notebook_set_window_creation_hook? It’s global. Every self-respecting programmer should know by now that globals are bad, mkay? Especially so in libraries. Anyone remember XSetErrorHandler? So just assume for a moment, that you were using a docking library (like the Gimp or Gdl) that wants to support floating docks and you want to make some of your own notebooks detachable. Who sets the hook?
- To figure out if dragging from one notebook to another is allowed, one has to set a group id. And this is a (positive) integer. Hi namespace collision. By now I’d thought that it was common knowledge to use strings or pointers for such a thing. But apparently it’s not. So what ID is the docking library using now? Just pick one and hope?
- Detaching tabs only works if you drag them to the desktop. Don’t ever try this with a fullscreen app.
- Reordering is implemented without drag’n’drop to give nice visual feedback. Unfortunately detaching is implemented with drag’n’drop. So once you’ve gone over the threshold to start a drag, the UI looks completely different. Even if you later on move the mouse over the notebook again, it doesn’t change back.
- There is absolutely no visual feedback (aka highlighting) when doing a drag.
- The code for reordering (or dragging) tabs in a small notebook (where the arrows are visible and preferrably only one notebook is visual at any time) does not work in any reliable way.
- There are lots of different annoying drawing glitches from flickering to drawing tabs in weird places during reordering and dragging.
These are lots of reasons that would have gotten me patches rejected almost everywhere in the gnome stack. So why did the normally excellent Gtk quality control fail to work in the notebook case?