Fixed bug 1663 - SDL_EventState(SDL_DOLLARGESTURE,SDL_IGNORE) etc. has no effect
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
diff --git a/src/events/SDL_gesture.c b/src/events/SDL_gesture.c
index 0f5fc81..fd3a709 100644
--- a/src/events/SDL_gesture.c
+++ b/src/events/SDL_gesture.c
@@ -500,43 +500,48 @@ static SDL_GestureTouch * SDL_GetGestureTouch(SDL_TouchID id)
return NULL;
}
-static int SDL_SendGestureMulti(SDL_GestureTouch* touch,float dTheta,float dDist)
+static void SDL_SendGestureMulti(SDL_GestureTouch* touch,float dTheta,float dDist)
{
- SDL_Event event;
- event.mgesture.type = SDL_MULTIGESTURE;
- event.mgesture.touchId = touch->id;
- event.mgesture.x = touch->centroid.x;
- event.mgesture.y = touch->centroid.y;
- event.mgesture.dTheta = dTheta;
- event.mgesture.dDist = dDist;
- event.mgesture.numFingers = touch->numDownFingers;
- return SDL_PushEvent(&event) > 0;
+ if (SDL_GetEventState(SDL_MULTIGESTURE) == SDL_ENABLE) {
+ SDL_Event event;
+ event.mgesture.type = SDL_MULTIGESTURE;
+ event.mgesture.touchId = touch->id;
+ event.mgesture.x = touch->centroid.x;
+ event.mgesture.y = touch->centroid.y;
+ event.mgesture.dTheta = dTheta;
+ event.mgesture.dDist = dDist;
+ event.mgesture.numFingers = touch->numDownFingers;
+ SDL_PushEvent(&event);
+ }
}
#if defined(ENABLE_DOLLAR)
-static int SDL_SendGestureDollar(SDL_GestureTouch* touch,
+static void SDL_SendGestureDollar(SDL_GestureTouch* touch,
SDL_GestureID gestureId,float error)
{
- SDL_Event event;
- event.dgesture.type = SDL_DOLLARGESTURE;
- event.dgesture.touchId = touch->id;
- event.dgesture.x = touch->centroid.x;
- event.dgesture.y = touch->centroid.y;
- event.dgesture.gestureId = gestureId;
- event.dgesture.error = error;
- /* A finger came up to trigger this event. */
- event.dgesture.numFingers = touch->numDownFingers + 1;
- return SDL_PushEvent(&event) > 0;
+ if (SDL_GetEventState(SDL_DOLLARGESTURE) == SDL_ENABLE) {
+ SDL_Event event;
+ event.dgesture.type = SDL_DOLLARGESTURE;
+ event.dgesture.touchId = touch->id;
+ event.dgesture.x = touch->centroid.x;
+ event.dgesture.y = touch->centroid.y;
+ event.dgesture.gestureId = gestureId;
+ event.dgesture.error = error;
+ /* A finger came up to trigger this event. */
+ event.dgesture.numFingers = touch->numDownFingers + 1;
+ SDL_PushEvent(&event);
+ }
}
-
-static int SDL_SendDollarRecord(SDL_GestureTouch* touch,SDL_GestureID gestureId)
+static void SDL_SendDollarRecord(SDL_GestureTouch* touch,SDL_GestureID gestureId)
{
- SDL_Event event;
- event.dgesture.type = SDL_DOLLARRECORD;
- event.dgesture.touchId = touch->id;
- event.dgesture.gestureId = gestureId;
- return SDL_PushEvent(&event) > 0;
+ if (SDL_GetEventState(SDL_DOLLARRECORD) == SDL_ENABLE) {
+ SDL_Event event;
+ event.dgesture.type = SDL_DOLLARRECORD;
+ event.dgesture.touchId = touch->id;
+ event.dgesture.gestureId = gestureId;
+ SDL_PushEvent(&event);
+ }
}
#endif