mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-06 23:21:57 -07:00
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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user