mirror of
https://github.com/hyprwm/Hyprland
synced 2025-01-10 17:09:49 +01:00
parent
1989b0049f
commit
aff34089c4
1 changed files with 12 additions and 6 deletions
|
@ -480,10 +480,12 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// if the best mode isnt close to requested, then try requested as custom mode first
|
// if the best mode isnt close to requested, then try requested as custom mode first
|
||||||
|
if (!requestedModes.empty()) {
|
||||||
auto bestMode = requestedModes.back();
|
auto bestMode = requestedModes.back();
|
||||||
if (!DELTALESSTHAN(bestMode->pixelSize.x, RULE->resolution.x, 1) || !DELTALESSTHAN(bestMode->pixelSize.y, RULE->resolution.y, 1) ||
|
if (!DELTALESSTHAN(bestMode->pixelSize.x, RULE->resolution.x, 1) || !DELTALESSTHAN(bestMode->pixelSize.y, RULE->resolution.y, 1) ||
|
||||||
!DELTALESSTHAN(bestMode->refreshRate / 1000.f, RULE->refreshRate, 1))
|
!DELTALESSTHAN(bestMode->refreshRate / 1000.f, RULE->refreshRate, 1))
|
||||||
requestedModes.push_back(makeShared<Aquamarine::SOutputMode>(Aquamarine::SOutputMode{.pixelSize = RULE->resolution, .refreshRate = RULE->refreshRate * 1000.f}));
|
requestedModes.push_back(makeShared<Aquamarine::SOutputMode>(Aquamarine::SOutputMode{.pixelSize = RULE->resolution, .refreshRate = RULE->refreshRate * 1000.f}));
|
||||||
|
}
|
||||||
|
|
||||||
// then if requested is custom, try custom mode first
|
// then if requested is custom, try custom mode first
|
||||||
if (RULE->drmMode.type == DRM_MODE_TYPE_USERDEF) {
|
if (RULE->drmMode.type == DRM_MODE_TYPE_USERDEF) {
|
||||||
|
@ -510,10 +512,14 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) {
|
||||||
|
|
||||||
if (Debug::trace) {
|
if (Debug::trace) {
|
||||||
Debug::log(TRACE, "Monitor {} requested modes:", szName);
|
Debug::log(TRACE, "Monitor {} requested modes:", szName);
|
||||||
|
if (requestedModes.empty())
|
||||||
|
Debug::log(TRACE, "| None");
|
||||||
|
else {
|
||||||
for (auto const& mode : requestedModes | std::views::reverse) {
|
for (auto const& mode : requestedModes | std::views::reverse) {
|
||||||
Debug::log(TRACE, "| {:X0}@{:.2f}Hz", mode->pixelSize, mode->refreshRate / 1000.f);
|
Debug::log(TRACE, "| {:X0}@{:.2f}Hz", mode->pixelSize, mode->refreshRate / 1000.f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (auto const& mode : requestedModes | std::views::reverse) {
|
for (auto const& mode : requestedModes | std::views::reverse) {
|
||||||
std::string modeStr = std::format("{:X0}@{:.2f}Hz", mode->pixelSize, mode->refreshRate / 1000.f);
|
std::string modeStr = std::format("{:X0}@{:.2f}Hz", mode->pixelSize, mode->refreshRate / 1000.f);
|
||||||
|
|
Loading…
Reference in a new issue