Viewport takes focus

Take focus on mouse events. Still not perfect, but better than before.