mirror of https://github.com/encounter/SDL.git
Synthesize a missing touch-up event.
If a touch-down event is received for an existing touch-ID, that probably means the operating system lost it, and that the missing touch-up should be synthesized, to keep the client state coherent.
This commit is contained in:
parent
d2456b6e4c
commit
8f8b14cbb6
|
@ -302,8 +302,9 @@ SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window,
|
||||||
finger = SDL_GetFinger(touch, fingerid);
|
finger = SDL_GetFinger(touch, fingerid);
|
||||||
if (down) {
|
if (down) {
|
||||||
if (finger) {
|
if (finger) {
|
||||||
/* This finger is already down */
|
/* This finger is already down.
|
||||||
return 0;
|
Assume the finger-up for the previous touch was lost, and send it. */
|
||||||
|
SDL_SendTouch(id, fingerid, window, SDL_FALSE, x, y, pressure);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SDL_AddFinger(touch, fingerid, x, y, pressure) < 0) {
|
if (SDL_AddFinger(touch, fingerid, x, y, pressure) < 0) {
|
||||||
|
|
Loading…
Reference in New Issue