summaryrefslogtreecommitdiff
path: root/src/render/OpenGL.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/OpenGL.cpp')
-rw-r--r--src/render/OpenGL.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index bff6d9c4..e4d55f71 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -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();