From 7c409a445439d937dfa968c00c1f613227429e9e Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Fri, 13 May 2022 12:59:23 +0200 Subject: [PATCH] main window: call checkEvents() only on top most opaque window --- radio/src/thirdparty/libopenui/src/mainwindow.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/radio/src/thirdparty/libopenui/src/mainwindow.cpp b/radio/src/thirdparty/libopenui/src/mainwindow.cpp index 51f4f913b..3511d1d4f 100644 --- a/radio/src/thirdparty/libopenui/src/mainwindow.cpp +++ b/radio/src/thirdparty/libopenui/src/mainwindow.cpp @@ -33,7 +33,7 @@ TouchState touchState; MainWindow * MainWindow::_instance = nullptr; MainWindow::MainWindow() : - Window(nullptr, {0, 0, LCD_W, LCD_H}), + Window(nullptr, {0, 0, LCD_W, LCD_H}, OPAQUE), invalidatedRect(rect) { Layer::push(this); @@ -101,7 +101,14 @@ void MainWindow::run(bool trash) // KLK: removed for now. This is now // called from lvgl event processing when // necessary - checkEvents(); + auto layer = Layer::stack.rbegin(); + while (layer != Layer::stack.rend()) { + if (layer->main && (layer->main->getWindowFlags() & OPAQUE)) { + layer->main->checkEvents(); + break; + } + ++layer; + } if (trash) { emptyTrash();