mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-07 23:51:55 -07:00
lock: add allow_session_lock_restore
This commit is contained in:
@@ -93,6 +93,7 @@ void CConfigManager::setDefaultVars() {
|
||||
configValues["misc:render_ahead_safezone"].intValue = 1;
|
||||
configValues["misc:cursor_zoom_factor"].floatValue = 1.f;
|
||||
configValues["misc:cursor_zoom_rigid"].intValue = 0;
|
||||
configValues["misc:allow_session_lock_restore"].intValue = 0;
|
||||
|
||||
configValues["debug:int"].intValue = 0;
|
||||
configValues["debug:log_damage"].intValue = 0;
|
||||
|
@@ -44,7 +44,9 @@ static void handleSurfaceDestroy(void* owner, void* data) {
|
||||
|
||||
void CSessionLockManager::onNewSessionLock(wlr_session_lock_v1* pWlrLock) {
|
||||
|
||||
if (m_sSessionLock.active) {
|
||||
static auto* const PALLOWRELOCK = &g_pConfigManager->getConfigValuePtr("misc:allow_session_lock_restore")->intValue;
|
||||
|
||||
if (m_sSessionLock.active && (!*PALLOWRELOCK || m_sSessionLock.pWlrLock)) {
|
||||
Debug::log(LOG, "Attempted to lock a locked session!");
|
||||
wlr_session_lock_v1_destroy(pWlrLock);
|
||||
return;
|
||||
@@ -113,6 +115,8 @@ void CSessionLockManager::onNewSessionLock(wlr_session_lock_v1* pWlrLock) {
|
||||
|
||||
g_pCompositor->focusSurface(nullptr);
|
||||
|
||||
m_sSessionLock.pWlrLock = nullptr;
|
||||
|
||||
for (auto& m : g_pCompositor->m_vMonitors)
|
||||
g_pHyprRenderer->damageMonitor(m.get());
|
||||
},
|
||||
|
Reference in New Issue
Block a user