summaryrefslogtreecommitdiff
path: root/src/render/Renderer.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-01-29 13:58:47 +0000
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-01-29 13:58:47 +0000
commit3d83a0bc5f537b8909da1df1f0ec67809067959b (patch)
tree624c67b74686df90dd4eb703926f9a285e53e146 /src/render/Renderer.cpp
parent38011c50ab67bfc550a8747a9127f7bfbfb04871 (diff)
enable UV calcs for all surfaces
Diffstat (limited to 'src/render/Renderer.cpp')
-rw-r--r--src/render/Renderer.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 68a90b4b..2ca725bc 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -25,8 +25,7 @@ void renderSurface(struct wlr_surface* surface, int x, int y, void* data) {
windowBox.height = RDATA->h - y;
}
- if (RDATA->pWindow)
- g_pHyprRenderer->calculateUVForWindowSurface(RDATA->pWindow, surface, RDATA->squishOversized);
+ g_pHyprRenderer->calculateUVForSurface(RDATA->pWindow, surface, RDATA->squishOversized);
scaleBox(&windowBox, RDATA->pMonitor->scale);
@@ -539,8 +538,8 @@ void CHyprRenderer::renderAllClientsForMonitor(const int& ID, timespec* time) {
renderDragIcon(PMONITOR, time);
}
-void CHyprRenderer::calculateUVForWindowSurface(CWindow* pWindow, wlr_surface* pSurface, bool main) {
- if (!pWindow->m_bIsX11) {
+void CHyprRenderer::calculateUVForSurface(CWindow* pWindow, wlr_surface* pSurface, bool main) {
+ if (!pWindow || !pWindow->m_bIsX11) {
Vector2D uvTL;
Vector2D uvBR = Vector2D(1, 1);
@@ -570,7 +569,7 @@ void CHyprRenderer::calculateUVForWindowSurface(CWindow* pWindow, wlr_surface* p
g_pHyprOpenGL->m_RenderData.primarySurfaceUVBottomRight = Vector2D(-1, -1);
}
- if (!main)
+ if (!main || !pWindow)
return;
wlr_box geom;