When I say window manager, I'm talking about KDE, Gnome, lxde, xfce, etc.
I never build a windowed application except with Qt, but my guess is that not all application use Qt, some use wx, but when ubuntu's repos has one application, it's released for all window managers.
How are those app made compatible with all window managers ? Is it up the app developer to link his app with all window managers, or is there a common ground for making windowed app with Xorg or other ? Does Qt or wx solve those problems ? I think I remember seeing some application which were released only for gnome or KDE, but I'm not sure.
I always wondered about this, and it made me wonder about the fragmentation of the linux applications realm...
There used to be the ICCCM standard, but now you should at least target EWMH and other freedesktop standards (including dbus).
Of course, recent toolkits like GTK3 or Qt5 should help, since they support a lot of them.
(and the details are complex, so starting from scratch is not realistic)