From 34623695aa1806b353ec149d0b0029679e6882b2 Mon Sep 17 00:00:00 2001 From: kugel Date: Wed, 2 Feb 2011 18:30:10 +0000 Subject: [PATCH] Redo r29168. Use similar but existing mechanism in the action system which seems to work better. Don't eat buttons on context change if it was waiting for button release (you did need another release). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29192 a1c6a512-1295-4272-9138-f99709370657 --- apps/action.c | 3 +++ apps/gui/bitmap/list.c | 18 +++--------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/apps/action.c b/apps/action.c index 003f11faa..ffb4195cc 100644 --- a/apps/action.c +++ b/apps/action.c @@ -192,6 +192,9 @@ static int get_action_worker(int context, int timeout, { if (button&BUTTON_REL) { + /* remember the button for the below button eating on context + * change */ + last_button = button; wait_for_release = false; } return ACTION_NONE; diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c index 3da0d0bb7..205004378 100644 --- a/apps/gui/bitmap/list.c +++ b/apps/gui/bitmap/list.c @@ -640,21 +640,9 @@ unsigned gui_synclist_do_touchscreen(struct gui_synclist * gui_list) && !is_kinetic_over()); int icon_width = 0; int line, list_width = list_text_vp->width; - static bool wait_for_release = false; released = (button&BUTTON_REL) != 0; - if (released && wait_for_release) - { /* was waiting on a release, reset everything so the next call - * can start from new */ - wait_for_release = false; - last_position = 0; - if (scroll_mode == SCROLL_KINETIC) - kinetic_force_stop(); - scroll_mode = SCROLL_NONE; - return ACTION_NONE; - } - if (button == ACTION_NONE || button == ACTION_UNKNOWN) { /* this happens when we hit edges of the list while kinetic scrolling, @@ -760,13 +748,13 @@ unsigned gui_synclist_do_touchscreen(struct gui_synclist * gui_list) return ACTION_NONE; } - if (button & BUTTON_REPEAT && scroll_mode == SCROLL_NONE - && !wait_for_release) + if (button & BUTTON_REPEAT && scroll_mode == SCROLL_NONE) { /* held a single line for a while, bring up the context menu */ gui_synclist_select_item(gui_list, list_start_item + line); /* don't sent context repeatedly */ - wait_for_release = true; + action_wait_for_release(); + last_position = 0; return ACTION_STD_CONTEXT; } if (released && !cancelled_kinetic) -- 2.11.4.GIT