internal: unify VT getting

This commit is contained in:
vaxerski 2025-08-14 17:13:15 +02:00
parent beee22a95e
commit 60d769a899
4 changed files with 28 additions and 21 deletions

View file

@ -2856,11 +2856,9 @@ void CHyprOpenGLImpl::ensureLockTexturesRendered(bool load) {
m_lockDeadTexture = loadAsset("lockdead.png");
m_lockDead2Texture = loadAsset("lockdead2.png");
m_lockTtyTextTexture = renderText(std::format("Running on tty {}",
g_pCompositor->m_aqBackend->hasSession() && g_pCompositor->m_aqBackend->session->vt > 0 ?
std::to_string(g_pCompositor->m_aqBackend->session->vt) :
"unknown"),
CHyprColor{0.9F, 0.9F, 0.9F, 0.7F}, 20, true);
const auto VT = g_pCompositor->getVTNr();
m_lockTtyTextTexture = renderText(std::format("Running on tty {}", VT.has_value() ? std::to_string(*VT) : "unknown"), CHyprColor{0.9F, 0.9F, 0.9F, 0.7F}, 20, true);
} else {
m_lockDeadTexture.reset();
m_lockDead2Texture.reset();