server: Make the foreground thread input per-desktop instead of global.