mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-05-12 11:43:16 -04:00
gui: remove SBS lock/unlock redraw lag
Stop the lock indicators on the SBS from lagging behind their actual state when lock notifications are disabled. Request immediate skin update in button loop, so the device doesn't feel laggy. Change-Id: I42955f65d9ad4ca9196549d806538d1badb5f79d
This commit is contained in:
parent
89dd08a3b4
commit
83e55164f4
6 changed files with 36 additions and 10 deletions
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#if !defined(BOOTLOADER)
|
||||
#include "language.h"
|
||||
#include "skin_engine/skin_engine.h"
|
||||
#endif
|
||||
|
||||
#include "appevents.h"
|
||||
|
|
@ -937,19 +938,20 @@ static inline void do_softlock(action_last_t *last, action_cur_t *cur)
|
|||
|
||||
if (notify_user)
|
||||
{
|
||||
#ifndef BOOTLOADER
|
||||
skin_request_update_locked();
|
||||
#endif
|
||||
action_handle_backlight(true, false);
|
||||
|
||||
#ifdef HAVE_BACKLIGHT
|
||||
/* If we don't wait for a moment for the backlight queue to process,
|
||||
* the user will never see the message
|
||||
*/
|
||||
if (!is_backlight_on(false))
|
||||
{
|
||||
sleep(HZ/2);
|
||||
}
|
||||
#endif
|
||||
if (!has_flag(last->softlock_mask, SEL_ACTION_ALLNONOTIFY))
|
||||
{
|
||||
#ifdef HAVE_BACKLIGHT
|
||||
/* If we don't wait for a moment for the backlight queue to process,
|
||||
* the user will never see the message
|
||||
*/
|
||||
if (!is_backlight_on(false))
|
||||
sleep(HZ/2);
|
||||
#endif
|
||||
if (last->keys_locked)
|
||||
{
|
||||
splash(HZ/2, ID2P(LANG_KEYLOCK_ON));
|
||||
|
|
|
|||
|
|
@ -342,6 +342,19 @@ void skin_request_full_update(enum skinnable_screens skin)
|
|||
skins[skin][i].needs_full_update = true;
|
||||
}
|
||||
|
||||
|
||||
/* Request skin update for lock state change */
|
||||
void skin_request_update_locked(void)
|
||||
{
|
||||
if (get_current_activity() == ACTIVITY_WPS)
|
||||
return;
|
||||
|
||||
sb_skin_force_next_update();
|
||||
#ifdef HAS_BUTTON_HOLD
|
||||
button_queue_post(BUTTON_NONE, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool dbg_skin_engine(void)
|
||||
{
|
||||
struct simplelist_info info;
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ void skin_unload_all(void);
|
|||
|
||||
bool skin_do_full_update(enum skinnable_screens skin, enum screen_type screen);
|
||||
void skin_request_full_update(enum skinnable_screens skin);
|
||||
void skin_request_update_locked(void);
|
||||
|
||||
bool dbg_skin_engine(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -224,6 +224,11 @@ void sb_skin_set_update_delay(int delay)
|
|||
update_delay = delay;
|
||||
}
|
||||
|
||||
void sb_skin_force_next_update(void)
|
||||
{
|
||||
force_waiting = true;
|
||||
}
|
||||
|
||||
/* This creates and loads a ".sbs" based on the user settings for:
|
||||
* - regular statusbar
|
||||
* - colours
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ struct viewport *sb_skin_get_info_vp(enum screen_type screen);
|
|||
void sb_skin_update(enum screen_type screen, bool force);
|
||||
|
||||
void sb_skin_set_update_delay(int delay);
|
||||
void sb_skin_force_next_update(void);
|
||||
bool sb_set_title_text(const char* title, enum themable_icons icon, enum screen_type screen);
|
||||
bool sb_set_persistent_title(const char* title, enum themable_icons icon,
|
||||
enum screen_type screen);
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
#if !defined(BOOTLOADER)
|
||||
#include "settings.h"
|
||||
#include "action.h"
|
||||
#include "../apps/gui/skin_engine/skin_engine.h"
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include "cpu.h"
|
||||
|
|
@ -887,6 +888,9 @@ void backlight_set_timeout_plugged(int value)
|
|||
/* Hold button change event handler. */
|
||||
void backlight_hold_changed(bool hold_button)
|
||||
{
|
||||
#ifndef BOOTLOADER
|
||||
skin_request_update_locked();
|
||||
#endif
|
||||
if (!hold_button || (backlight_on_button_hold > 0))
|
||||
{
|
||||
/* if unlocked or override in effect */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue