Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(color): full screen widget may not exit cleanly after calling lcd.exitFullScreen() #5544

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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