summaryrefslogtreecommitdiff
path: root/src/helpers/Monitor.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2026-04-26 15:16:36 +0100
committerGitHub <noreply@github.com>2026-04-26 15:16:36 +0100
commit5ba33f846129f3e6c0505b19f94634b24505e828 (patch)
treeaaacabe678006040c342935481a86607c66607fd /src/helpers/Monitor.cpp
parent329b2b356dd92ac07f4e2aa69cbce82ee9ba9d19 (diff)
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.
Diffstat (limited to 'src/helpers/Monitor.cpp')
-rw-r--r--src/helpers/Monitor.cpp32
1 files changed, 16 insertions, 16 deletions
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<Aquamarine::IOutput> 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<Hyprlang::FLOAT>("cursor:zoom_factor");
+ static auto PZOOMFACTOR = CConfigValue<Config::FLOAT>("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<Hyprlang::INT>("debug:disable_scale_checks");
+ static auto PDISABLESCALECHECKS = CConfigValue<Config::INTEGER>("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<Hyprlang::INT>("misc:disable_scale_notification");
+ static auto PDISABLENOTIFICATION = CConfigValue<Config::INTEGER>("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<Hyprlang::INT>("cursor:no_break_fs_vrr");
- static auto PMINRR = CConfigValue<Hyprlang::INT>("cursor:min_refresh_rate");
+ static auto PNOBREAK = CConfigValue<Config::INTEGER>("cursor:no_break_fs_vrr");
+ static auto PMINRR = CConfigValue<Config::INTEGER>("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<Hyprlang::INT>("animations:workspace_wraparound");
+ static auto PWORKSPACEWRAPAROUND = CConfigValue<Config::INTEGER>("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<Hyprlang::INT>("input:follow_mouse");
+ static auto PFOLLOWMOUSE = CConfigValue<Config::INTEGER>("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<Hyprlang::INT>("general:allow_tearing");
+ static auto PTEARINGENABLED = CConfigValue<Config::INTEGER>("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<Hyprlang::INT>("render:direct_scanout");
- static auto PNONSHADER = CConfigValue<Hyprlang::INT>("render:non_shader_cm");
+ static auto PDIRECTSCANOUT = CConfigValue<Config::INTEGER>("render:direct_scanout");
+ static auto PNONSHADER = CConfigValue<Config::INTEGER>("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<Hyprlang::INT>("debug:ds_handle_same_buffer");
- static const auto PSAMEFIFO = CConfigValue<Hyprlang::INT>("debug:ds_handle_same_buffer_fifo");
+ static const auto PSAME = CConfigValue<Config::INTEGER>("debug:ds_handle_same_buffer");
+ static const auto PSAMEFIFO = CConfigValue<Config::INTEGER>("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<Hyprlang::INT>("cursor:no_hardware_cursors");
- static auto PINVISIBLE = CConfigValue<Hyprlang::INT>("cursor:invisible");
+ static auto PNOHW = CConfigValue<Config::INTEGER>("cursor:no_hardware_cursors");
+ static auto PINVISIBLE = CConfigValue<Config::INTEGER>("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<Hyprlang::INT>("misc:screencopy_force_8b");
+ static const auto PFORCE8BIT = CConfigValue<Config::INTEGER>("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<Hyprlang::INT>("render:non_shader_cm");
+ static auto PNONSHADER = CConfigValue<Config::INTEGER>("render:non_shader_cm");
if (*PNONSHADER == CM_NS_DISABLE)
return false;