[gnome-flashback] gpu-xrandr: gracefully handle 0.0 refresh rate
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback] gpu-xrandr: gracefully handle 0.0 refresh rate
- Date: Sat, 13 Aug 2022 20:32:07 +0000 (UTC)
commit 005b4d06b977a87956c13f2060c317a730acc30c
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sat Aug 13 14:18:15 2022 +0300
gpu-xrandr: gracefully handle 0.0 refresh rate
Based on mutter commit:
https://gitlab.gnome.org/GNOME/mutter/-/commit/16af2e407b49cd4464935a6f9b4efdc32f1339e5
backends/gf-gpu-xrandr.c | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/backends/gf-gpu-xrandr.c b/backends/gf-gpu-xrandr.c
index a4a0e61..f0e8c62 100644
--- a/backends/gf-gpu-xrandr.c
+++ b/backends/gf-gpu-xrandr.c
@@ -82,6 +82,9 @@ calculate_refresh_rate (XRRModeInfo *xmode)
h_total = (float) xmode->hTotal;
v_total = (float) xmode->vTotal;
+ if (h_total == 0.0f || v_total == 0.0f)
+ return 0.0;
+
if (xmode->modeFlags & RR_DoubleScan)
v_total *= 2.0f;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]