From 19956a077722ead951fb8745bdd41006d0201939 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Mon, 24 Feb 2025 09:58:28 -0500 Subject: [PATCH] [Bugfix] WPS pause while WPS not active causes display corruption Discovered this in the sim with car adapter mode: on when charger gets disconnected the device is paused if you have a different screen up the scrolling elems get redrawn incorrectly over the current screen to fix check the activity is the WPS, FM, or RECORDING before allowing redraw Change-Id: Ie3618347fde446fe0b78b9d3c67261ca63ffee1c --- apps/gui/wps.c | 10 +++++++++- apps/misc.c | 7 +------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/apps/gui/wps.c b/apps/gui/wps.c index 5b10ce9e3a..c49f27c0bd 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c @@ -150,7 +150,15 @@ void wps_do_action(enum wps_do_action_type action, bool updatewps) #endif } } - if (updatewps) + + /* Bugfix only do a skin refresh if in one of the below screens */ + enum current_activity act = get_current_activity(); + + bool refresh = (act == ACTIVITY_FM || + act == ACTIVITY_WPS || + act == ACTIVITY_RECORDING); + + if (updatewps && refresh) update_non_static(); } diff --git a/apps/misc.c b/apps/misc.c index 9e6ef1736d..8ce8ccbfa5 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -566,12 +566,7 @@ static void hp_unplug_change(bool inserted) headphone_caused_pause && global_settings.unplug_mode > 1 ) { - enum current_activity act = get_current_activity(); - /* only do a skin refresh if in one of the below screens */ - bool refresh = (act == ACTIVITY_FM || - act == ACTIVITY_WPS || - act == ACTIVITY_RECORDING); - unpause_action(refresh); + unpause_action(true); } headphone_caused_pause = false; } else {