Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix erroneous mouse motion when alt-tabbing in CS2 #11460

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

expikr
Copy link
Contributor

@expikr expikr commented Nov 13, 2024

closes #11422

@Slartibarty can you verify if this fix works for your game?

@expikr expikr changed the title fix errenous delta when warping fix errenous delta when warping in relative mode Nov 13, 2024
@expikr expikr changed the title fix errenous delta when warping in relative mode fix erroneous mouse motion when alt-tabbing in CS2 Nov 13, 2024
@expikr expikr marked this pull request as draft November 14, 2024 08:59
@expikr expikr force-pushed the relative-warp branch 2 times, most recently from d551025 to 8b12d09 Compare November 14, 2024 10:44
@expikr expikr marked this pull request as ready for review November 14, 2024 10:45
@expikr expikr force-pushed the relative-warp branch 5 times, most recently from 39ee4a1 to 8560cc7 Compare November 14, 2024 14:25
The following changes do not alter any logic:
- rename x/ydelta fields to x/y_accu to better reflect what it actually is about
- coalesce the logic for modifying internal state to one spot, branch based on whether the input was a move or a warp

The following changes alter the logic:
- put the x/y_accu addition under the relative branch only, warps should not add to the accumulation buffer by any definition
- (MAIN FIX) when the destination window desires relative mode, warp events should be dropped if SDL_MOUSE_RELATIVE_WARP_MOTION is false, or have x/yrel set to zero if true
src/events/SDL_mouse.c Outdated Show resolved Hide resolved
Co-authored-by: Sam Lantinga <[email protected]>
@Slartibarty
Copy link

closes #11422

@Slartibarty can you verify if this fix works for your game?

Yep, this fixes it in my game.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Erroneous relative mouse input injected when alt tabbing
3 participants