SDL_SetRelativeMouseMode not working

I first use SDL_SetRelativeMouseMode(SDL_TRUE); then I get the positions with SDL_GetMouseState. All good but if I click inside my window the cursor escapes the window. Why is that?