SDL_SetRelativeMouseMode: I call this when the player enters gameplay. According to the docs, the hardware mouse should be hidden and relative movements should be reported. However, a lot of the time the hardware mouse is not hidden and can wander out of the game window and click on other things causing the game to lose focus.
Sometimes it seem to work fine. Using Win 10 and it happens on debug and release builds.