From 9940580fbd21065b0c68b29c569c105ed37aaa02 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Sat, 13 Jun 2026 09:47:09 +0200 Subject: [PATCH] Don't forward 0 refresh rate to headset --- server/compositor/compositor.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/server/compositor/compositor.cpp b/server/compositor/compositor.cpp index 67372562..cfa487a1 100644 --- a/server/compositor/compositor.cpp +++ b/server/compositor/compositor.cpp @@ -558,15 +558,18 @@ xrt_result_t compositor::get_display_refresh_rate(float * hz) xrt_result_t compositor::request_display_refresh_rate(float hz) { - try + requested_refresh_rate = hz; + U_LOG_I("request refresh rate: %fHz", hz); + if (hz > 0) { - requested_refresh_rate = hz; - U_LOG_I("request refresh rate: %fHz", hz); - session.send_control(to_headset::refresh_rate_change{.hz = hz}); - } - catch (std::exception & e) - { - U_LOG_W("refresh rate change failed: %s", e.what()); + try + { + session.send_control(to_headset::refresh_rate_change{.hz = hz}); + } + catch (std::exception & e) + { + U_LOG_W("refresh rate change failed: %s", e.what()); + } } return XRT_SUCCESS; }