diff --git a/Target_Linux.cmake b/Target_Linux.cmake index 4c4b33f5e..75a188c14 100644 --- a/Target_Linux.cmake +++ b/Target_Linux.cmake @@ -5,7 +5,6 @@ add_compile_options(-funsigned-char) set(TARGET_LIBRARIES rt pthread - portaudio CACHE INTERNAL "" ) link_libraries(pthread rt) diff --git a/module-apps/apps-common/ApplicationCommon.cpp b/module-apps/apps-common/ApplicationCommon.cpp index 03627ebf2..a0a4c0677 100644 --- a/module-apps/apps-common/ApplicationCommon.cpp +++ b/module-apps/apps-common/ApplicationCommon.cpp @@ -127,8 +127,6 @@ namespace app connect(typeid(AppRefreshMessage), [this](sys::Message *msg) -> sys::MessagePointer { return handleAppRefresh(msg); }); - connect(typeid(AppShutdownRefreshMessage), - [this](sys::Message *msg) -> sys::MessagePointer { return handleAppShutdownRefresh(msg); }); connect(sevm::BatteryStatusChangeMessage(), [&](sys::Message *) { return handleBatteryStatusChange(); }); connect(typeid(app::manager::DOMRequest), [&](sys::Message *msg) -> sys::MessagePointer { return handleGetDOM(msg); }); @@ -713,33 +711,6 @@ namespace app return sys::msgHandled(); } - sys::MessagePointer ApplicationCommon::handleAppShutdownRefresh(sys::Message *msgl) - { - auto *msg = static_cast(msgl); - assert(msg); - - if (not windowsFactory.isRegistered(msg->getWindowName())) { - LOG_ERROR("Cannot find window %s windowsFactory in application: %s", - msg->getWindowName().c_str(), - GetName().c_str()); - return sys::msgHandled(); - } - - pushWindow(msg->getWindowName()); - auto window = getWindow(msg->getWindowName()); - - if (not window) { - LOG_ERROR("Cannot find window %s in application %s", msg->getWindowName().c_str(), GetName().c_str()); - return sys::msgHandled(); - } - - auto message = std::make_shared(window->buildDrawList(), msg->getMode()); - message->setCommandType(service::gui::DrawMessage::Type::SHUTDOWN); - bus.sendUnicast(std::move(message), service::name::gui); - - return sys::msgHandled(); - } - sys::MessagePointer ApplicationCommon::handleGetDOM(sys::Message *msgl) { if (windowsStack().isEmpty()) { @@ -936,8 +907,25 @@ namespace app GetName().c_str(), windowName.length() ? windowName.c_str() : default_window.c_str()); #endif - auto msg = std::make_shared(windowName); - bus.sendUnicast(msg, this->GetName()); + if (not windowsFactory.isRegistered(windowName)) { + LOG_ERROR("Cannot find window %s windowsFactory in application: %s", windowName.c_str(), GetName().c_str()); + return; + } + + pushWindow(windowName); + const auto window = getWindow(windowName); + if (not window) { + LOG_ERROR("Cannot find window %s in application %s", windowName.c_str(), GetName().c_str()); + return; + } + + const auto response = bus.sendUnicastSync( + std::make_shared(window->buildDrawList(), gui::RefreshModes::GUI_REFRESH_DEEP), + service::name::gui, + 100); + if (response.first != sys::ReturnCodes::Success) { + LOG_FATAL("Failed to send the shutdown window frame"); + } } bool ApplicationCommon::userInterfaceDBNotification([[maybe_unused]] sys::Message *msg, diff --git a/module-apps/apps-common/ApplicationCommon.hpp b/module-apps/apps-common/ApplicationCommon.hpp index 64e286bbf..fc25583eb 100644 --- a/module-apps/apps-common/ApplicationCommon.hpp +++ b/module-apps/apps-common/ApplicationCommon.hpp @@ -206,7 +206,6 @@ namespace app bool handleUpdateTextRefresh(gui::SwitchData *data); sys::MessagePointer handleAppRebuild(sys::Message *msgl); sys::MessagePointer handleAppRefresh(sys::Message *msgl); - sys::MessagePointer handleAppShutdownRefresh(sys::Message *msgl); sys::MessagePointer handleGetDOM(sys::Message *msgl); std::list> gui_timers; diff --git a/module-apps/apps-common/messages/AppMessage.hpp b/module-apps/apps-common/messages/AppMessage.hpp index 76ab29849..bc844f225 100644 --- a/module-apps/apps-common/messages/AppMessage.hpp +++ b/module-apps/apps-common/messages/AppMessage.hpp @@ -114,13 +114,6 @@ namespace app } }; - class AppShutdownRefreshMessage : public AppRefreshMessage - { - public: - AppShutdownRefreshMessage(std::string window_name) - : AppRefreshMessage(gui::RefreshModes::GUI_REFRESH_DEEP, window_name){}; - }; - class AppSwitchWindowMessage : public AppMessage { protected: diff --git a/module-audio/Audio/AudioDevice.hpp b/module-audio/Audio/AudioDevice.hpp index 2a6b5e81b..1b82c7ea1 100644 --- a/module-audio/Audio/AudioDevice.hpp +++ b/module-audio/Audio/AudioDevice.hpp @@ -3,7 +3,7 @@ #pragma once -#include