diff options
| author | Vaxry <vaxry@vaxry.net> | 2025-02-01 15:31:31 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2025-02-01 15:31:31 +0000 |
| commit | 88adae73ba3b57490fdef1041f58fcc6a15a54c8 (patch) | |
| tree | aab7f427f1a67a6658f4bac3c361b98cf2c5b6ba /src/render/pass/Pass.cpp | |
| parent | c6f672257bd2ae98f4fd7a6a273b2d1d3e944baa (diff) | |
pass: add input region debug
Diffstat (limited to 'src/render/pass/Pass.cpp')
| -rw-r--r-- | src/render/pass/Pass.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/render/pass/Pass.cpp b/src/render/pass/Pass.cpp index 5068cbbc..60c1bc30 100644 --- a/src/render/pass/Pass.cpp +++ b/src/render/pass/Pass.cpp @@ -8,6 +8,7 @@ #include "../../managers/eventLoop/EventLoopManager.hpp" #include "../../render/Renderer.hpp" #include "../../Compositor.hpp" +#include "../../protocols/core/Compositor.hpp" bool CRenderPass::empty() const { return false; @@ -242,6 +243,22 @@ void CRenderPass::renderDebugData() { if (g_pCompositor->m_pLastWindow) renderHLSurface(debugData.lastWindowText, g_pCompositor->m_pLastWindow->m_pWLSurface->resource(), Colors::LIGHT_BLUE.modifyA(0.1F)); + if (g_pSeatManager->state.pointerFocus) { + if (g_pSeatManager->state.pointerFocus->current.input.intersect(CBox{{}, g_pSeatManager->state.pointerFocus->current.size}).getExtents().size() != + g_pSeatManager->state.pointerFocus->current.size) { + auto hlSurface = CWLSurface::fromResource(g_pSeatManager->state.pointerFocus.lock()); + if (hlSurface) { + auto BOX = hlSurface->getSurfaceBoxGlobal(); + if (BOX) { + auto region = g_pSeatManager->state.pointerFocus->current.input.copy() + .scale(g_pHyprOpenGL->m_RenderData.pMonitor->scale) + .translate(BOX->pos() - g_pHyprOpenGL->m_RenderData.pMonitor->vecPosition); + g_pHyprOpenGL->renderRectWithDamage(box, CHyprColor{0.8F, 0.8F, 0.2F, 0.4F}, region); + } + } + } + } + const auto DISCARDED_ELEMENTS = std::count_if(m_vPassElements.begin(), m_vPassElements.end(), [](const auto& e) { return e->discard; }); auto tex = g_pHyprOpenGL->renderText(std::format("occlusion layers: {}\npass elements: {} ({} discarded)\nviewport: {:X0}", occludedRegions.size(), m_vPassElements.size(), DISCARDED_ELEMENTS, g_pHyprOpenGL->m_RenderData.pMonitor->vecPixelSize), |
