mirror of
https://github.com/hyprwm/Hyprland
synced 2025-02-17 01:02:51 +01:00
parent
b5b025a1ed
commit
46997a7643
1 changed files with 16 additions and 7 deletions
|
@ -1747,10 +1747,12 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR
|
||||||
|
|
||||||
// Needed in case we are switching from a custom modeline to a standard mode
|
// Needed in case we are switching from a custom modeline to a standard mode
|
||||||
pMonitor->customDrmMode = {};
|
pMonitor->customDrmMode = {};
|
||||||
|
bool autoScale = false;
|
||||||
|
|
||||||
if (pMonitorRule->scale > 0.1) {
|
if (pMonitorRule->scale > 0.1) {
|
||||||
pMonitor->scale = pMonitorRule->scale;
|
pMonitor->scale = pMonitorRule->scale;
|
||||||
} else {
|
} else {
|
||||||
|
autoScale = true;
|
||||||
const auto DEFAULTSCALE = pMonitor->getDefaultScale();
|
const auto DEFAULTSCALE = pMonitor->getDefaultScale();
|
||||||
pMonitor->scale = DEFAULTSCALE;
|
pMonitor->scale = DEFAULTSCALE;
|
||||||
}
|
}
|
||||||
|
@ -2008,15 +2010,22 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
Debug::log(ERR, "Invalid scale passed to monitor, {} failed to find a clean divisor", pMonitor->scale);
|
if (autoScale)
|
||||||
g_pConfigManager->addParseError("Invalid scale passed to monitor " + pMonitor->szName + ", failed to find a clean divisor");
|
pMonitor->scale = std::round(scaleZero);
|
||||||
|
else {
|
||||||
|
Debug::log(ERR, "Invalid scale passed to monitor, {} failed to find a clean divisor", pMonitor->scale);
|
||||||
|
g_pConfigManager->addParseError("Invalid scale passed to monitor " + pMonitor->szName + ", failed to find a clean divisor");
|
||||||
|
pMonitor->scale = pMonitor->getDefaultScale();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Debug::log(ERR, "Invalid scale passed to monitor, {} found suggestion {}", pMonitor->scale, searchScale);
|
if (!autoScale) {
|
||||||
g_pConfigManager->addParseError(
|
Debug::log(ERR, "Invalid scale passed to monitor, {} found suggestion {}", pMonitor->scale, searchScale);
|
||||||
std::format("Invalid scale passed to monitor {}, failed to find a clean divisor. Suggested nearest scale: {:5f}", pMonitor->szName, searchScale));
|
g_pConfigManager->addParseError(
|
||||||
|
std::format("Invalid scale passed to monitor {}, failed to find a clean divisor. Suggested nearest scale: {:5f}", pMonitor->szName, searchScale));
|
||||||
|
pMonitor->scale = pMonitor->getDefaultScale();
|
||||||
|
} else
|
||||||
|
pMonitor->scale = searchScale;
|
||||||
}
|
}
|
||||||
|
|
||||||
pMonitor->scale = pMonitor->getDefaultScale();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue