https://github.com/libsdl-org/SDL/commit/551510c0eb28709e6b87a0cc387a652d21776f39
From 551510c0eb28709e6b87a0cc387a652d21776f39 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 12 Jan 2025 08:02:19 -0800
Subject: [PATCH] SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE can be combined with
SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE
---
include/SDL3/SDL_hints.h | 3 +--
src/events/SDL_mouse.c | 7 +++----
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h
index 263e0a1a23fab..7905cb47de952 100644
--- a/include/SDL3/SDL_hints.h
+++ b/include/SDL3/SDL_hints.h
@@ -2534,8 +2534,7 @@ extern "C" {
* - "1": Relative mouse motion will be scaled using the system mouse
* acceleration curve.
*
- * If SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE is set, that will override the
- * system speed scale.
+ * If SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE is set, that will apply before the system speed scale.
*
* This hint can be set anytime.
*
diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c
index 9727bdba92359..2ade6b800f7cd 100644
--- a/src/events/SDL_mouse.c
+++ b/src/events/SDL_mouse.c
@@ -672,10 +672,9 @@ static void SDL_PrivateSendMouseMotion(Uint64 timestamp, SDL_Window *window, SDL
if (mouse->enable_relative_speed_scale) {
x *= mouse->relative_speed_scale;
y *= mouse->relative_speed_scale;
- } else if (mouse->enable_relative_system_scale) {
- if (mouse->ApplySystemScale) {
- mouse->ApplySystemScale(mouse->system_scale_data, timestamp, window, mouseID, &x, &y);
- }
+ }
+ if (mouse->enable_relative_system_scale && mouse->ApplySystemScale) {
+ mouse->ApplySystemScale(mouse->system_scale_data, timestamp, window, mouseID, &x, &y);
}
} else {
if (mouse->enable_normal_speed_scale) {