config: add debug:disable_scale_checks

ref #4225
This commit is contained in:
Vaxry 2023-12-23 00:21:02 +01:00
parent 6b6f3396cf
commit 6c8e0f9863
2 changed files with 15 additions and 12 deletions

View file

@ -157,6 +157,7 @@ void CConfigManager::setDefaultVars() {
configValues["debug:manual_crash"].intValue = 0;
configValues["debug:suppress_errors"].intValue = 0;
configValues["debug:watchdog_timeout"].intValue = 5;
configValues["debug:disable_scale_checks"].intValue = 0;
configValues["decoration:rounding"].intValue = 0;
configValues["decoration:blur:enabled"].intValue = 1;

View file

@ -1679,6 +1679,8 @@ DAMAGETRACKINGMODES CHyprRenderer::damageTrackingModeFromStr(const std::string&
bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorRule, bool force) {
static auto* const PDISABLESCALECHECKS = &g_pConfigManager->getConfigValuePtr("debug:disable_scale_checks")->intValue;
Debug::log(LOG, "Applying monitor rule for {}", pMonitor->szName);
pMonitor->activeMonitorRule = *pMonitorRule;
@ -1944,7 +1946,7 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR
pMonitor->vecPixelSize = pMonitor->vecSize;
Vector2D logicalSize = pMonitor->vecPixelSize / pMonitor->scale;
if (logicalSize.x != std::round(logicalSize.x) || logicalSize.y != std::round(logicalSize.y)) {
if (!*PDISABLESCALECHECKS && (logicalSize.x != std::round(logicalSize.x) || logicalSize.y != std::round(logicalSize.y))) {
// invalid scale, will produce fractional pixels.
// find the nearest valid.