mirror of
https://git.eden-emu.dev/archive/citron
synced 2026-04-18 10:40:48 -04:00
fix(gamescope): Fix Perf Overlay for Gamescope
Signed-off-by: Collecting <collecting@noreply.localhost>
This commit is contained in:
@@ -15,16 +15,18 @@
|
|||||||
#include "citron/uisettings.h"
|
#include "citron/uisettings.h"
|
||||||
|
|
||||||
class GMainWindow;
|
class GMainWindow;
|
||||||
|
class QSizeGrip;
|
||||||
|
|
||||||
class PerformanceOverlay : public QWidget {
|
class PerformanceOverlay : public QWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PerformanceOverlay(GMainWindow* parent);
|
explicit PerformanceOverlay(QWidget* parent);
|
||||||
~PerformanceOverlay() override;
|
~PerformanceOverlay() override;
|
||||||
|
|
||||||
void SetVisible(bool visible);
|
void SetVisible(bool visible);
|
||||||
bool IsVisible() const { return is_visible; }
|
bool IsVisible() const { return is_visible; }
|
||||||
|
void setMainWindow(GMainWindow* window) { main_window = window; }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void UpdateTheme();
|
void UpdateTheme();
|
||||||
@@ -40,6 +42,9 @@ private slots:
|
|||||||
void UpdatePerformanceStats();
|
void UpdatePerformanceStats();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool is_enabled = false;
|
||||||
|
bool is_visible = false;
|
||||||
|
|
||||||
void UpdatePosition();
|
void UpdatePosition();
|
||||||
void UpdateHardwareTemperatures();
|
void UpdateHardwareTemperatures();
|
||||||
void DrawPerformanceInfo(QPainter& painter);
|
void DrawPerformanceInfo(QPainter& painter);
|
||||||
@@ -51,6 +56,7 @@ private:
|
|||||||
void AddFrameTime(double frame_time_ms);
|
void AddFrameTime(double frame_time_ms);
|
||||||
|
|
||||||
GMainWindow* main_window;
|
GMainWindow* main_window;
|
||||||
|
QSizeGrip* size_grip;
|
||||||
QTimer update_timer;
|
QTimer update_timer;
|
||||||
|
|
||||||
// Performance data
|
// Performance data
|
||||||
@@ -66,14 +72,13 @@ private:
|
|||||||
float battery_temperature = 0.0f;
|
float battery_temperature = 0.0f;
|
||||||
|
|
||||||
// Frame graph data
|
// Frame graph data
|
||||||
static constexpr size_t MAX_FRAME_HISTORY = 120; // 2 seconds at 60 FPS
|
static constexpr size_t MAX_FRAME_HISTORY = 120;
|
||||||
std::deque<double> frame_times;
|
std::deque<double> frame_times;
|
||||||
double min_frame_time = 0.0;
|
double min_frame_time = 0.0;
|
||||||
double max_frame_time = 0.0;
|
double max_frame_time = 0.0;
|
||||||
double avg_frame_time = 0.0;
|
double avg_frame_time = 0.0;
|
||||||
|
|
||||||
// Display settings
|
// Display settings
|
||||||
bool is_visible = false;
|
|
||||||
QFont title_font;
|
QFont title_font;
|
||||||
QFont value_font;
|
QFont value_font;
|
||||||
QFont small_font;
|
QFont small_font;
|
||||||
|
|||||||
Reference in New Issue
Block a user