mirror of
https://github.com/brl/mutter.git
synced 2025-01-27 11:59:12 +00:00
gpu/xrandr: Gracefully handle 0.0 refresh rate
We don't make use of the refresh rate in any useful way in the X11, and in this case we just ended up with warnings since the refresh rate was NaN. Fix this by making it 0.0 to mean "no refresh rate". This also is what 'xrandr' itself reports. Fixes warnings when launching 'mutter --x11' in Xvfb. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2434>
This commit is contained in:
parent
e7a8173f3a
commit
16af2e407b
@ -95,6 +95,9 @@ calculate_xrandr_refresh_rate (XRRModeInfo *xmode)
|
||||
h_total = (float) xmode->hTotal;
|
||||
v_total = (float) xmode->vTotal;
|
||||
|
||||
if (h_total == 0.0 || v_total == 0.0)
|
||||
return 0.0;
|
||||
|
||||
if (xmode->modeFlags & RR_DoubleScan)
|
||||
v_total *= 2.0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user