Skip to content

Commit 49134ec

Browse files
committed
Pass the error through from the SetRelativeMouseMode() implementation
1 parent 05887f2 commit 49134ec

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/events/SDL_mouse.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,10 +1369,11 @@ bool SDL_SetRelativeMouseMode(bool enabled)
13691369
}
13701370

13711371
// Set the relative mode
1372-
if (!mouse->SetRelativeMouseMode || !mouse->SetRelativeMouseMode(enabled)) {
1373-
if (enabled) {
1374-
return SDL_SetError("No relative mode implementation available");
1375-
}
1372+
if (!mouse->SetRelativeMouseMode) {
1373+
return SDL_Unsupported();
1374+
}
1375+
if (!mouse->SetRelativeMouseMode(enabled)) {
1376+
return false;
13761377
}
13771378
mouse->relative_mode = enabled;
13781379

0 commit comments

Comments
 (0)