summaryrefslogtreecommitdiff
path: root/src/ui/touch.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-06-13 15:28:58 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-06-13 15:28:58 +0300
commiteb04ac7a1921b7c7f534a7a63cffc4c7a35c0900 (patch)
treea84fd4b4630f7469caa6e6a5df50fb13e12f8437 /src/ui/touch.c
parent4a29ccb82910503fe1c44fbf493caf0945714705 (diff)
Mobile: Working on swipe navigation
Swipes back and forward are now working, although there are some glitches remaining. Most notably, when swiping back the previous document does not appear until the finger is released.
Diffstat (limited to 'src/ui/touch.c')
-rw-r--r--src/ui/touch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ui/touch.c b/src/ui/touch.c
index 236601e8..36bac267 100644
--- a/src/ui/touch.c
+++ b/src/ui/touch.c
@@ -273,8 +273,9 @@ static void update_TouchState_(void *ptr) {
273// touch->edge == right_TouchEdge && swipeDir < 0 ? SDL_BUTTON_X2 : 0); 273// touch->edge == right_TouchEdge && swipeDir < 0 ? SDL_BUTTON_X2 : 0);
274// setHover_Widget(NULL); 274// setHover_Widget(NULL);
275 postCommandf_App("edgeswipe.ended abort:1 side:%d id:%llu", touch->edge, touch->id); 275 postCommandf_App("edgeswipe.ended abort:1 side:%d id:%llu", touch->edge, touch->id);
276 touch->edge = none_TouchEdge; 276 touch->edge = none_TouchEdge;
277 remove_ArrayIterator(&i); 277 /* May be a regular drag along the edge so don't remove. */
278 //remove_ArrayIterator(&i);
278 } 279 }
279 continue; 280 continue;
280 } 281 }
@@ -516,6 +517,7 @@ iBool processEvent_Touch(const SDL_Event *ev) {
516 else if (ev->type == SDL_FINGERMOTION) { 517 else if (ev->type == SDL_FINGERMOTION) {
517 iTouch *touch = find_TouchState_(d, fing->fingerId); 518 iTouch *touch = find_TouchState_(d, fing->fingerId);
518 if (touch && touch->edge) { 519 if (touch && touch->edge) {
520 clear_Array(d->moms);
519 pushPos_Touch_(touch, pos, nowTime); 521 pushPos_Touch_(touch, pos, nowTime);
520 postCommandf_App("edgeswipe.moved arg:%d side:%d id:%llu", 522 postCommandf_App("edgeswipe.moved arg:%d side:%d id:%llu",
521 (int) (x_F3(pos) - x_F3(touch->startPos)), 523 (int) (x_F3(pos) - x_F3(touch->startPos)),