[mutter] monitor: Generate mode IDs with 3 decimal places for Hz



commit f6e24c629333aa7aa6a792047043e60178c4be4a
Author: Daniel van Vugt <daniel van vugt canonical com>
Date:   Wed Jun 15 18:16:46 2022 +0800

    monitor: Generate mode IDs with 3 decimal places for Hz
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2465>

 src/backends/meta-monitor.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c
index a3d84d440a..b7abd9b4b6 100644
--- a/src/backends/meta-monitor.c
+++ b/src/backends/meta-monitor.c
@@ -540,17 +540,14 @@ static char *
 generate_mode_id (MetaMonitorModeSpec *monitor_mode_spec)
 {
   gboolean is_interlaced;
-  char refresh_rate_str[G_ASCII_DTOSTR_BUF_SIZE];
 
   is_interlaced = !!(monitor_mode_spec->flags & META_CRTC_MODE_FLAG_INTERLACE);
-  g_ascii_dtostr (refresh_rate_str, G_ASCII_DTOSTR_BUF_SIZE,
-                  monitor_mode_spec->refresh_rate);
 
-  return g_strdup_printf ("%dx%d%s@%s",
+  return g_strdup_printf ("%dx%d%s@%.3f",
                           monitor_mode_spec->width,
                           monitor_mode_spec->height,
                           is_interlaced ? "i" : "",
-                          refresh_rate_str);
+                          monitor_mode_spec->refresh_rate);
 }
 
 static gboolean


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