From 5ba33f846129f3e6c0505b19f94634b24505e828 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sun, 26 Apr 2026 15:16:36 +0100 Subject: config/lua: init lua config manager, use lua if available (#13817) Adds a new lua config manager, which will automatically be used if there is a lua config present. --- src/helpers/Monitor.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/helpers/Monitor.cpp') diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index b65cb575..44e06765 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -65,7 +65,7 @@ using namespace Monitor; CMonitor::CMonitor(SP output_) : m_state(this), m_output(output_), m_imageDescription(getDefaultImageDescription()) { g_pAnimationManager->createAnimation(0.f, m_specialFade, Config::animationTree()->getAnimationPropertyConfig("specialWorkspaceIn"), AVARDAMAGE_NONE); m_specialFade->setUpdateCallback([this](auto) { g_pHyprRenderer->damageMonitor(m_self.lock()); }); - static auto PZOOMFACTOR = CConfigValue("cursor:zoom_factor"); + static auto PZOOMFACTOR = CConfigValue("cursor:zoom_factor"); g_pAnimationManager->createAnimation(*PZOOMFACTOR, m_cursorZoom, Config::animationTree()->getAnimationPropertyConfig("zoomFactor"), AVARDAMAGE_NONE); m_cursorZoom->setUpdateCallback([this](auto) { g_pHyprRenderer->damageMonitor(m_self.lock()); }); g_pAnimationManager->createAnimation(0.F, m_zoomAnimProgress, Config::animationTree()->getAnimationPropertyConfig("monitorAdded"), AVARDAMAGE_NONE); @@ -625,7 +625,7 @@ void CMonitor::applyCMType(NCMType::eCMType cmType, NTransferFunction::eTF cmSdr bool CMonitor::applyMonitorRule(Config::CMonitorRule&& pMonitorRule, bool force) { - static auto PDISABLESCALECHECKS = CConfigValue("debug:disable_scale_checks"); + static auto PDISABLESCALECHECKS = CConfigValue("debug:disable_scale_checks"); Log::logger->log(Log::DEBUG, "Applying monitor rule for {}", m_name); @@ -1036,7 +1036,7 @@ bool CMonitor::applyMonitorRule(Config::CMonitorRule&& pMonitorRule, bool force) } else { if (!autoScale) { Log::logger->log(Log::ERR, "Invalid scale passed to monitor, {} found suggestion {}", m_scale, searchScale); - static auto PDISABLENOTIFICATION = CConfigValue("misc:disable_scale_notification"); + static auto PDISABLENOTIFICATION = CConfigValue("misc:disable_scale_notification"); if (!*PDISABLENOTIFICATION) { Notification::overlay()->addNotification( I18n::i18nEngine()->localize(I18n::TXT_KEY_NOTIF_MONITOR_AUTO_SCALE, @@ -1127,8 +1127,8 @@ void CMonitor::addDamage(const CBox& box) { } bool CMonitor::shouldSkipScheduleFrameOnMouseEvent() { - static auto PNOBREAK = CConfigValue("cursor:no_break_fs_vrr"); - static auto PMINRR = CConfigValue("cursor:min_refresh_rate"); + static auto PNOBREAK = CConfigValue("cursor:no_break_fs_vrr"); + static auto PMINRR = CConfigValue("cursor:min_refresh_rate"); // skip scheduling extra frames for fullsreen apps with vrr const auto FS_WINDOW = getFullscreenWindow(); @@ -1336,7 +1336,7 @@ float CMonitor::getDefaultScale() { } static bool shouldWraparound(const WORKSPACEID id1, const WORKSPACEID id2) { - static auto PWORKSPACEWRAPAROUND = CConfigValue("animations:workspace_wraparound"); + static auto PWORKSPACEWRAPAROUND = CConfigValue("animations:workspace_wraparound"); if (!*PWORKSPACEWRAPAROUND) return false; @@ -1394,7 +1394,7 @@ void CMonitor::changeWorkspace(const PHLWORKSPACE& pWorkspace, bool internal, bo if (!noFocus && !Desktop::focusState()->monitor()->m_activeSpecialWorkspace && !(Desktop::focusState()->window() && Desktop::focusState()->window()->m_pinned && Desktop::focusState()->window()->m_monitor == m_self)) { - static auto PFOLLOWMOUSE = CConfigValue("input:follow_mouse"); + static auto PFOLLOWMOUSE = CConfigValue("input:follow_mouse"); auto pWindow = pWorkspace->m_hasFullscreenWindow ? pWorkspace->getFullscreenWindow() : pWorkspace->getLastFocusedWindow(); if (!pWindow) { @@ -1797,7 +1797,7 @@ void CMonitor::recheckSolitary() { uint8_t CMonitor::isTearingBlocked(bool full) { uint8_t reasons = 0; - static auto PTEARINGENABLED = CConfigValue("general:allow_tearing"); + static auto PTEARINGENABLED = CConfigValue("general:allow_tearing"); if (!m_tearingState.nextRenderTorn) { reasons |= TC_NOT_TORN; @@ -1852,8 +1852,8 @@ bool CMonitor::updateTearing() { uint16_t CMonitor::isDSBlocked(bool full) { uint16_t reasons = 0; - static auto PDIRECTSCANOUT = CConfigValue("render:direct_scanout"); - static auto PNONSHADER = CConfigValue("render:non_shader_cm"); + static auto PDIRECTSCANOUT = CConfigValue("render:direct_scanout"); + static auto PNONSHADER = CConfigValue("render:non_shader_cm"); const auto PWORKSPACE = m_activeWorkspace; // Fast reject for the hot render path; full=true callers still collect @@ -1942,8 +1942,8 @@ uint16_t CMonitor::isDSBlocked(bool full) { } bool CMonitor::attemptDirectScanout() { - static const auto PSAME = CConfigValue("debug:ds_handle_same_buffer"); - static const auto PSAMEFIFO = CConfigValue("debug:ds_handle_same_buffer_fifo"); + static const auto PSAME = CConfigValue("debug:ds_handle_same_buffer"); + static const auto PSAMEFIFO = CConfigValue("debug:ds_handle_same_buffer_fifo"); const auto blockedReason = isDSBlocked(); if (blockedReason) @@ -2096,8 +2096,8 @@ bool CMonitor::isMultiGPU() { } bool CMonitor::shouldUseSoftwareCursors() { - static auto PNOHW = CConfigValue("cursor:no_hardware_cursors"); - static auto PINVISIBLE = CConfigValue("cursor:invisible"); + static auto PNOHW = CConfigValue("cursor:no_hardware_cursors"); + static auto PINVISIBLE = CConfigValue("cursor:invisible"); if (m_tearingState.activelyTearing) return true; @@ -2305,7 +2305,7 @@ NColorManagement::SImageDescription::SPCMasteringLuminances CMonitor::getMasteri } uint32_t CMonitor::getPreferredReadFormat() { - static const auto PFORCE8BIT = CConfigValue("misc:screencopy_force_8b"); + static const auto PFORCE8BIT = CConfigValue("misc:screencopy_force_8b"); auto monFmt = m_output->state->state().drmFormat; @@ -2336,7 +2336,7 @@ static bool isCompatibleTF(eTransferFunction sourceTF, eTransferFunction targetT // TODO support more drm properties bool CMonitor::canNoShaderCM(bool forDSmode) { - static auto PNONSHADER = CConfigValue("render:non_shader_cm"); + static auto PNONSHADER = CConfigValue("render:non_shader_cm"); if (*PNONSHADER == CM_NS_DISABLE) return false; -- cgit v1.2.3