summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine/skin_tokens.c
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-08-30 01:23:39 +0100
committerAidan MacDonald <amachronic@protonmail.com>2021-11-21 20:26:20 +0000
commitbff63a4f909770d86b12217e9003a22c54789c7b (patch)
treece426feda1037c6dc3246fea9ad39230b3d73d50 /apps/gui/skin_engine/skin_tokens.c
parent7e428ad190dd8d928fbb1451a7bb81dd4e856258 (diff)
downloadrockbox-bff63a4f909770d86b12217e9003a22c54789c7b.tar.gz
rockbox-bff63a4f909770d86b12217e9003a22c54789c7b.zip
touchscreen: change odd sentinel value for time of last touch
Using tick 0xffff does not make any sense, use -1 instead. Change-Id: Id574eb35418c6713c4fc91ed539aadc42fd29aa5
Diffstat (limited to 'apps/gui/skin_engine/skin_tokens.c')
-rw-r--r--apps/gui/skin_engine/skin_tokens.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index a4c9af7539..27022b87d1 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -1367,7 +1367,7 @@ const char *get_token_value(struct gui_wps *gwps,
1367 case SKIN_TOKEN_LASTTOUCH: 1367 case SKIN_TOKEN_LASTTOUCH:
1368 { 1368 {
1369#ifdef HAVE_TOUCHSCREEN 1369#ifdef HAVE_TOUCHSCREEN
1370 unsigned int last_touch = touchscreen_last_touch(); 1370 long last_touch = touchscreen_last_touch();
1371 char *skin_base = get_skin_buffer(data); 1371 char *skin_base = get_skin_buffer(data);
1372 struct touchregion_lastpress *data = SKINOFFSETTOPTR(skin_base, token->value.data); 1372 struct touchregion_lastpress *data = SKINOFFSETTOPTR(skin_base, token->value.data);
1373 if (!data) return NULL; 1373 if (!data) return NULL;
@@ -1375,7 +1375,7 @@ const char *get_token_value(struct gui_wps *gwps,
1375 if (region) 1375 if (region)
1376 last_touch = region->last_press; 1376 last_touch = region->last_press;
1377 1377
1378 if (last_touch != 0xffff && 1378 if (last_touch != -1 &&
1379 TIME_BEFORE(current_tick, data->timeout + last_touch)) 1379 TIME_BEFORE(current_tick, data->timeout + last_touch))
1380 return "t"; 1380 return "t";
1381#endif 1381#endif