summaryrefslogtreecommitdiff
path: root/src/render/Renderer.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2025-06-19 13:46:42 +0200
committerVaxry <vaxry@vaxry.net>2025-06-19 13:46:42 +0200
commit54ccf9c6b37a8aadde7b8e1fc737668f4966db61 (patch)
tree5faa751d0317d1f294005a791426003db5216cea /src/render/Renderer.cpp
parente999ad664da97d066e30e1d2749061eb57b0e19a (diff)
renderer: make lock fail textures dynamically loaded
this should reduce idle vram usage by a whopping 16MB, but also might fix the tty unknown issue.
Diffstat (limited to 'src/render/Renderer.cpp')
-rw-r--r--src/render/Renderer.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 43d4ece5..f828deb4 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -835,8 +835,7 @@ void CHyprRenderer::renderAllClientsForWorkspace(PHLMONITOR pMonitor, PHLWORKSPA
return;
if (g_pSessionLockManager->isSessionLocked() && !g_pSessionLockManager->isSessionLockPresent()) {
- // locked with no exclusive, draw only red
- renderSessionLockMissing(pMonitor);
+ // do not render anything. We will render a lockscreen anyways later.
return;
}
@@ -989,12 +988,21 @@ void CHyprRenderer::renderAllClientsForWorkspace(PHLMONITOR pMonitor, PHLWORKSPA
void CHyprRenderer::renderLockscreen(PHLMONITOR pMonitor, const Time::steady_tp& now, const CBox& geometry) {
TRACY_GPU_ZONE("RenderLockscreen");
- if (g_pSessionLockManager->isSessionLocked()) {
+ const bool LOCKED = g_pSessionLockManager->isSessionLocked();
+
+ g_pHyprOpenGL->ensureLockTexturesRendered( //
+ LOCKED && // session is locked AND
+ !g_pSessionLockManager->getSessionLockSurfaceForMonitor(pMonitor->m_id) && // no session lock surface AND
+ (g_pSessionLockManager->shallConsiderLockMissing() ||
+ !g_pSessionLockManager->isSessionLockPresent()) // we can consider rendering the lockMissing texture OR there is no client altogether
+ );
+
+ if (LOCKED) {
Vector2D translate = {geometry.x, geometry.y};
const auto PSLS = g_pSessionLockManager->getSessionLockSurfaceForMonitor(pMonitor->m_id);
if (!PSLS) {
- if (g_pSessionLockManager->shallConsiderLockMissing())
+ if (g_pSessionLockManager->shallConsiderLockMissing() || !g_pSessionLockManager->isSessionLockPresent())
renderSessionLockMissing(pMonitor);
} else {
renderSessionLockSurface(PSLS, pMonitor, now);