use static for retrieving config options

This commit is contained in:
Ching Pei Yang 2023-01-13 01:17:21 +01:00
parent a3723895ce
commit 2640dfa165
2 changed files with 12 additions and 8 deletions

View file

@ -561,7 +561,9 @@ void findExtensionForVector2D(wlr_surface* surface, int x, int y, void* data) {
CWindow* CCompositor::vectorToWindowIdeal(const Vector2D& pos) { CWindow* CCompositor::vectorToWindowIdeal(const Vector2D& pos) {
const auto PMONITOR = getMonitorFromVector(pos); const auto PMONITOR = getMonitorFromVector(pos);
const auto FOCUS_EXTENT = g_pConfigManager->getConfigValuePtr("general:resize_on_borders")->intValue ? g_pConfigManager->getConfigValuePtr("general:border_size")->intValue : 0; static auto* const PRESIZEONBORDER = &g_pConfigManager->getConfigValuePtr("general:resize_on_borders")->intValue;
static auto* const PBORDERSIZE = &g_pConfigManager->getConfigValuePtr("general:border_size")->intValue;
const auto FOCUS_EXTENT = *PRESIZEONBORDER ? *PBORDERSIZE : 0;
// special workspace // special workspace
if (PMONITOR->specialWorkspaceID) { if (PMONITOR->specialWorkspaceID) {

View file

@ -37,7 +37,9 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
static auto* const PFOLLOWONDND = &g_pConfigManager->getConfigValuePtr("misc:always_follow_on_dnd")->intValue; static auto* const PFOLLOWONDND = &g_pConfigManager->getConfigValuePtr("misc:always_follow_on_dnd")->intValue;
static auto* const PHOGFOCUS = &g_pConfigManager->getConfigValuePtr("misc:layers_hog_keyboard_focus")->intValue; static auto* const PHOGFOCUS = &g_pConfigManager->getConfigValuePtr("misc:layers_hog_keyboard_focus")->intValue;
static auto* const PFLOATBEHAVIOR = &g_pConfigManager->getConfigValuePtr("input:float_switch_override_focus")->intValue; static auto* const PFLOATBEHAVIOR = &g_pConfigManager->getConfigValuePtr("input:float_switch_override_focus")->intValue;
const auto FOCUS_EXTENT = g_pConfigManager->getConfigValuePtr("general:resize_on_borders")->intValue ? g_pConfigManager->getConfigValuePtr("general:border_size")->intValue : 0; static auto* const PRESIZEONBORDER = &g_pConfigManager->getConfigValuePtr("general:resize_on_borders")->intValue;
static auto* const PBORDERSIZE = &g_pConfigManager->getConfigValuePtr("general:border_size")->intValue;
const auto FOCUS_EXTENT = *PRESIZEONBORDER ? *PBORDERSIZE : 0;
m_pFoundSurfaceToFocus = nullptr; m_pFoundSurfaceToFocus = nullptr;
m_pFoundLSToFocus = nullptr; m_pFoundLSToFocus = nullptr;