mirror of
https://git.eden-emu.dev/archive/citron
synced 2026-03-23 01:56:08 -04:00
fix(ui): Improper Overlay Shutdown & Zombie Processes
Signed-off-by: Collecting <collecting@noreply.localhost>
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user