[gnome-control-center/wip/hadess/switcheroo-renderers: 41/42] info: Remove "x11 or wayland" check



commit 24397d2fddd65cd7e95cc38331fd10127d187c5e
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Oct 28 14:08:33 2019 +0100

    info: Remove "x11 or wayland" check
    
    This check was added when Wayland support was added, so we wouldn't
    try to run an X11-only helper. The helper now supports Wayland, and
    gnome-control-center (and GNOME) only supports X11 and Wayland. In fact,
    we always want to run that code.

 panels/info-overview/cc-info-overview-panel.c | 43 ++++++++-------------------
 1 file changed, 13 insertions(+), 30 deletions(-)
---
diff --git a/panels/info-overview/cc-info-overview-panel.c b/panels/info-overview/cc-info-overview-panel.c
index 65b7d21f1..438837a96 100644
--- a/panels/info-overview/cc-info-overview-panel.c
+++ b/panels/info-overview/cc-info-overview-panel.c
@@ -304,40 +304,23 @@ has_dual_gpu (void)
 static gchar *
 get_graphics_hardware_string (void)
 {
-  GdkDisplay *display;
-
-  display = gdk_display_get_default ();
+  g_autofree char *discrete_renderer = NULL;
+  g_autofree char *renderer = NULL;
 
-#if defined(GDK_WINDOWING_X11) || defined(GDK_WINDOWING_WAYLAND)
-  gboolean x11_or_wayland = FALSE;
-#ifdef GDK_WINDOWING_X11
-  x11_or_wayland = GDK_IS_X11_DISPLAY (display);
-#endif
-#ifdef GDK_WINDOWING_WAYLAND
-  x11_or_wayland = x11_or_wayland || GDK_IS_WAYLAND_DISPLAY (display);
-#endif
+  renderer = get_renderer_from_session ();
+  if (!renderer)
+    renderer = get_renderer_from_helper (FALSE);
+  if (has_dual_gpu ())
+    discrete_renderer = get_renderer_from_helper (TRUE);
 
-  if (x11_or_wayland)
+  if (renderer != NULL)
     {
-      g_autofree char *discrete_renderer = NULL;
-      g_autofree char *renderer = NULL;
-
-      renderer = get_renderer_from_session ();
-      if (!renderer)
-        renderer = get_renderer_from_helper (FALSE);
-      if (has_dual_gpu ())
-        discrete_renderer = get_renderer_from_helper (TRUE);
-
-      if (renderer != NULL)
-        {
-          if (discrete_renderer != NULL)
-            return g_strdup_printf ("%s / %s",
-                                    renderer,
-                                    discrete_renderer);
-          return g_strdup (renderer);
-        }
+      if (discrete_renderer != NULL)
+        return g_strdup_printf ("%s / %s",
+                                renderer,
+                                discrete_renderer);
+      return g_strdup (renderer);
     }
-#endif
 
   return g_strdup (_("Unknown"));
 }


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