I am trying to write a program that tracks when the active window changes using Xlib. I am have trouble figuring out the best way to do this. These are my ideas so far:
Can't you just select PropertyChange on the root window to get sent PropertyNotify events when any property is updated and then check each event to see if it was for _NET_ACTIVE_WINDOW?