In principle, this is how it works with X11. Not sure if it's required though.