fix(ui): Improper Overlay Shutdown & Zombie Processes

Signed-off-by: Collecting <collecting@noreply.localhost>
This commit is contained in:
Collecting
2026-01-08 07:07:44 +00:00
parent ec728ced2c
commit 7bb952df3e

View File

@@ -9,6 +9,7 @@
#include "hid_core/hid_core.h" #include "hid_core/hid_core.h"
#include <QApplication> #include <QApplication>
#include <QCoreApplication>
#include <QGridLayout> #include <QGridLayout>
#include <QMouseEvent> #include <QMouseEvent>
#include <QPainter> #include <QPainter>
@@ -75,10 +76,19 @@ ControllerOverlay::ControllerOverlay(GMainWindow* parent)
} }
} }
ControllerOverlay::~ControllerOverlay() = default; ControllerOverlay::~ControllerOverlay() {
update_timer.stop();
}
void ControllerOverlay::UpdateControllerState() { void ControllerOverlay::UpdateControllerState() {
if (!main_window || !is_enabled) return; // If we're shutting down, kill the timer and hide.
if (QCoreApplication::closingDown() || !main_window || main_window->isHidden()) {
update_timer.stop();
if (!this->isHidden()) this->hide();
return;
}
if (!is_enabled) return;
if (UISettings::IsGamescope()) { if (UISettings::IsGamescope()) {
bool ui_active = false; bool ui_active = false;