The flag called SDL_WINDOW_INPUT_GRABBED seems to prevent the problem from happening. StillBut still not sure if that is the, or a, correct solution.
SDL_CreateWindow( "SDL Tutorial",SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED, screenWidth, screenHeight,
SDL_WINDOW_FULLSCREEN | SDL_WINDOW_SHOWN | SDL_WINDOW_BORDERLESS | SDL_WINDOW_INPUT_GRABBED );