mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-12-29 18:53:19 +03:00
lock: add allow_session_lock_restore
This commit is contained in:
parent
cc01550aff
commit
896a78aaa0
@ -93,6 +93,7 @@ void CConfigManager::setDefaultVars() {
|
|||||||
configValues["misc:render_ahead_safezone"].intValue = 1;
|
configValues["misc:render_ahead_safezone"].intValue = 1;
|
||||||
configValues["misc:cursor_zoom_factor"].floatValue = 1.f;
|
configValues["misc:cursor_zoom_factor"].floatValue = 1.f;
|
||||||
configValues["misc:cursor_zoom_rigid"].intValue = 0;
|
configValues["misc:cursor_zoom_rigid"].intValue = 0;
|
||||||
|
configValues["misc:allow_session_lock_restore"].intValue = 0;
|
||||||
|
|
||||||
configValues["debug:int"].intValue = 0;
|
configValues["debug:int"].intValue = 0;
|
||||||
configValues["debug:log_damage"].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) {
|
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!");
|
Debug::log(LOG, "Attempted to lock a locked session!");
|
||||||
wlr_session_lock_v1_destroy(pWlrLock);
|
wlr_session_lock_v1_destroy(pWlrLock);
|
||||||
return;
|
return;
|
||||||
@ -113,6 +115,8 @@ void CSessionLockManager::onNewSessionLock(wlr_session_lock_v1* pWlrLock) {
|
|||||||
|
|
||||||
g_pCompositor->focusSurface(nullptr);
|
g_pCompositor->focusSurface(nullptr);
|
||||||
|
|
||||||
|
m_sSessionLock.pWlrLock = nullptr;
|
||||||
|
|
||||||
for (auto& m : g_pCompositor->m_vMonitors)
|
for (auto& m : g_pCompositor->m_vMonitors)
|
||||||
g_pHyprRenderer->damageMonitor(m.get());
|
g_pHyprRenderer->damageMonitor(m.get());
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user