[gnome-flashback] monitor-config-store: only save 3 decimal places of <rate>



commit 451a5fc52d8b62027713671f9aa54b0cc8c07d73
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Aug 19 21:46:10 2022 +0300

    monitor-config-store: only save 3 decimal places of <rate>
    
    Based on mutter commit:
    https://gitlab.gnome.org/GNOME/mutter/-/commit/8711d4499162ed7f18718c577bf03c4a19592367
    https://gitlab.gnome.org/GNOME/mutter/-/commit/cc729def9066aec0d3c5e8b267e7ae81eccde16f

 backends/gf-monitor-config-store.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/backends/gf-monitor-config-store.c b/backends/gf-monitor-config-store.c
index 2bb0aa5..e377b67 100644
--- a/backends/gf-monitor-config-store.c
+++ b/backends/gf-monitor-config-store.c
@@ -1602,12 +1602,15 @@ append_monitors (GString *buffer,
     {
       GfMonitorConfig *monitor_config;
       GfMonitorModeSpec *mode_spec;
-      gchar rate_str[G_ASCII_DTOSTR_BUF_SIZE];
+      char rate_str[G_ASCII_DTOSTR_BUF_SIZE];
 
       monitor_config = l->data;
       mode_spec = monitor_config->mode_spec;
 
-      g_ascii_dtostr (rate_str, sizeof (rate_str), mode_spec->refresh_rate);
+      g_ascii_formatd (rate_str,
+                       sizeof (rate_str),
+                       "%.3f",
+                       mode_spec->refresh_rate);
 
       g_string_append (buffer, "      <monitor>\n");
       append_monitor_spec (buffer, monitor_config->monitor_spec, "        ");


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