fix(ui): Improper Overlay Shutdown & Zombie Processes

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

View File

@@ -2,6 +2,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <QApplication> #include <QApplication>
#include <QCoreApplication>
#include <QPainter> #include <QPainter>
#include <QPainterPath> #include <QPainterPath>
#include <QScreen> #include <QScreen>
@@ -90,7 +91,9 @@ PerformanceOverlay::PerformanceOverlay(QWidget* parent) : QWidget(UISettings::Is
UpdatePosition(); UpdatePosition();
} }
PerformanceOverlay::~PerformanceOverlay() = default; PerformanceOverlay::~PerformanceOverlay() {
update_timer.stop();
}
void PerformanceOverlay::SetVisible(bool visible) { void PerformanceOverlay::SetVisible(bool visible) {
is_enabled = visible; is_enabled = visible;
@@ -167,7 +170,14 @@ void PerformanceOverlay::mouseReleaseEvent(QMouseEvent* event) {
} }
void PerformanceOverlay::UpdatePerformanceStats() { void PerformanceOverlay::UpdatePerformanceStats() {
if (!main_window || !is_enabled) return; // Stop the timer and hide if the app is closing
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 = (QApplication::activePopupWidget() != nullptr); bool ui_active = (QApplication::activePopupWidget() != nullptr);