Or I could just use X11, where this is a solved problem using a single API that works on arbitrary window managers / desktop environments. The only problem is people keep showing up to tell me that I need to stop using it and use their feature-poor alternative.