diff --git a/src/config/ConfigDescriptions.hpp b/src/config/ConfigDescriptions.hpp index fde8173deea..63a0cc5c0b9 100644 --- a/src/config/ConfigDescriptions.hpp +++ b/src/config/ConfigDescriptions.hpp @@ -1121,6 +1121,12 @@ inline static const std::vector CONFIG_OPTIONS = { .type = CONFIG_OPTION_BOOL, .data = SConfigOptionDescription::SBoolData{false}, }, + SConfigOptionDescription{ + .value = "misc:disable_lockdead_screen", + .description = "disable the lockdead screen when lockscreen failed.", + .type = CONFIG_OPTION_BOOL, + .data = SConfigOptionDescription::SBoolData{false}, + }, /* * binds: diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index fbbc8dbdcbf..e6fcee790ba 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -377,6 +377,7 @@ CConfigManager::CConfigManager() { m_pConfig->addConfigValue("misc:middle_click_paste", Hyprlang::INT{1}); m_pConfig->addConfigValue("misc:render_unfocused_fps", Hyprlang::INT{15}); m_pConfig->addConfigValue("misc:disable_xdg_env_checks", Hyprlang::INT{0}); + m_pConfig->addConfigValue("misc:disable_lockdead_screen", Hyprlang::INT{0}); m_pConfig->addConfigValue("group:insert_after_current", Hyprlang::INT{1}); m_pConfig->addConfigValue("group:focus_removed_window", Hyprlang::INT{1}); diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index d98e32a95f1..ba1ac173263 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -1042,12 +1042,17 @@ void CHyprRenderer::renderLockscreen(PHLMONITOR pMonitor, timespec* now, const C TRACY_GPU_ZONE("RenderLockscreen"); if (g_pSessionLockManager->isSessionLocked()) { - Vector2D translate = {geometry.x, geometry.y}; + Vector2D translate = {geometry.x, geometry.y}; - const auto PSLS = g_pSessionLockManager->getSessionLockSurfaceForMonitor(pMonitor->ID); - if (!PSLS) - renderSessionLockMissing(pMonitor); - else { + const auto PSLS = g_pSessionLockManager->getSessionLockSurfaceForMonitor(pMonitor->ID); + static auto DISABLE_LOCKDEAD_SCREEN = CConfigValue("misc:disable_lockdead_screen"); + + if (!PSLS) { + if (!*DISABLE_LOCKDEAD_SCREEN) + renderSessionLockMissing(pMonitor); + else + Debug::log(WARN, "Lockdead screen shall have been displayed but it is disabled by configuration."); + } else { renderSessionLockSurface(PSLS, pMonitor, now); g_pSessionLockManager->onLockscreenRenderedOnMonitor(pMonitor->ID); } @@ -2725,7 +2730,7 @@ bool CHyprRenderer::beginRender(PHLMONITOR pMonitor, CRegion& damage, eRenderMod return true; } - /* This is a constant expression, as we always use double-buffering in our swapchain + /* This is a constant expression, as we always use double-buffering in our swapchain TODO: Rewrite the CDamageRing to take advantage of that maybe? It's made to support longer swapchains atm because we used to do wlroots */ static constexpr const int HL_BUFFER_AGE = 2;