Last active
June 24, 2026 14:32
-
-
Save VoodaGod/e4ac5363bd98b86cf7ab739101f852e5 to your computer and use it in GitHub Desktop.
gamescope mouse sensitivity <0 dead range fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/wlserver.cpp b/src/wlserver.cpp | |
| index 75fa37c6..20d64c8e 100644 | |
| --- a/src/wlserver.cpp | |
| +++ b/src/wlserver.cpp | |
| @@ -2753,6 +2753,16 @@ void wlserver_mousemotion( double dx, double dy, uint32_t time ) | |
| dx *= g_mouseSensitivity; | |
| dy *= g_mouseSensitivity; | |
| + | |
| + static double rem_x = 0.0; | |
| + static double rem_y = 0.0; | |
| + dx += rem_x; | |
| + dy += rem_y; | |
| + rem_x = fmod(dx, 1.0); | |
| + rem_y = fmod(dy, 1.0); | |
| + dx -= rem_x; | |
| + dy -= rem_y; | |
| + if (abs(dx) <= 0 && abs(dy) <= 0) return; | |
| wlserver_perform_rel_pointer_motion( dx, dy ); | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
adapted from ValveSoftware/gamescope#1521 (comment)