fix(MSD): confirmation dialog properly shown (#2743)

Prior to this fix, the confirmation dialog would crash because of an issue in libopenui and even then would not be displayed for the lack of the proper parent window.

Fixes #2741
This commit is contained in:
Raphael Coeffic
2022-11-16 19:49:52 +10:00
committed by GitHub
parent a88611ac27
commit 9796c968f4
2 changed files with 9 additions and 2 deletions
+8 -1
View File
@@ -25,10 +25,17 @@
#include "opentx.h"
#include "libopenui.h"
static Window* _get_parent()
{
Window* p = Layer::back();
if (!p) p = MainWindow::instance();
return p;
}
FullScreenDialog::FullScreenDialog(
uint8_t type, std::string title, std::string message, std::string action,
const std::function<void(void)>& confirmHandler) :
Window(Layer::back(), {0, 0, LCD_W, LCD_H}, OPAQUE),
Window(_get_parent(), {0, 0, LCD_W, LCD_H}, OPAQUE),
type(type),
title(std::move(title)),
message(std::move(message)),