diff --git a/src/citron/util/performance_overlay.cpp b/src/citron/util/performance_overlay.cpp index f82678392..4c8b8db72 100644 --- a/src/citron/util/performance_overlay.cpp +++ b/src/citron/util/performance_overlay.cpp @@ -12,6 +12,9 @@ #include #include +#include +#include + #include "citron/main.h" #include "citron/util/performance_overlay.h" #include "core/core.h" @@ -105,6 +108,26 @@ void PerformanceOverlay::resizeEvent(QResizeEvent* event) { UpdatePosition(); } +#if defined(Q_OS_LINUX) +// LINUX-SPECIFIC IMPLEMENTATION (Wayland Fix) +void PerformanceOverlay::mousePressEvent(QMouseEvent* event) { + if (event->button() == Qt::LeftButton) { + // Hand off window moving responsibility to the OS compositor. + if (windowHandle()) { + windowHandle()->startSystemMove(); + } + } + QWidget::mousePressEvent(event); +} + +void PerformanceOverlay::mouseMoveEvent(QMouseEvent* event) { + // This function is intentionally left blank for dragging, as the + // system compositor now handles the entire move operation. + QWidget::mouseMoveEvent(event); +} + +#else +// ORIGINAL IMPLEMENTATION void PerformanceOverlay::mousePressEvent(QMouseEvent* event) { if (event->button() == Qt::LeftButton) { is_dragging = true; @@ -122,6 +145,7 @@ void PerformanceOverlay::mouseMoveEvent(QMouseEvent* event) { } QWidget::mouseMoveEvent(event); } +#endif void PerformanceOverlay::mouseReleaseEvent(QMouseEvent* event) { if (event->button() == Qt::LeftButton) { @@ -132,6 +156,7 @@ void PerformanceOverlay::mouseReleaseEvent(QMouseEvent* event) { QWidget::mouseReleaseEvent(event); } + void PerformanceOverlay::UpdatePerformanceStats() { if (!main_window) { return;