How do I lock the mouse to the viewport?

I’m having problem too. Anyone found a fix?