monitors: auto apply suggested scale and notify the user. (#11753)
This commit is contained in:
parent
8832607574
commit
6a88f2e880
3 changed files with 14 additions and 5 deletions
|
|
@ -1327,6 +1327,12 @@ inline static const std::vector<SConfigOptionDescription> CONFIG_OPTIONS = {
|
||||||
.type = CONFIG_OPTION_BOOL,
|
.type = CONFIG_OPTION_BOOL,
|
||||||
.data = SConfigOptionDescription::SBoolData{true},
|
.data = SConfigOptionDescription::SBoolData{true},
|
||||||
},
|
},
|
||||||
|
SConfigOptionDescription{
|
||||||
|
.value = "misc:disable_scale_notification",
|
||||||
|
.description = "disables notification popup when a monitor fails to set a suitable scale and falls back to suggested",
|
||||||
|
.type = CONFIG_OPTION_BOOL,
|
||||||
|
.data = SConfigOptionDescription::SBoolData{false},
|
||||||
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* binds:
|
* binds:
|
||||||
|
|
|
||||||
|
|
@ -522,6 +522,7 @@ CConfigManager::CConfigManager() {
|
||||||
registerConfigVar("misc:enable_anr_dialog", Hyprlang::INT{1});
|
registerConfigVar("misc:enable_anr_dialog", Hyprlang::INT{1});
|
||||||
registerConfigVar("misc:anr_missed_pings", Hyprlang::INT{1});
|
registerConfigVar("misc:anr_missed_pings", Hyprlang::INT{1});
|
||||||
registerConfigVar("misc:screencopy_force_8b", Hyprlang::INT{1});
|
registerConfigVar("misc:screencopy_force_8b", Hyprlang::INT{1});
|
||||||
|
registerConfigVar("misc:disable_scale_notification", Hyprlang::INT{0});
|
||||||
|
|
||||||
registerConfigVar("group:insert_after_current", Hyprlang::INT{1});
|
registerConfigVar("group:insert_after_current", Hyprlang::INT{1});
|
||||||
registerConfigVar("group:focus_removed_window", Hyprlang::INT{1});
|
registerConfigVar("group:focus_removed_window", Hyprlang::INT{1});
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#include "Monitor.hpp"
|
#include "Monitor.hpp"
|
||||||
#include "MiscFunctions.hpp"
|
#include "MiscFunctions.hpp"
|
||||||
#include "../macros.hpp"
|
#include "../macros.hpp"
|
||||||
|
#include "SharedDefs.hpp"
|
||||||
#include "math/Math.hpp"
|
#include "math/Math.hpp"
|
||||||
#include "../protocols/ColorManagement.hpp"
|
#include "../protocols/ColorManagement.hpp"
|
||||||
#include "../Compositor.hpp"
|
#include "../Compositor.hpp"
|
||||||
|
|
@ -907,11 +908,12 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) {
|
||||||
} else {
|
} else {
|
||||||
if (!autoScale) {
|
if (!autoScale) {
|
||||||
Debug::log(ERR, "Invalid scale passed to monitor, {} found suggestion {}", m_scale, searchScale);
|
Debug::log(ERR, "Invalid scale passed to monitor, {} found suggestion {}", m_scale, searchScale);
|
||||||
g_pConfigManager->addParseError(
|
static auto PDISABLENOTIFICATION = CConfigValue<Hyprlang::INT>("misc:disable_scale_notification");
|
||||||
std::format("Invalid scale passed to monitor {}, failed to find a clean divisor. Suggested nearest scale: {:5f}", m_name, searchScale));
|
if (!*PDISABLENOTIFICATION)
|
||||||
m_scale = getDefaultScale();
|
g_pHyprNotificationOverlay->addNotification(std::format("Invalid scale passed to monitor: {}, using suggested scale: {}", m_scale, searchScale),
|
||||||
} else
|
CHyprColor(1.0, 0.0, 0.0, 1.0), 5000, ICON_WARNING);
|
||||||
m_scale = searchScale;
|
}
|
||||||
|
m_scale = searchScale;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue