From e5fa017172156fa5c70fedeaee5f51eace9577c0 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Wed, 20 Nov 2024 10:32:50 +0000 Subject: internal: fix some misused configStringToInt conversions fixes #8523 --- src/desktop/Window.cpp | 2 +- src/desktop/Workspace.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/desktop') diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp index 33e6a5f8..117d301c 100644 --- a/src/desktop/Window.cpp +++ b/src/desktop/Window.cpp @@ -707,7 +707,7 @@ void CWindow::applyDynamicRule(const SWindowRule& r) { *(search->second(m_pSelf.lock())) = CWindowOverridableVar(true, priority); } else { try { - *(search->second(m_pSelf.lock())) = CWindowOverridableVar((bool)configStringToInt(VARS[1]), priority); + *(search->second(m_pSelf.lock())) = CWindowOverridableVar((bool)configStringToInt(VARS[1]).value_or(0), priority); } catch (...) {} } } else if (auto search = g_pConfigManager->miWindowProperties.find(VARS[0]); search != g_pConfigManager->miWindowProperties.end()) { diff --git a/src/desktop/Workspace.cpp b/src/desktop/Workspace.cpp index 2e1e91f2..8cddbb6b 100644 --- a/src/desktop/Workspace.cpp +++ b/src/desktop/Workspace.cpp @@ -332,7 +332,7 @@ bool CWorkspace::matchesStaticSelector(const std::string& selector_) { const auto SHOULDBESPECIAL = configStringToInt(prop); - if ((bool)SHOULDBESPECIAL != m_bIsSpecialWorkspace) + if (SHOULDBESPECIAL && (bool)*SHOULDBESPECIAL != m_bIsSpecialWorkspace) return false; continue; } @@ -367,7 +367,7 @@ bool CWorkspace::matchesStaticSelector(const std::string& selector_) { const auto WANTSNAMED = configStringToInt(prop); - if (WANTSNAMED != (m_iID <= -1337)) + if (WANTSNAMED && *WANTSNAMED != (m_iID <= -1337)) return false; continue; } -- cgit v1.2.3