forked from drath/libratbag
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.
This commit is contained in:
committed by
Peter Hutterer
parent
26e7237010
commit
a2b3c32124
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user