Just converted some tricky xorg code to run under gtk3
by hazel from LinuxQuestions.org on (#6JYXY)
Background: Some time ago I wrote a small package to provide some furniture for a minimalist desktop. At first it was just a buttonbar to launch my favorite applications, but then I added a trashcan and a disk mounting tool similar to the one that Damn Small Linux used to have. In fact the buttonbar is the only part of the suite that I use.
I wanted to make these tools run in the window manager's dock, so I asked around for advice on how to do it. A kind stranger sent me a little program he had written for a docked clock and I abstracted the necessary code from that. It used libX11 and gdk functions and I didn't understand a word of it, but it worked, which was all I cared about.
But when I tried to upgrade the package from gtk2 to gtk3, the compiler went on strike and spat out complaints about errors in the header files. Which was nonsense of course; Slackware doesn't contain faulty software. So I visually compared the gdk2 and gdk3 headers and found that gdk3 no longer includes one of the macros I was using. To replace that macro, I actually had to learn something about X.
I learned that an X display is not the same thing as a gdk display (who knew?), but that there are gdk functions for converting one into another, which is what the bad macro should have done. And now the docking code works again.
I wanted to make these tools run in the window manager's dock, so I asked around for advice on how to do it. A kind stranger sent me a little program he had written for a docked clock and I abstracted the necessary code from that. It used libX11 and gdk functions and I didn't understand a word of it, but it worked, which was all I cared about.
But when I tried to upgrade the package from gtk2 to gtk3, the compiler went on strike and spat out complaints about errors in the header files. Which was nonsense of course; Slackware doesn't contain faulty software. So I visually compared the gdk2 and gdk3 headers and found that gdk3 no longer includes one of the macros I was using. To replace that macro, I actually had to learn something about X.
I learned that an X display is not the same thing as a gdk display (who knew?), but that there are gdk functions for converting one into another, which is what the bad macro should have done. And now the docking code works again.