summaryrefslogtreecommitdiff
path: root/src/render/OpenGL.cpp
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2025-08-14 17:13:15 +0200
committervaxerski <vaxry@vaxry.net>2025-08-14 17:13:23 +0200
commit60d769a89908c29e19100059985db15a7b6bab6a (patch)
tree229917a04ef34954bca5c816d21502bc98922d8e /src/render/OpenGL.cpp
parentbeee22a95ed9044950e5486f22edd813e00ffa2c (diff)
internal: unify VT getting
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();