[mutter] input-settings/x11: Only warn once about missing udev support



commit 1ca60f424af84382365dcb4550538a6f2012b921
Author: Antoine Jacoutot <ajacoutot gnome org>
Date:   Tue Jan 22 02:20:49 2019 +0100

    input-settings/x11: Only warn once about missing udev support
    
    Otherwise we end up logging the same message everytime we enter this function,
    flooding the logs and making it annoying to spot other entries.

 src/backends/x11/meta-input-settings-x11.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/backends/x11/meta-input-settings-x11.c b/src/backends/x11/meta-input-settings-x11.c
index 2968ac859..5b6087df3 100644
--- a/src/backends/x11/meta-input-settings-x11.c
+++ b/src/backends/x11/meta-input-settings-x11.c
@@ -488,7 +488,14 @@ has_udev_property (MetaInputSettings  *settings,
   g_object_unref (parent_udev_device);
   return FALSE;
 #else
-  g_warning ("Failed to set acceleration profile: no udev support");
+  static gboolean warned_once = FALSE;
+
+  if (!warned_once)
+    {
+      g_warning ("Failed to set acceleration profile: no udev support");
+      warned_once = TRUE;
+    }
+
   return FALSE;
 #endif
 }


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