Skip to content

Commit

Permalink
wlr-output-management: accept 0 refresh rates
Browse files Browse the repository at this point in the history
fixes #7879
  • Loading branch information
vaxerski committed Sep 30, 2024
1 parent 68fd32c commit 6bd3397
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/protocols/OutputManagement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,11 +467,16 @@ COutputConfigurationHead::COutputConfigurationHead(SP<CZwlrOutputConfigurationHe
return;
}

if (w <= 0 || h <= 0 || refresh <= 100) {
if (w <= 0 || h <= 0 || refresh < 0) {
resource->error(ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_ERROR_INVALID_CUSTOM_MODE, "Invalid mode");
return;
}

if (refresh == 0) {
LOGM(LOG, " | configHead for {}: refreshRate 0, using old refresh rate of {:.2f}Hz", pMonitor->szName, pMonitor->refreshRate);
refresh = std::round(pMonitor->refreshRate * 1000.F);
}

state.committedProperties |= OUTPUT_HEAD_COMMITTED_CUSTOM_MODE;
state.customMode = {{w, h}, (uint32_t)refresh};

Expand Down

0 comments on commit 6bd3397

Please sign in to comment.