RatbagdResolution: clamp values instead of returning an error
We cannot return error codes, but requesting a resync is overkill.
Instead, let's be nice and clamp these values.
@@ -282,8 +282,10 @@ ratbagd_resolution_set_report_rate(sd_bus *bus,
return r;
/* basic sanity check */
- if (rate > 5000 || rate % 100)
- return 0;
+ if (rate > 5000)
+ rate = 5000;
+ else if (rate % 100)
+ rate = rate - (rate % 100);
r = ratbag_resolution_set_report_rate(resolution->lib_resolution,
rate);
