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:
Christian Soffke 2026-05-02 14:19:29 +02:00
parent 89dd08a3b4
commit 83e55164f4
6 changed files with 36 additions and 10 deletions

View file

@ -28,6 +28,7 @@
#if !defined(BOOTLOADER) #if !defined(BOOTLOADER)
#include "language.h" #include "language.h"
#include "skin_engine/skin_engine.h"
#endif #endif
#include "appevents.h" #include "appevents.h"
@ -937,19 +938,20 @@ static inline void do_softlock(action_last_t *last, action_cur_t *cur)
if (notify_user) if (notify_user)
{ {
#ifndef BOOTLOADER
skin_request_update_locked();
#endif
action_handle_backlight(true, false); action_handle_backlight(true, false);
if (!has_flag(last->softlock_mask, SEL_ACTION_ALLNONOTIFY))
{
#ifdef HAVE_BACKLIGHT #ifdef HAVE_BACKLIGHT
/* If we don't wait for a moment for the backlight queue to process, /* If we don't wait for a moment for the backlight queue to process,
* the user will never see the message * the user will never see the message
*/ */
if (!is_backlight_on(false)) if (!is_backlight_on(false))
{
sleep(HZ/2); sleep(HZ/2);
}
#endif #endif
if (!has_flag(last->softlock_mask, SEL_ACTION_ALLNONOTIFY))
{
if (last->keys_locked) if (last->keys_locked)
{ {
splash(HZ/2, ID2P(LANG_KEYLOCK_ON)); splash(HZ/2, ID2P(LANG_KEYLOCK_ON));

View file

@ -342,6 +342,19 @@ void skin_request_full_update(enum skinnable_screens skin)
skins[skin][i].needs_full_update = true; 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) bool dbg_skin_engine(void)
{ {
struct simplelist_info info; struct simplelist_info info;

View file

@ -82,6 +82,7 @@ void skin_unload_all(void);
bool skin_do_full_update(enum skinnable_screens skin, enum screen_type screen); 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_full_update(enum skinnable_screens skin);
void skin_request_update_locked(void);
bool dbg_skin_engine(void); bool dbg_skin_engine(void);

View file

@ -224,6 +224,11 @@ void sb_skin_set_update_delay(int delay)
update_delay = 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: /* This creates and loads a ".sbs" based on the user settings for:
* - regular statusbar * - regular statusbar
* - colours * - colours

View file

@ -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_update(enum screen_type screen, bool force);
void sb_skin_set_update_delay(int delay); 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_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, bool sb_set_persistent_title(const char* title, enum themable_icons icon,
enum screen_type screen); enum screen_type screen);

View file

@ -24,6 +24,7 @@
#if !defined(BOOTLOADER) #if !defined(BOOTLOADER)
#include "settings.h" #include "settings.h"
#include "action.h" #include "action.h"
#include "../apps/gui/skin_engine/skin_engine.h"
#endif #endif
#include <stdlib.h> #include <stdlib.h>
#include "cpu.h" #include "cpu.h"
@ -887,6 +888,9 @@ void backlight_set_timeout_plugged(int value)
/* Hold button change event handler. */ /* Hold button change event handler. */
void backlight_hold_changed(bool hold_button) void backlight_hold_changed(bool hold_button)
{ {
#ifndef BOOTLOADER
skin_request_update_locked();
#endif
if (!hold_button || (backlight_on_button_hold > 0)) if (!hold_button || (backlight_on_button_hold > 0))
{ {
/* if unlocked or override in effect */ /* if unlocked or override in effect */