change Preferred mode to use highest refreshrate

This commit is contained in:
Fabio Lenherr / DashieTM 2022-09-20 23:41:03 +02:00
parent 8b11a2e1b1
commit d51c7ca135

View file

@ -962,6 +962,9 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR
Debug::log(ERR, "Custom resolution FAILED, falling back to preferred"); Debug::log(ERR, "Custom resolution FAILED, falling back to preferred");
const auto PREFERREDMODE = wlr_output_preferred_mode(pMonitor->output); const auto PREFERREDMODE = wlr_output_preferred_mode(pMonitor->output);
wl_list_for_each(mode, &pMonitor->output->modes, link) {
if(mode > pMonitorRule-refreshRate)
pMonitorRule->refreshRate = mode;
if (!PREFERREDMODE) { if (!PREFERREDMODE) {
Debug::log(ERR, "Monitor %s has NO PREFERRED MODE, and an INVALID one was requested: %ix%i@%2f", Debug::log(ERR, "Monitor %s has NO PREFERRED MODE, and an INVALID one was requested: %ix%i@%2f",
@ -990,6 +993,9 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR
} }
} else { } else {
const auto PREFERREDMODE = wlr_output_preferred_mode(pMonitor->output); const auto PREFERREDMODE = wlr_output_preferred_mode(pMonitor->output);
wl_list_for_each(mode, &pMonitor->output->modes, link) {
if(mode > pMonitorRule-refreshRate)
pMonitorRule->refreshRate = mode;
if (!PREFERREDMODE) { if (!PREFERREDMODE) {
Debug::log(ERR, "Monitor %s has NO PREFERRED MODE", Debug::log(ERR, "Monitor %s has NO PREFERRED MODE",