Touch Screen keeps failing with SDL_SetRelativeMouseMode(SDL_TRUE) #10115
Unanswered
c127dev
asked this question in
Bugs - Input
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Enviroment
OS: Arch Linux
Hyprland Version: v0.48.0-75-g8b7b16904
SDL Version: SDL2
Description:
Touch input Events (SDL_FINGERDOWN, SDL_FINGERUP, SDL_FINGERMOTION) stop being delivered to SDL2 applications after relative mouse mode has been enabled using SDL_SetRelativeMouseMode(SDL_TRUE) and subsequently disabled using SDL_SetRelativeMouseMode(SDL_FALSE). Once this sequence occurs, touch input remains non-functional for the application's, even after returning mouse mode until mouse moves again and workspace changes.
This issue was initially observed in the application Moonlight-qt (which uses SDL), but it is reliably reproducible with the minimal SDL test program attached below. This suggests the issue might stem from how the window manager handles the input state transition requested by SDL, specifically concerning touch devices when mouse grab/relative mode is activated and deactivated.
Test program: https://pastebin.com/zfZXbvaU
Steps to Reproduce:
1.- Compile and run the attached minimal SDL test program.
2.- Interact with the window using touch input.
Expected: Blue circles appear at touch points, and FINGER_DOWN/UP/MOTION events are logged on the window.
Actual: This works correctly initially.
3.- Press the 'G' key. This calls SDL_SetRelativeMouseMode(SDL_TRUE). The window background should turn dark red.
4.- Attempt touch input again.
Expected (Potentially): Touch input might be ignored or behave differently in relative mode, but this step confirms the immediate effect.
Actual: Touch input is no longer detected. No blue circles appear, and no touch events are logged.
Press the 'G' key again. This calls SDL_SetRelativeMouseMode(SDL_FALSE). The window background should return to black.
Attempt touch input once more.
Expected: Touch input functionality should be fully restored to the state in Step 2. Blue circles should appear, and events should be logged.
Actual: Touch input remains non-functional. No blue circles appear, and no touch events are logged. The application needs to be restarted for touch input to work again.
Beta Was this translation helpful? Give feedback.
All reactions