Skip to content

Commit

Permalink
fix(color): full screen widget may not exit cleanly after calling lcd…
Browse files Browse the repository at this point in the history
….exitFullScreen() (#5544)
  • Loading branch information
philmoz authored Sep 19, 2024
1 parent 6563cd2 commit edb04cc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions radio/src/gui/colorlcd/mainview/widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class Widget : public ButtonBase

// Set/unset fullscreen mode
void setFullscreen(bool enable);
void closeFullscreen() { closeFS = true; }

// Called when the widget options have changed
virtual void update();
Expand All @@ -95,6 +96,7 @@ class Widget : public ButtonBase
PersistentData* persistentData;
bool fullscreen = false;
bool fsAllowed = true;
bool closeFS = false;
lv_obj_t* focusBorder = nullptr;
lv_style_t borderStyle;
lv_point_t borderPts[5];
Expand Down
7 changes: 2 additions & 5 deletions radio/src/lua/api_colorlcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1410,11 +1410,8 @@ Exit full screen widget mode.
*/
static int luaLcdExitFullScreen(lua_State *L)
{
if (runningFS) {
auto rfs = runningFS;
runningFS = nullptr;
rfs->setFullscreen(false);
}
if (runningFS)
runningFS->closeFullscreen();
return 0;
}

Expand Down
5 changes: 5 additions & 0 deletions radio/src/lua/lua_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ void LuaWidget::checkEvents()
{
Widget::checkEvents();

if (closeFS) {
closeFS = false;
setFullscreen(false);
}

// Call update once after widget first created
if (!created) {
created = true;
Expand Down

0 comments on commit edb04cc

Please sign in to comment.