xorg: filter out all irrelevant screen rates.

This commit is contained in:
Miroslav Šedivý 2021-02-10 18:56:20 +01:00
parent c0c14b3ac2
commit e8286dec96

View File

@ -284,6 +284,13 @@ func goCreateScreenSize(index C.int, width C.int, height C.int, mwidth C.int, mh
}
//export goSetScreenRates
func goSetScreenRates(index C.int, rate_index C.int, rate C.short) {
ScreenConfigurations[int(index)].Rates[int(rate_index)] = int16(rate)
func goSetScreenRates(index C.int, rate_index C.int, rateC C.short) {
rate := int16(rateC)
// filter out all irrelevant rates
if rate > 60 || (rate > 30 && rate % 10 != 0){
return
}
ScreenConfigurations[int(index)].Rates[int(rate_index)] = rate
}