From 1c50a11688451049185baae3109ddc87a268a75e Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 17 Apr 2023 23:47:12 +0100 Subject: [PATCH] opengl: keep current rendered workspace in renderData --- src/render/OpenGL.hpp | 3 ++- src/render/Renderer.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/render/OpenGL.hpp b/src/render/OpenGL.hpp index 624878ff..be65cb85 100644 --- a/src/render/OpenGL.hpp +++ b/src/render/OpenGL.hpp @@ -65,7 +65,8 @@ struct SMonitorRenderData { }; struct SCurrentRenderData { - CMonitor* pMonitor = nullptr; + CMonitor* pMonitor = nullptr; + CWorkspace* pWorkspace = nullptr; float projection[9]; float savedProjection[9]; diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index e96be9cc..3ec3724a 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -1028,7 +1028,6 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) { } void CHyprRenderer::renderWorkspace(CMonitor* pMonitor, CWorkspace* pWorkspace, timespec* now, const wlr_box& geometry) { - Vector2D translate = {geometry.x, geometry.y}; float scale = (float)geometry.width / pMonitor->vecPixelSize.x; @@ -1038,7 +1037,9 @@ void CHyprRenderer::renderWorkspace(CMonitor* pMonitor, CWorkspace* pWorkspace, translate = Vector2D{}; } + g_pHyprOpenGL->m_RenderData.pWorkspace = pWorkspace; renderAllClientsForWorkspace(pMonitor, pWorkspace, now, translate, scale); + g_pHyprOpenGL->m_RenderData.pWorkspace = nullptr; } void CHyprRenderer::setWindowScanoutMode(CWindow* pWindow) {