summaryrefslogtreecommitdiff
path: root/src/ui/touch.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-09-12 21:00:44 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-09-12 21:00:44 +0300
commit0e7060d5306fef1f585982cc78223250d3ee8551 (patch)
treed21bb496f85cd275707db85ebac17e7e5f2a9adf /src/ui/touch.c
parent12262e7642489f1764018ef23b4913c203ddd9ab (diff)
Mobile: Better Settings tap targets; fixed safe area drawing
Diffstat (limited to 'src/ui/touch.c')
-rw-r--r--src/ui/touch.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ui/touch.c b/src/ui/touch.c
index f0456acb..5fc8f245 100644
--- a/src/ui/touch.c
+++ b/src/ui/touch.c
@@ -254,6 +254,8 @@ static iFloat3 gestureVector_Touch_(const iTouch *d) {
254} 254}
255 255
256static void update_TouchState_(void *ptr) { 256static void update_TouchState_(void *ptr) {
257 iWindow *win = get_Window();
258 const iWidget *oldHover = win->hover;
257 iTouchState *d = ptr; 259 iTouchState *d = ptr;
258 /* Check for long presses to simulate right clicks. */ 260 /* Check for long presses to simulate right clicks. */
259 const uint32_t nowTime = SDL_GetTicks(); 261 const uint32_t nowTime = SDL_GetTicks();
@@ -293,6 +295,7 @@ static void update_TouchState_(void *ptr) {
293 /* Looks like a possible tap. */ 295 /* Looks like a possible tap. */
294 dispatchNotification_Touch_(touch, widgetTapBegins_UserEventCode); 296 dispatchNotification_Touch_(touch, widgetTapBegins_UserEventCode);
295 dispatchMotion_Touch_(touch->pos[0], 0); 297 dispatchMotion_Touch_(touch->pos[0], 0);
298 refresh_Widget(touch->affinity);
296 touch->isTapBegun = iTrue; 299 touch->isTapBegun = iTrue;
297 } 300 }
298 if (!touch->isTapAndHold && nowTime - touch->startTime >= longPressSpanMs_ && 301 if (!touch->isTapAndHold && nowTime - touch->startTime >= longPressSpanMs_ &&
@@ -363,6 +366,10 @@ static void update_TouchState_(void *ptr) {
363 if (!isEmpty_Array(d->touches) || !isEmpty_Array(d->moms)) { 366 if (!isEmpty_Array(d->touches) || !isEmpty_Array(d->moms)) {
364 addTickerRoot_App(update_TouchState_, NULL, ptr); 367 addTickerRoot_App(update_TouchState_, NULL, ptr);
365 } 368 }
369 if (oldHover != win->hover) {
370 refresh_Widget(oldHover);
371 refresh_Widget(win->hover);
372 }
366} 373}
367 374
368#if 0 375#if 0