touchscreen: Fix kinetic scrolling when the statusbar is off.
The scrolling code cannot differentiate between the BUTTON_TOUCHSCREEN post from normal touches and the one posted in the timeout callback. To fix introduce a global special button (BUTTON_REDRAW) that results in the desired redraw. This existed already as a local kludge for android and is now generalized. Change-Id: I6bfa6c66431c48f5042fcd8fce2ea72cd3457f58
This commit is contained in:
parent
f458888a4c
commit
bb0e4cc543
6 changed files with 13 additions and 12 deletions
|
@ -233,6 +233,10 @@ static int get_action_worker(int context, int timeout,
|
||||||
* multimedia button presses don't go through the action system */
|
* multimedia button presses don't go through the action system */
|
||||||
if (button == BUTTON_NONE || button & (SYS_EVENT|BUTTON_MULTIMEDIA))
|
if (button == BUTTON_NONE || button & (SYS_EVENT|BUTTON_MULTIMEDIA))
|
||||||
return button;
|
return button;
|
||||||
|
/* the special redraw button should result in a screen refresh */
|
||||||
|
if (button == BUTTON_REDRAW)
|
||||||
|
return ACTION_REDRAW;
|
||||||
|
|
||||||
/* Don't send any buttons through untill we see the release event */
|
/* Don't send any buttons through untill we see the release event */
|
||||||
if (wait_for_release)
|
if (wait_for_release)
|
||||||
{
|
{
|
||||||
|
|
|
@ -587,7 +587,7 @@ static int kinetic_callback(struct timeout *tmo)
|
||||||
data->velocity = 0;
|
data->velocity = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
queue_post(&button_queue, BUTTON_TOUCHSCREEN, 0);
|
queue_post(&button_queue, BUTTON_REDRAW, 0);
|
||||||
/* stop if the velocity hit or crossed zero */
|
/* stop if the velocity hit or crossed zero */
|
||||||
if (!data->velocity)
|
if (!data->velocity)
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,9 +50,6 @@ static const struct button_mapping button_context_standard[] = {
|
||||||
{ ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
|
{ ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
|
||||||
{ ACTION_STD_CONTEXT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
|
{ ACTION_STD_CONTEXT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
|
||||||
|
|
||||||
/* special hack to get a redraw on activity resume, see lcd-android.c */
|
|
||||||
{ ACTION_REDRAW, BUTTON_FORCE_REDRAW, BUTTON_NONE },
|
|
||||||
|
|
||||||
LAST_ITEM_IN_LIST
|
LAST_ITEM_IN_LIST
|
||||||
}; /* button_context_standard */
|
}; /* button_context_standard */
|
||||||
|
|
||||||
|
|
|
@ -81,13 +81,15 @@ void wheel_send_events(bool send);
|
||||||
int button_apply_acceleration(const unsigned int data);
|
int button_apply_acceleration(const unsigned int data);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BUTTON_NONE 0x00000000
|
#define BUTTON_NONE 0x00000000
|
||||||
|
|
||||||
/* Button modifiers */
|
/* Button modifiers */
|
||||||
#define BUTTON_REL 0x02000000
|
#define BUTTON_REL 0x02000000
|
||||||
#define BUTTON_REPEAT 0x04000000
|
#define BUTTON_REPEAT 0x04000000
|
||||||
#define BUTTON_TOUCHSCREEN 0x08000000
|
/* Special buttons */
|
||||||
#define BUTTON_MULTIMEDIA 0x10000000
|
#define BUTTON_TOUCHSCREEN 0x08000000
|
||||||
|
#define BUTTON_MULTIMEDIA 0x10000000
|
||||||
|
#define BUTTON_REDRAW 0x20000000
|
||||||
|
|
||||||
#define BUTTON_MULTIMEDIA_PLAYPAUSE (BUTTON_MULTIMEDIA|0x01)
|
#define BUTTON_MULTIMEDIA_PLAYPAUSE (BUTTON_MULTIMEDIA|0x01)
|
||||||
#define BUTTON_MULTIMEDIA_STOP (BUTTON_MULTIMEDIA|0x02)
|
#define BUTTON_MULTIMEDIA_STOP (BUTTON_MULTIMEDIA|0x02)
|
||||||
|
|
|
@ -56,6 +56,4 @@ void android_ignore_back_button(bool yes);
|
||||||
#define BUTTON_BOTTOMMIDDLE 0x00080000
|
#define BUTTON_BOTTOMMIDDLE 0x00080000
|
||||||
#define BUTTON_BOTTOMRIGHT 0x00100000
|
#define BUTTON_BOTTOMRIGHT 0x00100000
|
||||||
|
|
||||||
#define BUTTON_FORCE_REDRAW 0x00200000
|
|
||||||
|
|
||||||
#endif /* _BUTTON_TARGET_H_ */
|
#endif /* _BUTTON_TARGET_H_ */
|
||||||
|
|
|
@ -146,7 +146,7 @@ Java_org_rockbox_RockboxFramebuffer_surfaceCreated(JNIEnv *env, jobject this,
|
||||||
send_event(LCD_EVENT_ACTIVATION, NULL);
|
send_event(LCD_EVENT_ACTIVATION, NULL);
|
||||||
/* Force an update, since the newly created surface is initially black
|
/* Force an update, since the newly created surface is initially black
|
||||||
* waiting for the next normal update results in a longish black screen */
|
* waiting for the next normal update results in a longish black screen */
|
||||||
queue_post(&button_queue, BUTTON_FORCE_REDRAW, 0);
|
queue_post(&button_queue, BUTTON_REDRAW, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue