[gnome-panel/wip-warnings-next] multiscreen: reformat code



commit 081ceaac761c1273f7af1d25e899e1963fcb1312
Author: Sebastian Geiger <sbastig gmx net>
Date:   Tue Feb 25 10:48:02 2020 +0100

    multiscreen: reformat code

 gnome-panel/panel-multiscreen.c | 80 +++++++++++++++++++++--------------------
 1 file changed, 42 insertions(+), 38 deletions(-)
---
diff --git a/gnome-panel/panel-multiscreen.c b/gnome-panel/panel-multiscreen.c
index 1a2f6a107..23b002894 100644
--- a/gnome-panel/panel-multiscreen.c
+++ b/gnome-panel/panel-multiscreen.c
@@ -42,44 +42,48 @@ static gboolean       have_randr_1_3 = FALSE;
 static guint          reinit_id      = 0;
 
 static gboolean
-_panel_multiscreen_output_should_be_first (Display       *xdisplay,
-                                          RROutput       output,
-                                          XRROutputInfo *info,
-                                          RROutput       primary)
+panel_multiscreen_output_should_be_first (Display       *xdisplay,
+                                          RROutput       output,
+                                          XRROutputInfo *info,
+                                          RROutput       primary)
 {
-       if (primary)
-               return output == primary;
+  if (primary)
+    return output == primary;
 
-       if (have_randr_1_3) {
-               Atom           connector_type_atom;
-               Atom           actual_type;
-               int            actual_format;
-               unsigned long  nitems;
-               unsigned long  bytes_after;
-               unsigned char *prop;
-               char          *connector_type;
-               gboolean       retval;
-
-               connector_type_atom = XInternAtom (xdisplay, "ConnectorType", False);
-
-               if (XRRGetOutputProperty (xdisplay, output, connector_type_atom,
-                                         0, 100, False, False, None,
-                                         &actual_type, &actual_format,
-                                         &nitems, &bytes_after, &prop) == Success) {
-                       if (actual_type == XA_ATOM && nitems == 1 && actual_format == 32) {
-                               connector_type = XGetAtomName (xdisplay, prop[0]);
-                               retval = g_strcmp0 (connector_type, "Panel") == 0;
-                               XFree (connector_type);
-                               return retval;
-                       }
-               }
-       }
+  if (have_randr_1_3)
+    {
+      Atom           connector_type_atom;
+      Atom           actual_type;
+      int            actual_format;
+      unsigned long  nitems;
+      unsigned long  bytes_after;
+      unsigned char *prop;
+      char          *connector_type;
+      gboolean       retval;
+
+      connector_type_atom = XInternAtom (xdisplay, "ConnectorType", False);
+
+      if (XRRGetOutputProperty (xdisplay, output, connector_type_atom,
+                                0, 100, False, False, None,
+                                &actual_type, &actual_format,
+                                &nitems, &bytes_after, &prop) == Success)
+        {
+          if (actual_type == XA_ATOM && nitems == 1 && actual_format == 32)
+            {
+              connector_type = XGetAtomName (xdisplay, prop[0]);
+              retval = g_strcmp0 (connector_type, "Panel") == 0;
+              XFree (connector_type);
+
+              return retval;
+            }
+        }
+    }
 
-       /* Pre-1.3 fallback:
-        * "LVDS" is the oh-so-intuitive name that X gives to laptop LCDs.
-        * It can actually be LVDS0, LVDS-0, Lvds, etc.
-        */
-       return (g_ascii_strncasecmp (info->name, "LVDS", strlen ("LVDS")) == 0);
+  /* Pre-1.3 fallback:
+   * "LVDS" is the oh-so-intuitive name that X gives to laptop LCDs.
+   * It can actually be LVDS0, LVDS-0, Lvds, etc.
+   */
+  return (g_ascii_strncasecmp (info->name, "LVDS", strlen ("LVDS")) == 0);
 }
 
 static gboolean
@@ -177,9 +181,9 @@ panel_multiscreen_get_randr_monitors_for_screen (int           *monitors_ret,
 
                        XRRFreeCrtcInfo (crtc);
 
-                       if (_panel_multiscreen_output_should_be_first (xdisplay,
-                                                                      resources->outputs[i],
-                                                                      output, primary))
+                       if (panel_multiscreen_output_should_be_first (xdisplay,
+                                                                     resources->outputs[i],
+                                                                     output, primary))
                                g_array_prepend_vals (geometry_array, &rect, 1);
                        else
                                g_array_append_vals (geometry_array, &rect, 1);


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