diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index 5e33cd5b1..236b8c540 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -538,7 +538,10 @@ SDL_SetRelativeMouseMode(SDL_bool enabled) } else if (enabled && ShouldUseRelativeModeWarp(mouse)) { mouse->relative_mode_warp = SDL_TRUE; } else if (mouse->SetRelativeMouseMode(enabled) < 0) { - return -1; + if (enabled) { + // Fall back to warp mode if native relative mode failed + mouse->relative_mode_warp = SDL_TRUE; + } } mouse->relative_mode = enabled; diff --git a/src/video/windows/SDL_windowsmouse.c b/src/video/windows/SDL_windowsmouse.c index 183e71c7e..b49249db6 100644 --- a/src/video/windows/SDL_windowsmouse.c +++ b/src/video/windows/SDL_windowsmouse.c @@ -210,8 +210,8 @@ WIN_SetRelativeMouseMode(SDL_bool enabled) /* (Un)register raw input for mice */ if (RegisterRawInputDevices(&rawMouse, 1, sizeof(RAWINPUTDEVICE)) == FALSE) { - /* Only return an error when registering. If we unregister and fail, then - it's probably that we unregistered twice. That's OK. */ + /* Only return an error when registering. If we unregister and fail, + then it's probably that we unregistered twice. That's OK. */ if (enabled) { return SDL_Unsupported(); }