summaryrefslogtreecommitdiff
path: root/apps/gui/gwps.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/gwps.c')
-rw-r--r--apps/gui/gwps.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c
index ae9dc453f5..c89a6fcbb4 100644
--- a/apps/gui/gwps.c
+++ b/apps/gui/gwps.c
@@ -295,15 +295,16 @@ void gwps_draw_statusbars(void)
295 viewportmanager_set_statusbar(wpsbars); 295 viewportmanager_set_statusbar(wpsbars);
296} 296}
297#ifdef HAVE_TOUCHSCREEN 297#ifdef HAVE_TOUCHSCREEN
298static int wps_get_touchaction(struct wps_data *data) 298int wps_get_touchaction(struct wps_data *data)
299{ 299{
300 short x,y; 300 short x,y;
301 short vx, vy; 301 short vx, vy;
302 int type = action_get_touchscreen_press(&x, &y); 302 int type = action_get_touchscreen_press(&x, &y);
303 int i; 303 int i;
304 static int last_action = ACTION_NONE;
304 struct touchregion *r; 305 struct touchregion *r;
305 if (type != BUTTON_REL) 306 bool repeated = (type == BUTTON_REPEAT);
306 return ACTION_TOUCHSCREEN; 307 bool released = (type == BUTTON_REL);
307 for (i=0; i<data->touchregion_count; i++) 308 for (i=0; i<data->touchregion_count; i++)
308 { 309 {
309 r = &data->touchregion[i]; 310 r = &data->touchregion[i];
@@ -320,9 +321,19 @@ static int wps_get_touchaction(struct wps_data *data)
320 /* now see if the point is inside this region */ 321 /* now see if the point is inside this region */
321 if (vx >= r->x && vx < r->x+r->width && 322 if (vx >= r->x && vx < r->x+r->width &&
322 vy >= r->y && vy < r->y+r->height) 323 vy >= r->y && vy < r->y+r->height)
323 return r->action; 324 {
325 if ((repeated && r->repeat) ||
326 (released && !r->repeat))
327 {
328 last_action = r->action;
329 return r->action;
330 }
331 }
324 } 332 }
325 } 333 }
334 if ((last_action == ACTION_WPS_SEEKBACK || last_action == ACTION_WPS_SEEKFWD))
335 return ACTION_WPS_STOPSEEK;
336 last_action = ACTION_TOUCHSCREEN;
326 return ACTION_TOUCHSCREEN; 337 return ACTION_TOUCHSCREEN;
327} 338}
328#endif 339#endif