From 9796c968f43fc4107c0218be7c942919d006aaeb Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Wed, 16 Nov 2022 10:49:52 +0100 Subject: [PATCH] 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 --- radio/src/gui/colorlcd/fullscreen_dialog.cpp | 9 ++++++++- radio/src/thirdparty/libopenui | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/radio/src/gui/colorlcd/fullscreen_dialog.cpp b/radio/src/gui/colorlcd/fullscreen_dialog.cpp index 727970d9a..23bff4b99 100644 --- a/radio/src/gui/colorlcd/fullscreen_dialog.cpp +++ b/radio/src/gui/colorlcd/fullscreen_dialog.cpp @@ -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& 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)), diff --git a/radio/src/thirdparty/libopenui b/radio/src/thirdparty/libopenui index 7b2fb8300..fbb92f83c 160000 --- a/radio/src/thirdparty/libopenui +++ b/radio/src/thirdparty/libopenui @@ -1 +1 @@ -Subproject commit 7b2fb8300531a6be5348114b6a60093e50970a65 +Subproject commit fbb92f83cf49af11c47919f3114ab2279c88b7a2