Shouldn't this be handled completely by the window manager?