Qt: Clear OSD messages on system stop
This commit is contained in:
parent
914f3ad447
commit
547cc4dbf6
|
@ -641,6 +641,7 @@ void QtHostInterface::OnSystemDestroyed()
|
||||||
{
|
{
|
||||||
CommonHostInterface::OnSystemDestroyed();
|
CommonHostInterface::OnSystemDestroyed();
|
||||||
|
|
||||||
|
ClearOSDMessages();
|
||||||
startBackgroundControllerPollTimer();
|
startBackgroundControllerPollTimer();
|
||||||
emit emulationStopped();
|
emit emulationStopped();
|
||||||
}
|
}
|
||||||
|
|
|
@ -830,6 +830,12 @@ void CommonHostInterface::AddOSDMessage(std::string message, float duration /*=
|
||||||
m_osd_messages.push_back(std::move(msg));
|
m_osd_messages.push_back(std::move(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CommonHostInterface::ClearOSDMessages()
|
||||||
|
{
|
||||||
|
std::unique_lock<std::mutex> lock(m_osd_messages_lock);
|
||||||
|
m_osd_messages.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void CommonHostInterface::DrawOSDMessages()
|
void CommonHostInterface::DrawOSDMessages()
|
||||||
{
|
{
|
||||||
constexpr ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoInputs |
|
constexpr ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoInputs |
|
||||||
|
|
|
@ -128,6 +128,7 @@ public:
|
||||||
|
|
||||||
/// Adds OSD messages, duration is in seconds.
|
/// Adds OSD messages, duration is in seconds.
|
||||||
void AddOSDMessage(std::string message, float duration = 2.0f) override;
|
void AddOSDMessage(std::string message, float duration = 2.0f) override;
|
||||||
|
void ClearOSDMessages();
|
||||||
|
|
||||||
/// Displays a loading screen with the logo, rendered with ImGui. Use when executing possibly-time-consuming tasks
|
/// Displays a loading screen with the logo, rendered with ImGui. Use when executing possibly-time-consuming tasks
|
||||||
/// such as compiling shaders when starting up.
|
/// such as compiling shaders when starting up.
|
||||||
|
|
Loading…
Reference in New Issue