A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

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

+13 -12
+4
apps/action.c
··· 233 233 * multimedia button presses don't go through the action system */ 234 234 if (button == BUTTON_NONE || button & (SYS_EVENT|BUTTON_MULTIMEDIA)) 235 235 return button; 236 + /* the special redraw button should result in a screen refresh */ 237 + if (button == BUTTON_REDRAW) 238 + return ACTION_REDRAW; 239 + 236 240 /* Don't send any buttons through untill we see the release event */ 237 241 if (wait_for_release) 238 242 {
+1 -1
apps/gui/bitmap/list.c
··· 587 587 data->velocity = 0; 588 588 } 589 589 590 - queue_post(&button_queue, BUTTON_TOUCHSCREEN, 0); 590 + queue_post(&button_queue, BUTTON_REDRAW, 0); 591 591 /* stop if the velocity hit or crossed zero */ 592 592 if (!data->velocity) 593 593 {
-3
apps/keymaps/keymap-android.c
··· 50 50 { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, 51 51 { ACTION_STD_CONTEXT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, 52 52 53 - /* special hack to get a redraw on activity resume, see lcd-android.c */ 54 - { ACTION_REDRAW, BUTTON_FORCE_REDRAW, BUTTON_NONE }, 55 - 56 53 LAST_ITEM_IN_LIST 57 54 }; /* button_context_standard */ 58 55
+7 -5
firmware/export/button.h
··· 81 81 int button_apply_acceleration(const unsigned int data); 82 82 #endif 83 83 84 - #define BUTTON_NONE 0x00000000 84 + #define BUTTON_NONE 0x00000000 85 85 86 86 /* Button modifiers */ 87 - #define BUTTON_REL 0x02000000 88 - #define BUTTON_REPEAT 0x04000000 89 - #define BUTTON_TOUCHSCREEN 0x08000000 90 - #define BUTTON_MULTIMEDIA 0x10000000 87 + #define BUTTON_REL 0x02000000 88 + #define BUTTON_REPEAT 0x04000000 89 + /* Special buttons */ 90 + #define BUTTON_TOUCHSCREEN 0x08000000 91 + #define BUTTON_MULTIMEDIA 0x10000000 92 + #define BUTTON_REDRAW 0x20000000 91 93 92 94 #define BUTTON_MULTIMEDIA_PLAYPAUSE (BUTTON_MULTIMEDIA|0x01) 93 95 #define BUTTON_MULTIMEDIA_STOP (BUTTON_MULTIMEDIA|0x02)
-2
firmware/target/hosted/android/app/button-target.h
··· 56 56 #define BUTTON_BOTTOMMIDDLE 0x00080000 57 57 #define BUTTON_BOTTOMRIGHT 0x00100000 58 58 59 - #define BUTTON_FORCE_REDRAW 0x00200000 60 - 61 59 #endif /* _BUTTON_TARGET_H_ */
+1 -1
firmware/target/hosted/android/lcd-android.c
··· 146 146 send_event(LCD_EVENT_ACTIVATION, NULL); 147 147 /* Force an update, since the newly created surface is initially black 148 148 * waiting for the next normal update results in a longish black screen */ 149 - queue_post(&button_queue, BUTTON_FORCE_REDRAW, 0); 149 + queue_post(&button_queue, BUTTON_REDRAW, 0); 150 150 } 151 151 152 152 /*