diff options
author | Vaxry <[email protected]> | 2024-09-30 17:40:38 +0100 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-09-30 17:40:38 +0100 |
commit | 6bd339714160505ab1c4aade659eca6fe426fea5 (patch) | |
tree | ce23251db479fa8ae45b9f188645db8c83404194 | |
parent | 68fd32c81013541f237e2046779185b41db1538e (diff) | |
download | Hyprland-6bd339714160505ab1c4aade659eca6fe426fea5.tar.gz Hyprland-6bd339714160505ab1c4aade659eca6fe426fea5.zip |
wlr-output-management: accept 0 refresh rates
fixes #7879
-rw-r--r-- | src/protocols/OutputManagement.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/protocols/OutputManagement.cpp b/src/protocols/OutputManagement.cpp index dcc7a62d..3fd0cf6c 100644 --- a/src/protocols/OutputManagement.cpp +++ b/src/protocols/OutputManagement.cpp @@ -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}; |