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

@ -146,17 +146,18 @@ void CConfigManager::setDefaultVars() {
((CGradientValueData*)configValues["group:groupbar:col.locked_active"].data.get())->reset(0x66ff5500); ((CGradientValueData*)configValues["group:groupbar:col.locked_active"].data.get())->reset(0x66ff5500);
((CGradientValueData*)configValues["group:groupbar:col.locked_inactive"].data.get())->reset(0x66775500); ((CGradientValueData*)configValues["group:groupbar:col.locked_inactive"].data.get())->reset(0x66775500);
configValues["debug:int"].intValue = 0; configValues["debug:int"].intValue = 0;
configValues["debug:log_damage"].intValue = 0; configValues["debug:log_damage"].intValue = 0;
configValues["debug:overlay"].intValue = 0; configValues["debug:overlay"].intValue = 0;
configValues["debug:damage_blink"].intValue = 0; configValues["debug:damage_blink"].intValue = 0;
configValues["debug:disable_logs"].intValue = 1; configValues["debug:disable_logs"].intValue = 1;
configValues["debug:disable_time"].intValue = 1; configValues["debug:disable_time"].intValue = 1;
configValues["debug:enable_stdout_logs"].intValue = 0; configValues["debug:enable_stdout_logs"].intValue = 0;
configValues["debug:damage_tracking"].intValue = DAMAGE_TRACKING_FULL; configValues["debug:damage_tracking"].intValue = DAMAGE_TRACKING_FULL;
configValues["debug:manual_crash"].intValue = 0; configValues["debug:manual_crash"].intValue = 0;
configValues["debug:suppress_errors"].intValue = 0; configValues["debug:suppress_errors"].intValue = 0;
configValues["debug:watchdog_timeout"].intValue = 5; configValues["debug:watchdog_timeout"].intValue = 5;
configValues["debug:disable_scale_checks"].intValue = 0;
configValues["decoration:rounding"].intValue = 0; configValues["decoration:rounding"].intValue = 0;
configValues["decoration:blur:enabled"].intValue = 1; 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) { 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); Debug::log(LOG, "Applying monitor rule for {}", pMonitor->szName);
pMonitor->activeMonitorRule = *pMonitorRule; pMonitor->activeMonitorRule = *pMonitorRule;
@ -1944,7 +1946,7 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR
pMonitor->vecPixelSize = pMonitor->vecSize; pMonitor->vecPixelSize = pMonitor->vecSize;
Vector2D logicalSize = pMonitor->vecPixelSize / pMonitor->scale; 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. // invalid scale, will produce fractional pixels.
// find the nearest valid. // find the nearest valid.