[gnome-flashback] monitor: generate mode IDs with 3 decimal places for Hz



commit 7adc6253e0063d4e95a6a156c515c7b0f75624f8
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Aug 19 21:43:15 2022 +0300

    monitor: generate mode IDs with 3 decimal places for Hz
    
    Based on mutter commit:
    https://gitlab.gnome.org/GNOME/mutter/-/commit/f6e24c629333aa7aa6a792047043e60178c4be4a

 backends/gf-monitor.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/backends/gf-monitor.c b/backends/gf-monitor.c
index 0edfca6..7b1c374 100644
--- a/backends/gf-monitor.c
+++ b/backends/gf-monitor.c
@@ -715,13 +715,14 @@ gchar *
 gf_monitor_mode_spec_generate_id (GfMonitorModeSpec *spec)
 {
   gboolean is_interlaced;
-  gchar refresh_rate[G_ASCII_DTOSTR_BUF_SIZE];
 
   is_interlaced = !!(spec->flags & GF_CRTC_MODE_FLAG_INTERLACE);
-  g_ascii_dtostr (refresh_rate, G_ASCII_DTOSTR_BUF_SIZE, spec->refresh_rate);
 
-  return g_strdup_printf ("%dx%d%s@%s", spec->width, spec->height,
-                          is_interlaced ? "i" : "", refresh_rate);
+  return g_strdup_printf ("%dx%d%s@%.3f",
+                          spec->width,
+                          spec->height,
+                          is_interlaced ? "i" : "",
+                          (double) spec->refresh_rate);
 }
 
 GfMonitorSpec *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]