From b45af08c8788a7366683ec917586dca2a280ecc2 Mon Sep 17 00:00:00 2001 From: "pls.153" Date: Tue, 5 Mar 2024 17:41:35 +0100 Subject: [PATCH] example 'meshtastic': fix for background mode --- examples/meshtastic/cpp/qt.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/meshtastic/cpp/qt.cpp b/examples/meshtastic/cpp/qt.cpp index 0f5d17d..ee032fd 100644 --- a/examples/meshtastic/cpp/qt.cpp +++ b/examples/meshtastic/cpp/qt.cpp @@ -110,8 +110,13 @@ QT::QT() : QObject() { ble->setBackgroundMode(true); ecl_fun("app:background-mode-changed", true); } else if (state == Qt::ApplicationActive) { - ble->setBackgroundMode(false); - ecl_fun("app:background-mode-changed", false); + static bool startup = true; + if (startup) { + startup = false; + } else { + ble->setBackgroundMode(false); + ecl_fun("app:background-mode-changed", false); + } } }); #endif