From d78b53968feb048e9bd5ca426dce63ebb1494d8a Mon Sep 17 00:00:00 2001 From: vaxerski Date: Wed, 2 Nov 2022 10:24:32 +0000 Subject: [PATCH] render the debug overlay only on visible monitors --- src/events/Monitors.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/events/Monitors.cpp b/src/events/Monitors.cpp index 60642774..427bf61d 100644 --- a/src/events/Monitors.cpp +++ b/src/events/Monitors.cpp @@ -232,11 +232,11 @@ void Events::listener_monitorFrame(void* owner, void* data) { g_pHyprRenderer->renderAllClientsForMonitor(PMONITOR->ID, &now); // if correct monitor draw hyprerror - if (PMONITOR->ID == 0) + if (PMONITOR == g_pCompositor->m_vMonitors.front().get()) g_pHyprError->draw(); // for drawing the debug overlay - if (PMONITOR->ID == 0 && *PDEBUGOVERLAY == 1) { + if (PMONITOR == g_pCompositor->m_vMonitors.front().get() && *PDEBUGOVERLAY == 1) { startRenderOverlay = std::chrono::high_resolution_clock::now(); g_pDebugOverlay->draw(); endRenderOverlay = std::chrono::high_resolution_clock::now(); @@ -291,7 +291,7 @@ void Events::listener_monitorFrame(void* owner, void* data) { if (*PDEBUGOVERLAY == 1) { const float µs = std::chrono::duration_cast(std::chrono::high_resolution_clock::now() - startRender).count() / 1000.f; g_pDebugOverlay->renderData(PMONITOR, µs); - if (PMONITOR->ID == 0) { + if (PMONITOR == g_pCompositor->m_vMonitors.front().get()) { const float µsNoOverlay = µs - std::chrono::duration_cast(endRenderOverlay - startRenderOverlay).count() / 1000.f; g_pDebugOverlay->renderDataNoOverlay(PMONITOR, µsNoOverlay); } else {