20 Jul 2006 company   » (Master)

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:

  1. 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?
  2. 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?
  3. Detaching tabs only works if you drag them to the desktop. Don't ever try this with a fullscreen app.
  4. 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.
  5. There is absolutely no visual feedback (aka highlighting) when doing a drag.
  6. 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.
  7. 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?

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!