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.
This commit is contained in:
Vaxry
2025-06-19 13:46:42 +02:00
parent e999ad664d
commit 54ccf9c6b3
3 changed files with 41 additions and 13 deletions

View File

@@ -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);