Moved mouse capture handling into the server.

10 files changed