Judging from window management on Linux (at least on Ubuntu using Gnome with Compiz), windows are organised in a stack. Switching to a window other than the one in focus will bring the former on top of the stack, right above the latter.
So is it theoretically possible to tell the WM to raise or lower windows in that stack and to raise them to topmost or lower them to bottommost?
If so, would Python XLib be able to do that? Is there any WM that already has this feature?