mirror of https://github.com/libsdl-org/SDL.git
touch: Don't call ResetTouch() if SDL_GetTouch() can't find a virtual device.
Fixes #12577.
This commit is contained in:
parent
b00b08f832
commit
289f5cfdbb
|
|
@ -83,9 +83,11 @@ SDL_Touch *SDL_GetTouch(SDL_TouchID id)
|
||||||
{
|
{
|
||||||
int index = SDL_GetTouchIndex(id);
|
int index = SDL_GetTouchIndex(id);
|
||||||
if (index < 0 || index >= SDL_num_touch) {
|
if (index < 0 || index >= SDL_num_touch) {
|
||||||
if (SDL_GetVideoDevice()->ResetTouch != NULL) {
|
if ((id == SDL_MOUSE_TOUCHID) || (id == SDL_PEN_TOUCHID)) {
|
||||||
|
// this is a virtual touch device, but for some reason they aren't added to the system. Just ignore it.
|
||||||
|
} else if ( SDL_GetVideoDevice()->ResetTouch) {
|
||||||
SDL_SetError("Unknown touch id %d, resetting", (int)id);
|
SDL_SetError("Unknown touch id %d, resetting", (int)id);
|
||||||
(SDL_GetVideoDevice()->ResetTouch)(SDL_GetVideoDevice());
|
SDL_GetVideoDevice()->ResetTouch(SDL_GetVideoDevice());
|
||||||
} else {
|
} else {
|
||||||
SDL_SetError("Unknown touch device id %d, cannot reset", (int)id);
|
SDL_SetError("Unknown touch device id %d, cannot reset", (int)id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue