From 6a88f2e8800d4540ecbbb0d5b3d7f85a05387300 Mon Sep 17 00:00:00 2001 From: ItsOhen Date: Sat, 20 Sep 2025 17:42:02 +0200 Subject: monitors: auto apply suggested scale and notify the user. (#11753) --- src/helpers/Monitor.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/helpers/Monitor.cpp') diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index 1c08faff..c7e94fa5 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -1,6 +1,7 @@ #include "Monitor.hpp" #include "MiscFunctions.hpp" #include "../macros.hpp" +#include "SharedDefs.hpp" #include "math/Math.hpp" #include "../protocols/ColorManagement.hpp" #include "../Compositor.hpp" @@ -907,11 +908,12 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) { } else { if (!autoScale) { Debug::log(ERR, "Invalid scale passed to monitor, {} found suggestion {}", m_scale, searchScale); - g_pConfigManager->addParseError( - std::format("Invalid scale passed to monitor {}, failed to find a clean divisor. Suggested nearest scale: {:5f}", m_name, searchScale)); - m_scale = getDefaultScale(); - } else - m_scale = searchScale; + static auto PDISABLENOTIFICATION = CConfigValue("misc:disable_scale_notification"); + if (!*PDISABLENOTIFICATION) + g_pHyprNotificationOverlay->addNotification(std::format("Invalid scale passed to monitor: {}, using suggested scale: {}", m_scale, searchScale), + CHyprColor(1.0, 0.0, 0.0, 1.0), 5000, ICON_WARNING); + } + m_scale = searchScale; } } } -- cgit v1.2.3