Today I made some significant progress on the X11 plugin for Alities. This plugin allows Alities to detect when windows are moved around on the screen. I was really worried about the feasibility of accomplishing this task, because as Alities may run from within existing widget sets (ie, KDE/QT, Gnome/GTK, etc), I thought it would be more complicated.

The solution was to create a separate connection to the X server, register which events we are interested in (window manipulation), and then launch a separate thread to listen to those events in an infinite loop. Rather than gathering all the information about each event (which might be time-consuming), the plugin simply flags that an event occurred. When the main Alities thread requests the pending events, they get generated dynamically. This way, multiple window events can be consolidated, resulting in shorter event queues.

I consider this to be the last of several technical hurdles which I did not look forward to. Now, the rest of the code is basically just an exercise in patience :)

Related posts