[mutter/wip/nielsdg/uncrustify-test: 2/2] WIP



commit 7efb3155685554d77b310a18a72147a88a5f8df7
Author: Niels De Graef <Niels DeGraef barco com>
Date:   Mon Nov 19 14:19:28 2018 +0100

    WIP

 src/backends/edid-parse.c                          |  175 +--
 src/backends/meta-backend.c                        |   95 +-
 src/backends/meta-barrier.c                        |   34 +-
 src/backends/meta-crtc.c                           |    2 +-
 src/backends/meta-cursor-renderer.c                |   46 +-
 src/backends/meta-cursor-sprite-xcursor.c          |   12 +-
 src/backends/meta-cursor-tracker.c                 |   38 +-
 src/backends/meta-dbus-session-watcher.c           |   12 +-
 src/backends/meta-egl.c                            |   99 +-
 src/backends/meta-gles3.c                          |   12 +-
 src/backends/meta-gpu.c                            |    6 +-
 src/backends/meta-idle-monitor-dbus.c              |   42 +-
 src/backends/meta-idle-monitor.c                   |   58 +-
 src/backends/meta-input-settings.c                 |  346 +++--
 src/backends/meta-logical-monitor.c                |   19 +-
 src/backends/meta-monitor-config-manager.c         |  165 ++-
 src/backends/meta-monitor-config-migration.c       |  545 ++++----
 src/backends/meta-monitor-config-store.c           | 1110 ++++++++--------
 src/backends/meta-monitor-manager-dummy.c          |   63 +-
 src/backends/meta-monitor-manager.c                |  242 ++--
 src/backends/meta-monitor.c                        |   56 +-
 src/backends/meta-orientation-manager.c            |    7 +-
 src/backends/meta-output.c                         |    2 +-
 src/backends/meta-pointer-constraint.c             |    4 +-
 src/backends/meta-remote-access-controller.c       |    5 +-
 src/backends/meta-remote-desktop-session.c         |   99 +-
 src/backends/meta-renderer-view.c                  |    9 +-
 src/backends/meta-renderer.c                       |    2 +-
 src/backends/meta-screen-cast-monitor-stream-src.c |   13 +-
 src/backends/meta-screen-cast-monitor-stream.c     |   46 +-
 src/backends/meta-screen-cast-session.c            |   28 +-
 src/backends/meta-screen-cast-stream-src.c         |   50 +-
 src/backends/meta-screen-cast-stream.c             |   14 +-
 src/backends/meta-screen-cast.c                    |    8 +-
 src/backends/meta-settings.c                       |    9 +-
 src/backends/meta-stage.c                          |    6 +-
 src/backends/native/dbus-utils.c                   |    2 +-
 src/backends/native/meta-backend-native.c          |  112 +-
 src/backends/native/meta-barrier-native.c          |   71 +-
 src/backends/native/meta-clutter-backend-native.c  |   23 +-
 src/backends/native/meta-crtc-kms.c                |   21 +-
 src/backends/native/meta-cursor-renderer-native.c  |   32 +-
 src/backends/native/meta-gpu-kms.c                 |   63 +-
 src/backends/native/meta-input-settings-native.c   |  195 +--
 src/backends/native/meta-launcher.c                |  172 +--
 src/backends/native/meta-monitor-manager-kms.c     |  116 +-
 src/backends/native/meta-output-kms.c              |   55 +-
 src/backends/native/meta-renderer-native-gles3.c   |   51 +-
 src/backends/native/meta-renderer-native.c         |  245 ++--
 src/backends/native/meta-stage-native.c            |    2 +-
 src/backends/x11/cm/meta-backend-x11-cm.c          |   41 +-
 src/backends/x11/cm/meta-cursor-sprite-xfixes.c    |   22 +-
 src/backends/x11/meta-backend-x11.c                |   48 +-
 src/backends/x11/meta-clutter-backend-x11.c        |   20 +-
 src/backends/x11/meta-crtc-xrandr.c                |    6 +-
 src/backends/x11/meta-cursor-renderer-x11.c        |    9 +-
 src/backends/x11/meta-gpu-xrandr.c                 |   14 +-
 src/backends/x11/meta-input-settings-x11.c         |  202 +--
 src/backends/x11/meta-monitor-manager-xrandr.c     |  222 ++--
 src/backends/x11/meta-output-xrandr.c              |   45 +-
 src/backends/x11/meta-renderer-x11.c               |    2 +-
 src/backends/x11/meta-stage-x11-nested.c           |   18 +-
 src/backends/x11/nested/meta-backend-x11-nested.c  |   34 +-
 .../x11/nested/meta-cursor-renderer-x11-nested.c   |    3 +-
 src/backends/x11/nested/meta-renderer-x11-nested.c |   28 +-
 src/compositor/clutter-utils.c                     |   41 +-
 src/compositor/cogl-utils.c                        |   21 +-
 src/compositor/compositor.c                        |  254 ++--
 src/compositor/meta-background-actor.c             |  174 +--
 src/compositor/meta-background-group.c             |    6 +-
 src/compositor/meta-background-image.c             |   12 +-
 src/compositor/meta-background.c                   |  210 +--
 src/compositor/meta-cullable.c                     |   10 +-
 src/compositor/meta-dnd-actor.c                    |   14 +-
 src/compositor/meta-dnd.c                          |   48 +-
 src/compositor/meta-feedback-actor.c               |   29 +-
 src/compositor/meta-module.c                       |   47 +-
 src/compositor/meta-plugin-manager.c               |   50 +-
 src/compositor/meta-plugin.c                       |   13 +-
 src/compositor/meta-shadow-factory.c               |  181 ++-
 src/compositor/meta-shaped-texture.c               |   44 +-
 src/compositor/meta-surface-actor-wayland.c        |   41 +-
 src/compositor/meta-surface-actor-x11.c            |  100 +-
 src/compositor/meta-surface-actor.c                |   23 +-
 src/compositor/meta-sync-ring.c                    |  127 +-
 src/compositor/meta-texture-rectangle.c            |    2 +-
 src/compositor/meta-texture-tower.c                |  122 +-
 src/compositor/meta-window-actor.c                 |  510 ++++----
 src/compositor/meta-window-group.c                 |    6 +-
 src/compositor/meta-window-shape.c                 |    9 +-
 src/compositor/plugins/default.c                   |  217 +--
 src/compositor/region-utils.c                      |   56 +-
 src/core/bell.c                                    |    8 +-
 src/core/boxes.c                                   |  324 +++--
 src/core/constraints.c                             |  643 ++++-----
 src/core/core.c                                    |   65 +-
 src/core/delete.c                                  |   15 +-
 src/core/display.c                                 |  276 ++--
 src/core/edge-resistance.c                         |  371 +++---
 src/core/events.c                                  |   45 +-
 src/core/frame.c                                   |   42 +-
 src/core/keybindings.c                             |  439 ++++---
 src/core/main.c                                    |   66 +-
 src/core/meta-accel-parse.c                        |   45 +-
 src/core/meta-border.c                             |   16 +-
 src/core/meta-close-dialog-default.c               |   14 +-
 src/core/meta-close-dialog.c                       |   10 +-
 src/core/meta-fraction.c                           |    4 +-
 src/core/meta-gesture-tracker.c                    |   37 +-
 src/core/meta-inhibit-shortcuts-dialog-default.c   |   41 +-
 src/core/meta-inhibit-shortcuts-dialog.c           |   14 +-
 src/core/meta-workspace-manager.c                  |  165 ++-
 src/core/mutter.c                                  |   11 +-
 src/core/place.c                                   |  143 +-
 src/core/prefs.c                                   |  664 +++++-----
 src/core/restart-helper.c                          |   21 +-
 src/core/restart.c                                 |   17 +-
 src/core/stack-tracker.c                           |  384 +++---
 src/core/stack.c                                   |  135 +-
 src/core/startup-notification.c                    |  110 +-
 src/core/util.c                                    |   69 +-
 src/core/window.c                                  | 1110 +++++++++-------
 src/core/workspace.c                               |  260 ++--
 src/tests/boxes-tests.c                            |  480 ++++---
 src/tests/meta-backend-test.c                      |    3 +-
 src/tests/meta-monitor-manager-test.c              |   72 +-
 src/tests/monitor-store-unit-tests.c               |  240 ++--
 src/tests/monitor-unit-tests.c                     | 1384 +++++++++++++-------
 src/tests/test-client.c                            |   28 +-
 src/tests/test-runner.c                            |   98 +-
 src/tests/test-utils.c                             |   17 +-
 src/tests/unit-tests.c                             |    6 +-
 src/ui/frames.c                                    |  256 ++--
 src/ui/theme.c                                     |  217 +--
 src/ui/ui.c                                        |   33 +-
 src/wayland/meta-pointer-confinement-wayland.c     |   35 +-
 src/wayland/meta-wayland-actor-surface.c           |   61 +-
 src/wayland/meta-wayland-buffer.c                  |   15 +-
 src/wayland/meta-wayland-cursor-surface.c          |   33 +-
 src/wayland/meta-wayland-data-device.c             |  319 +++--
 src/wayland/meta-wayland-dma-buf.c                 |   36 +-
 src/wayland/meta-wayland-egl-stream.c              |   32 +-
 src/wayland/meta-wayland-gtk-shell.c               |   19 +-
 .../meta-wayland-inhibit-shortcuts-dialog.c        |   23 +-
 src/wayland/meta-wayland-inhibit-shortcuts.c       |   50 +-
 src/wayland/meta-wayland-input-device.c            |    4 +-
 src/wayland/meta-wayland-keyboard.c                |  235 ++--
 src/wayland/meta-wayland-legacy-xdg-shell.c        |  174 ++-
 src/wayland/meta-wayland-outputs.c                 |   54 +-
 src/wayland/meta-wayland-pointer-constraints.c     |  121 +-
 src/wayland/meta-wayland-pointer-gesture-pinch.c   |   54 +-
 src/wayland/meta-wayland-pointer-gesture-swipe.c   |   50 +-
 src/wayland/meta-wayland-pointer-gestures.c        |   12 +-
 src/wayland/meta-wayland-pointer.c                 |  339 ++---
 src/wayland/meta-wayland-popup.c                   |   34 +-
 src/wayland/meta-wayland-region.c                  |   32 +-
 src/wayland/meta-wayland-seat.c                    |   71 +-
 src/wayland/meta-wayland-shell-surface.c           |   17 +-
 src/wayland/meta-wayland-subsurface.c              |   43 +-
 src/wayland/meta-wayland-surface.c                 |  165 ++-
 src/wayland/meta-wayland-tablet-cursor-surface.c   |    3 +-
 src/wayland/meta-wayland-tablet-manager.c          |   17 +-
 src/wayland/meta-wayland-tablet-pad-group.c        |   93 +-
 src/wayland/meta-wayland-tablet-pad-ring.c         |   69 +-
 src/wayland/meta-wayland-tablet-pad-strip.c        |   66 +-
 src/wayland/meta-wayland-tablet-pad.c              |  148 ++-
 src/wayland/meta-wayland-tablet-seat.c             |   53 +-
 src/wayland/meta-wayland-tablet-tool.c             |  193 +--
 src/wayland/meta-wayland-tablet.c                  |   16 +-
 src/wayland/meta-wayland-text-input-legacy.c       |  128 +-
 src/wayland/meta-wayland-text-input.c              |  135 +-
 src/wayland/meta-wayland-touch.c                   |  119 +-
 src/wayland/meta-wayland-wl-shell.c                |   29 +-
 src/wayland/meta-wayland-xdg-foreign.c             |   12 +-
 src/wayland/meta-wayland-xdg-shell.c               |  133 +-
 src/wayland/meta-wayland.c                         |   92 +-
 src/wayland/meta-window-wayland.c                  |   67 +-
 src/wayland/meta-window-xwayland.c                 |    3 +-
 src/wayland/meta-xwayland-grab-keyboard.c          |   72 +-
 src/wayland/meta-xwayland-selection.c              |  195 +--
 src/wayland/meta-xwayland.c                        |   39 +-
 src/x11/events.c                                   |  570 ++++----
 src/x11/group-props.c                              |   34 +-
 src/x11/group.c                                    |   27 +-
 src/x11/iconcache.c                                |   41 +-
 src/x11/meta-x11-display.c                         |  161 ++-
 src/x11/meta-x11-errors.c                          |    9 +-
 src/x11/session.c                                  |  307 +++--
 src/x11/window-props.c                             |  478 ++++---
 src/x11/window-x11.c                               |  521 +++++---
 src/x11/xprops.c                                   |  212 +--
 191 files changed, 12583 insertions(+), 9605 deletions(-)
---
diff --git a/src/backends/edid-parse.c b/src/backends/edid-parse.c
index a7b9fd225..9072abf48 100644
--- a/src/backends/edid-parse.c
+++ b/src/backends/edid-parse.c
@@ -59,11 +59,11 @@ decode_vendor_and_product_identification (const uchar *edid, MonitorInfo *info)
   int is_model_year;
 
   /* Manufacturer Code */
-  info->manufacturer_code[0]  = get_bits (edid[0x08], 2, 6);
-  info->manufacturer_code[1]  = get_bits (edid[0x08], 0, 1) << 3;
+  info->manufacturer_code[0] = get_bits (edid[0x08], 2, 6);
+  info->manufacturer_code[1] = get_bits (edid[0x08], 0, 1) << 3;
   info->manufacturer_code[1] |= get_bits (edid[0x09], 5, 7);
-  info->manufacturer_code[2]  = get_bits (edid[0x09], 0, 4);
-  info->manufacturer_code[3]  = '\0';
+  info->manufacturer_code[2] = get_bits (edid[0x09], 0, 4);
+  info->manufacturer_code[3] = '\0';
 
   info->manufacturer_code[0] += 'A' - 1;
   info->manufacturer_code[1] += 'A' - 1;
@@ -128,14 +128,14 @@ decode_display_parameters (const uchar *edid, MonitorInfo *info)
       int bits;
 
       static const int bit_depth[8] =
-        {
-          -1, 6, 8, 10, 12, 14, 16, -1
-        };
+      {
+        -1, 6, 8, 10, 12, 14, 16, -1
+      };
 
       static const Interface interfaces[6] =
-        {
-          UNDEFINED, DVI, HDMI_A, HDMI_B, MDDI, DISPLAY_PORT
-        };
+      {
+        UNDEFINED, DVI, HDMI_A, HDMI_B, MDDI, DISPLAY_PORT
+      };
 
       bits = get_bits (edid[0x14], 4, 6);
       info->connector.digital.bits_per_primary = bit_depth[bits];
@@ -152,12 +152,12 @@ decode_display_parameters (const uchar *edid, MonitorInfo *info)
       int bits = get_bits (edid[0x14], 5, 6);
 
       static const double levels[][3] =
-        {
-          { 0.7,   0.3,    1.0 },
-          { 0.714, 0.286,  1.0 },
-          { 1.0,   0.4,    1.4 },
-          { 0.7,   0.0,    0.7 },
-        };
+      {
+        { 0.7, 0.3, 1.0 },
+        { 0.714, 0.286, 1.0 },
+        { 1.0, 0.4, 1.4 },
+        { 0.7, 0.0, 0.7 },
+      };
 
       info->connector.analog.video_signal_level = levels[bits][0];
       info->connector.analog.sync_signal_level = levels[bits][1];
@@ -190,7 +190,7 @@ decode_display_parameters (const uchar *edid, MonitorInfo *info)
       info->width_mm = -1;
       info->height_mm = -1;
       info->aspect_ratio = 100.0 / (edid[0x16] + 99);
-      info->aspect_ratio = 1/info->aspect_ratio; /* portrait */
+      info->aspect_ratio = 1 / info->aspect_ratio; /* portrait */
     }
   else
     {
@@ -221,9 +221,9 @@ decode_display_parameters (const uchar *edid, MonitorInfo *info)
     {
       int bits = get_bits (edid[0x18], 3, 4);
       ColorType color_type[4] =
-        {
-          MONOCHROME, RGB, OTHER_COLOR, UNDEFINED_COLOR
-        };
+      {
+        MONOCHROME, RGB, OTHER_COLOR, UNDEFINED_COLOR
+      };
 
       info->connector.analog.color_type = color_type[bits];
     }
@@ -271,38 +271,38 @@ static int
 decode_established_timings (const uchar *edid, MonitorInfo *info)
 {
   static const Timing established[][8] =
+  {
     {
-      {
-        { 800, 600, 60 },
-        { 800, 600, 56 },
-        { 640, 480, 75 },
-        { 640, 480, 72 },
-        { 640, 480, 67 },
-        { 640, 480, 60 },
-        { 720, 400, 88 },
-        { 720, 400, 70 }
-      },
-      {
-        { 1280, 1024, 75 },
-        { 1024, 768, 75 },
-        { 1024, 768, 70 },
-        { 1024, 768, 60 },
-        { 1024, 768, 87 },
-        { 832, 624, 75 },
-        { 800, 600, 75 },
-        { 800, 600, 72 }
-       },
-      {
-        { 0, 0, 0 },
-        { 0, 0, 0 },
-        { 0, 0, 0 },
-        { 0, 0, 0 },
-        { 0, 0, 0 },
-        { 0, 0, 0 },
-        { 0, 0, 0 },
-        { 1152, 870, 75 }
-      },
-    };
+      { 800, 600, 60 },
+      { 800, 600, 56 },
+      { 640, 480, 75 },
+      { 640, 480, 72 },
+      { 640, 480, 67 },
+      { 640, 480, 60 },
+      { 720, 400, 88 },
+      { 720, 400, 70 }
+    },
+    {
+      { 1280, 1024, 75 },
+      { 1024, 768, 75 },
+      { 1024, 768, 70 },
+      { 1024, 768, 60 },
+      { 1024, 768, 87 },
+      { 832, 624, 75 },
+      { 800, 600, 75 },
+      { 800, 600, 72 }
+    },
+    {
+      { 0, 0, 0 },
+      { 0, 0, 0 },
+      { 0, 0, 0 },
+      { 0, 0, 0 },
+      { 0, 0, 0 },
+      { 0, 0, 0 },
+      { 0, 0, 0 },
+      { 1152, 870, 75 }
+    },
+  };
 
   int i, j, idx;
 
@@ -310,12 +310,12 @@ decode_established_timings (const uchar *edid, MonitorInfo *info)
   for (i = 0; i < 3; ++i)
     {
       for (j = 0; j < 8; ++j)
-       {
+        {
           int byte = edid[0x23 + i];
 
           if (get_bit (byte, j) && established[i][j].frequency != 0)
             info->established[idx++] = established[i][j];
-       }
+        }
     }
   return TRUE;
 }
@@ -331,22 +331,26 @@ decode_standard_timings (const uchar *edid, MonitorInfo *info)
       int second = edid[0x27 + 2 * i];
 
       if (first != 0x01 && second != 0x01)
-       {
+        {
           int w = 8 * (first + 31);
           int h = 0;
 
           switch (get_bits (second, 6, 7))
             {
-           case 0x00: h = (w / 16) * 10; break;
-           case 0x01: h = (w / 4) * 3; break;
-           case 0x02: h = (w / 5) * 4; break;
-           case 0x03: h = (w / 16) * 9; break;
-           }
+            case 0x00: h = (w / 16) * 10;
+              break;
+            case 0x01: h = (w / 4) * 3;
+              break;
+            case 0x02: h = (w / 5) * 4;
+              break;
+            case 0x03: h = (w / 16) * 9;
+              break;
+            }
 
           info->standard[i].width = w;
           info->standard[i].height = h;
           info->standard[i].frequency = get_bits (second, 0, 5) + 60;
-       }
+        }
     }
 
   return TRUE;
@@ -359,25 +363,25 @@ decode_lf_string (const uchar *s, int n_chars, char *result)
   for (i = 0; i < n_chars; ++i)
     {
       if (s[i] == 0x0a)
-       {
+        {
           *result++ = '\0';
           break;
-       }
+        }
       else if (s[i] == 0x00)
-       {
+        {
           /* Convert embedded 0's to spaces */
           *result++ = ' ';
-       }
+        }
       else
-       {
+        {
           *result++ = s[i];
-       }
+        }
     }
 }
 
 static void
 decode_display_descriptor (const uchar *desc,
-                          MonitorInfo *info)
+                           MonitorInfo *info)
 {
   switch (desc[0x03])
     {
@@ -414,16 +418,16 @@ decode_display_descriptor (const uchar *desc,
 }
 
 static void
-decode_detailed_timing (const uchar *timing,
-                       DetailedTiming *detailed)
+decode_detailed_timing (const uchar    *timing,
+                        DetailedTiming *detailed)
 {
   int bits;
   StereoType stereo[] =
-    {
-      NO_STEREO, NO_STEREO, FIELD_RIGHT, FIELD_LEFT,
-      TWO_WAY_RIGHT_ON_EVEN, TWO_WAY_LEFT_ON_EVEN,
-      FOUR_WAY_INTERLEAVED, SIDE_BY_SIDE
-    };
+  {
+    NO_STEREO, NO_STEREO, FIELD_RIGHT, FIELD_LEFT,
+    TWO_WAY_RIGHT_ON_EVEN, TWO_WAY_LEFT_ON_EVEN,
+    FOUR_WAY_INTERLEAVED, SIDE_BY_SIDE
+  };
 
   detailed->pixel_clock = (timing[0x00] | timing[0x01] << 8) * 10000;
   detailed->h_addr = timing[0x02] | ((timing[0x04] & 0xf0) << 4);
@@ -436,7 +440,7 @@ decode_detailed_timing (const uchar *timing,
     get_bits (timing[0x0a], 4, 7) | get_bits (timing[0x0b], 2, 3) << 4;
   detailed->v_sync =
     get_bits (timing[0x0a], 0, 3) | get_bits (timing[0x0b], 0, 1) << 4;
-  detailed->width_mm =  timing[0x0c] | get_bits (timing[0x0e], 4, 7) << 8;
+  detailed->width_mm = timing[0x0c] | get_bits (timing[0x0e], 4, 7) << 8;
   detailed->height_mm = timing[0x0d] | get_bits (timing[0x0e], 0, 3) << 8;
   detailed->right_border = timing[0x0f];
   detailed->top_border = timing[0x10];
@@ -456,15 +460,15 @@ decode_detailed_timing (const uchar *timing,
       detailed->connector.digital.composite = !get_bit (bits, 3);
 
       if (detailed->connector.digital.composite)
-       {
+        {
           detailed->connector.digital.serrations = get_bit (bits, 2);
           detailed->connector.digital.negative_vsync = FALSE;
-       }
+        }
       else
-       {
+        {
           detailed->connector.digital.serrations = FALSE;
           detailed->connector.digital.negative_vsync = !get_bit (bits, 2);
-       }
+        }
 
       detailed->connector.digital.negative_hsync = !get_bit (bits, 0);
     }
@@ -489,13 +493,14 @@ decode_descriptors (const uchar *edid, MonitorInfo *info)
       int index = 0x36 + i * 18;
 
       if (edid[index + 0] == 0x00 && edid[index + 1] == 0x00)
-       {
+        {
           decode_display_descriptor (edid + index, info);
-       }
+        }
       else
-       {
-          decode_detailed_timing (edid + index, &(info->detailed_timings[timing_idx++]));
-       }
+        {
+          decode_detailed_timing (edid + index,
+                                  &(info->detailed_timings[timing_idx++]));
+        }
     }
 
   info->n_detailed_timings = timing_idx;
@@ -505,7 +510,7 @@ decode_descriptors (const uchar *edid, MonitorInfo *info)
 
 static void
 decode_check_sum (const uchar *edid,
-                 MonitorInfo *info)
+                  MonitorInfo *info)
 {
   int i;
   uchar check = 0;
diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c
index 709d4194c..345bc32a6 100644
--- a/src/backends/meta-backend.c
+++ b/src/backends/meta-backend.c
@@ -153,7 +153,8 @@ meta_backend_finalize (GObject *object)
 #endif
 
   if (priv->sleep_signal_id)
-    g_dbus_connection_signal_unsubscribe (priv->system_bus, priv->sleep_signal_id);
+    g_dbus_connection_signal_unsubscribe (priv->system_bus,
+                                          priv->sleep_signal_id);
   if (priv->upower_watch_id)
     g_bus_unwatch_name (priv->upower_watch_id);
   g_cancellable_cancel (priv->cancellable);
@@ -206,7 +207,8 @@ meta_backend_monitors_changed (MetaBackend *backend)
   MetaMonitorManager *monitor_manager =
     meta_backend_get_monitor_manager (backend);
   ClutterDeviceManager *manager = clutter_device_manager_get_default ();
-  ClutterInputDevice *device = clutter_device_manager_get_core_device (manager, CLUTTER_POINTER_DEVICE);
+  ClutterInputDevice *device = clutter_device_manager_get_core_device (manager,
+                                                                       CLUTTER_POINTER_DEVICE);
   ClutterPoint point;
 
   meta_backend_sync_screen_size (backend);
@@ -277,7 +279,8 @@ create_device_monitor (MetaBackend *backend,
   g_assert (g_hash_table_lookup (priv->device_monitors, &device_id) == NULL);
 
   idle_monitor = meta_backend_create_idle_monitor (backend, device_id);
-  g_hash_table_insert (priv->device_monitors, &idle_monitor->device_id, idle_monitor);
+  g_hash_table_insert (priv->device_monitors, &idle_monitor->device_id,
+                       idle_monitor);
 }
 
 static void
@@ -313,8 +316,10 @@ on_device_added (ClutterDeviceManager *device_manager,
 static inline gboolean
 device_is_slave_touchscreen (ClutterInputDevice *device)
 {
-  return (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_MASTER &&
-          clutter_input_device_get_device_type (device) == CLUTTER_TOUCHSCREEN_DEVICE);
+  return (clutter_input_device_get_device_mode (device) !=
+          CLUTTER_INPUT_MODE_MASTER &&
+          clutter_input_device_get_device_type (device) ==
+          CLUTTER_TOUCHSCREEN_DEVICE);
 }
 
 static inline gboolean
@@ -328,10 +333,13 @@ check_has_pointing_device (ClutterDeviceManager *manager)
     {
       ClutterInputDevice *device = devices->data;
 
-      if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER)
+      if (clutter_input_device_get_device_mode (device) ==
+          CLUTTER_INPUT_MODE_MASTER)
         continue;
-      if (clutter_input_device_get_device_type (device) == CLUTTER_TOUCHSCREEN_DEVICE ||
-          clutter_input_device_get_device_type (device) == CLUTTER_KEYBOARD_DEVICE)
+      if (clutter_input_device_get_device_type (device) ==
+          CLUTTER_TOUCHSCREEN_DEVICE ||
+          clutter_input_device_get_device_type (device) ==
+          CLUTTER_KEYBOARD_DEVICE)
         continue;
 
       return TRUE;
@@ -351,8 +359,10 @@ check_has_slave_touchscreen (ClutterDeviceManager *manager)
     {
       ClutterInputDevice *device = devices->data;
 
-      if (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_MASTER &&
-          clutter_input_device_get_device_type (device) == CLUTTER_TOUCHSCREEN_DEVICE)
+      if (clutter_input_device_get_device_mode (device) !=
+          CLUTTER_INPUT_MODE_MASTER &&
+          clutter_input_device_get_device_type (device) ==
+          CLUTTER_TOUCHSCREEN_DEVICE)
         return TRUE;
     }
 
@@ -458,7 +468,8 @@ meta_backend_real_post_init (MetaBackend *backend)
 
   meta_backend_sync_screen_size (backend);
 
-  priv->cursor_renderer = META_BACKEND_GET_CLASS (backend)->create_cursor_renderer (backend);
+  priv->cursor_renderer =
+    META_BACKEND_GET_CLASS (backend)->create_cursor_renderer (backend);
 
   priv->device_monitors =
     g_hash_table_new_full (g_int_hash, g_int_equal,
@@ -478,7 +489,8 @@ meta_backend_real_post_init (MetaBackend *backend)
 #ifdef HAVE_REMOTE_DESKTOP
   priv->remote_access_controller =
     g_object_new (META_TYPE_REMOTE_ACCESS_CONTROLLER, NULL);
-  priv->dbus_session_watcher = g_object_new (META_TYPE_DBUS_SESSION_WATCHER, NULL);
+  priv->dbus_session_watcher = g_object_new (META_TYPE_DBUS_SESSION_WATCHER,
+                                             NULL);
   priv->screen_cast = meta_screen_cast_new (priv->dbus_session_watcher);
   priv->remote_desktop = meta_remote_desktop_new (priv->dbus_session_watcher);
 #endif /* HAVE_REMOTE_DESKTOP */
@@ -521,12 +533,12 @@ meta_backend_real_select_stage_events (MetaBackend *backend)
 }
 
 static gboolean
-meta_backend_real_get_relative_motion_deltas (MetaBackend *backend,
-                                             const         ClutterEvent *event,
-                                             double        *dx,
-                                             double        *dy,
-                                             double        *dx_unaccel,
-                                             double        *dy_unaccel)
+meta_backend_real_get_relative_motion_deltas (MetaBackend        *backend,
+                                              const ClutterEvent *event,
+                                              double             *dx,
+                                              double             *dy,
+                                              double             *dx_unaccel,
+                                              double             *dy_unaccel)
 {
   return FALSE;
 }
@@ -655,7 +667,7 @@ meta_backend_constructed (GObject *object)
   MetaBackend *backend = META_BACKEND (object);
   MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
   MetaBackendClass *backend_class =
-   META_BACKEND_GET_CLASS (backend);
+    META_BACKEND_GET_CLASS (backend);
 
   if (backend_class->is_lid_closed != meta_backend_real_is_lid_closed)
     return;
@@ -683,7 +695,8 @@ meta_backend_class_init (MetaBackendClass *klass)
   klass->grab_device = meta_backend_real_grab_device;
   klass->ungrab_device = meta_backend_real_ungrab_device;
   klass->select_stage_events = meta_backend_real_select_stage_events;
-  klass->get_relative_motion_deltas = meta_backend_real_get_relative_motion_deltas;
+  klass->get_relative_motion_deltas =
+    meta_backend_real_get_relative_motion_deltas;
   klass->is_lid_closed = meta_backend_real_is_lid_closed;
 
   signals[KEYMAP_CHANGED] =
@@ -782,9 +795,9 @@ system_bus_gotten_cb (GObject      *object,
 }
 
 static gboolean
-meta_backend_initable_init (GInitable     *initable,
-                            GCancellable  *cancellable,
-                            GError       **error)
+meta_backend_initable_init (GInitable    *initable,
+                            GCancellable *cancellable,
+                            GError      **error)
 {
   MetaBackend *backend = META_BACKEND (initable);
   MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
@@ -795,7 +808,8 @@ meta_backend_initable_init (GInitable     *initable,
   priv->egl = g_object_new (META_TYPE_EGL, NULL);
 #endif
 
-  priv->orientation_manager = g_object_new (META_TYPE_ORIENTATION_MANAGER, NULL);
+  priv->orientation_manager =
+    g_object_new (META_TYPE_ORIENTATION_MANAGER, NULL);
 
   priv->monitor_manager = meta_backend_create_monitor_manager (backend, error);
   if (!priv->monitor_manager)
@@ -967,7 +981,8 @@ meta_backend_grab_device (MetaBackend *backend,
                           int          device_id,
                           uint32_t     timestamp)
 {
-  return META_BACKEND_GET_CLASS (backend)->grab_device (backend, device_id, timestamp);
+  return META_BACKEND_GET_CLASS (backend)->grab_device (backend, device_id,
+                                                        timestamp);
 }
 
 /**
@@ -978,7 +993,8 @@ meta_backend_ungrab_device (MetaBackend *backend,
                             int          device_id,
                             uint32_t     timestamp)
 {
-  return META_BACKEND_GET_CLASS (backend)->ungrab_device (backend, device_id, timestamp);
+  return META_BACKEND_GET_CLASS (backend)->ungrab_device (backend, device_id,
+                                                          timestamp);
 }
 
 /**
@@ -1004,7 +1020,8 @@ meta_backend_set_keymap (MetaBackend *backend,
                          const char  *variants,
                          const char  *options)
 {
-  META_BACKEND_GET_CLASS (backend)->set_keymap (backend, layouts, variants, options);
+  META_BACKEND_GET_CLASS (backend)->set_keymap (backend, layouts, variants,
+                                                options);
 }
 
 /**
@@ -1025,7 +1042,7 @@ meta_backend_get_keymap_layout_group (MetaBackend *backend)
 
 void
 meta_backend_lock_layout_group (MetaBackend *backend,
-                                guint idx)
+                                guint        idx)
 {
   META_BACKEND_GET_CLASS (backend)->lock_layout_group (backend, idx);
 }
@@ -1101,7 +1118,8 @@ meta_backend_update_last_device (MetaBackend *backend,
   device = clutter_device_manager_get_device (manager, device_id);
 
   if (!device ||
-      clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER)
+      clutter_input_device_get_device_mode (device) ==
+      CLUTTER_INPUT_MODE_MASTER)
     return;
 
   priv->current_device_id = device_id;
@@ -1116,12 +1134,12 @@ meta_backend_update_last_device (MetaBackend *backend,
 }
 
 gboolean
-meta_backend_get_relative_motion_deltas (MetaBackend *backend,
-                                         const        ClutterEvent *event,
-                                         double       *dx,
-                                         double       *dy,
-                                         double       *dx_unaccel,
-                                         double       *dy_unaccel)
+meta_backend_get_relative_motion_deltas (MetaBackend        *backend,
+                                         const ClutterEvent *event,
+                                         double             *dx,
+                                         double             *dy,
+                                         double             *dx_unaccel,
+                                         double             *dy_unaccel)
 {
   MetaBackendClass *klass = META_BACKEND_GET_CLASS (backend);
   return klass->get_relative_motion_deltas (backend,
@@ -1163,8 +1181,8 @@ meta_backend_set_client_pointer_constraint (MetaBackend           *backend,
  */
 
 static gboolean
-event_prepare (GSource    *source,
-               gint       *timeout_)
+event_prepare (GSource *source,
+               gint    *timeout_)
 {
   *timeout_ = -1;
 
@@ -1193,7 +1211,8 @@ event_dispatch (GSource    *source,
   return TRUE;
 }
 
-static GSourceFuncs event_funcs = {
+static GSourceFuncs event_funcs =
+{
   event_prepare,
   event_check,
   event_dispatch
diff --git a/src/backends/meta-barrier.c b/src/backends/meta-barrier.c
index 3b108c5e7..f7b92e482 100644
--- a/src/backends/meta-barrier.c
+++ b/src/backends/meta-barrier.c
@@ -1,4 +1,5 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; c-basic-offset: 2;
+ * -*- */
 
 /**
  * SECTION:barrier
@@ -26,7 +27,8 @@
 G_DEFINE_TYPE_WITH_PRIVATE (MetaBarrier, meta_barrier, G_TYPE_OBJECT)
 G_DEFINE_TYPE (MetaBarrierImpl, meta_barrier_impl, G_TYPE_OBJECT)
 
-enum {
+enum
+{
   PROP_0,
 
   PROP_DISPLAY,
@@ -42,7 +44,8 @@ enum {
 
 static GParamSpec *obj_props[PROP_LAST];
 
-enum {
+enum
+{
   HIT,
   LEFT,
 
@@ -209,35 +212,40 @@ meta_barrier_class_init (MetaBarrierClass *klass)
                          "Display",
                          "The display to construct the pointer barrier on",
                          META_TYPE_DISPLAY,
-                         G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+                         G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
+                         G_PARAM_STATIC_STRINGS);
 
   obj_props[PROP_X1] =
     g_param_spec_int ("x1",
                       "X1",
                       "The first X coordinate of the barrier",
                       0, G_MAXSHORT, 0,
-                      G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+                      G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
+                      G_PARAM_STATIC_STRINGS);
 
   obj_props[PROP_Y1] =
     g_param_spec_int ("y1",
                       "Y1",
                       "The first Y coordinate of the barrier",
                       0, G_MAXSHORT, 0,
-                      G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+                      G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
+                      G_PARAM_STATIC_STRINGS);
 
   obj_props[PROP_X2] =
     g_param_spec_int ("x2",
                       "X2",
                       "The second X coordinate of the barrier",
                       0, G_MAXSHORT, G_MAXSHORT,
-                      G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+                      G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
+                      G_PARAM_STATIC_STRINGS);
 
   obj_props[PROP_Y2] =
     g_param_spec_int ("y2",
                       "Y2",
                       "The second Y coordinate of the barrier",
                       0, G_MAXSHORT, G_MAXSHORT,
-                      G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+                      G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
+                      G_PARAM_STATIC_STRINGS);
 
   obj_props[PROP_DIRECTIONS] =
     g_param_spec_flags ("directions",
@@ -245,7 +253,8 @@ meta_barrier_class_init (MetaBarrierClass *klass)
                         "A set of directions to let the pointer through",
                         META_TYPE_BARRIER_DIRECTION,
                         0,
-                        G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+                        G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
+                        G_PARAM_STATIC_STRINGS);
 
   g_object_class_install_properties (object_class, PROP_LAST, obj_props);
 
@@ -300,7 +309,8 @@ meta_barrier_destroy (MetaBarrier *barrier)
 static void
 meta_barrier_init (MetaBarrier *barrier)
 {
-  barrier->priv = G_TYPE_INSTANCE_GET_PRIVATE (barrier, META_TYPE_BARRIER, MetaBarrierPrivate);
+  barrier->priv = G_TYPE_INSTANCE_GET_PRIVATE (barrier, META_TYPE_BARRIER,
+                                               MetaBarrierPrivate);
 }
 
 void
@@ -336,7 +346,7 @@ meta_barrier_event_ref (MetaBarrierEvent *event)
   g_return_val_if_fail (event != NULL, NULL);
   g_return_val_if_fail (event->ref_count > 0, NULL);
 
-  g_atomic_int_inc ((volatile int *)&event->ref_count);
+  g_atomic_int_inc ((volatile int *) &event->ref_count);
   return event;
 }
 
@@ -346,7 +356,7 @@ meta_barrier_event_unref (MetaBarrierEvent *event)
   g_return_if_fail (event != NULL);
   g_return_if_fail (event->ref_count > 0);
 
-  if (g_atomic_int_dec_and_test ((volatile int *)&event->ref_count))
+  if (g_atomic_int_dec_and_test ((volatile int *) &event->ref_count))
     g_slice_free (MetaBarrierEvent, event);
 }
 
diff --git a/src/backends/meta-crtc.c b/src/backends/meta-crtc.c
index 7ca31ba39..14a0033b8 100644
--- a/src/backends/meta-crtc.c
+++ b/src/backends/meta-crtc.c
@@ -26,7 +26,7 @@ G_DEFINE_TYPE (MetaCrtc, meta_crtc, G_TYPE_OBJECT)
 G_DEFINE_TYPE (MetaCrtcMode, meta_crtc_mode, G_TYPE_OBJECT)
 
 MetaGpu *
-meta_crtc_get_gpu (MetaCrtc *crtc)
+meta_crtc_get_gpu (MetaCrtc * crtc)
 {
   return crtc->gpu;
 }
diff --git a/src/backends/meta-cursor-renderer.c b/src/backends/meta-cursor-renderer.c
index 1f76206f8..6864fd556 100644
--- a/src/backends/meta-cursor-renderer.c
+++ b/src/backends/meta-cursor-renderer.c
@@ -46,13 +46,15 @@ struct _MetaCursorRendererPrivate
 };
 typedef struct _MetaCursorRendererPrivate MetaCursorRendererPrivate;
 
-enum {
+enum
+{
   CURSOR_PAINTED,
   LAST_SIGNAL
 };
 static guint signals[LAST_SIGNAL];
 
-G_DEFINE_TYPE_WITH_PRIVATE (MetaCursorRenderer, meta_cursor_renderer, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE (MetaCursorRenderer, meta_cursor_renderer,
+                            G_TYPE_OBJECT);
 
 void
 meta_cursor_renderer_emit_painted (MetaCursorRenderer *renderer,
@@ -65,7 +67,8 @@ static void
 queue_redraw (MetaCursorRenderer *renderer,
               MetaCursorSprite   *cursor_sprite)
 {
-  MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer);
+  MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (
+    renderer);
   MetaBackend *backend = meta_get_backend ();
   ClutterActor *stage = meta_backend_get_stage (backend);
   CoglTexture *texture;
@@ -117,7 +120,8 @@ static void
 meta_cursor_renderer_finalize (GObject *object)
 {
   MetaCursorRenderer *renderer = META_CURSOR_RENDERER (object);
-  MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer);
+  MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (
+    renderer);
   MetaBackend *backend = meta_get_backend ();
   ClutterActor *stage = meta_backend_get_stage (backend);
 
@@ -180,14 +184,16 @@ meta_cursor_renderer_calculate_rect (MetaCursorRenderer *renderer,
   height = cogl_texture_get_height (texture);
 
   return (ClutterRect) {
-    .origin = {
-      .x = priv->current_x - (hot_x * texture_scale),
-      .y = priv->current_y - (hot_y * texture_scale)
-    },
-    .size = {
-      .width = width * texture_scale,
-      .height = height * texture_scale
-    }
+           .origin =
+           {
+             .x = priv->current_x - (hot_x * texture_scale),
+             .y = priv->current_y - (hot_y * texture_scale)
+           },
+           .size =
+           {
+             .width = width * texture_scale,
+             .height = height * texture_scale
+           }
   };
 }
 
@@ -195,7 +201,8 @@ static void
 meta_cursor_renderer_update_cursor (MetaCursorRenderer *renderer,
                                     MetaCursorSprite   *cursor_sprite)
 {
-  MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer);
+  MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (
+    renderer);
   gboolean handled_by_backend;
   gboolean should_redraw = FALSE;
 
@@ -230,7 +237,8 @@ void
 meta_cursor_renderer_set_cursor (MetaCursorRenderer *renderer,
                                  MetaCursorSprite   *cursor_sprite)
 {
-  MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer);
+  MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (
+    renderer);
 
   if (priv->displayed_cursor == cursor_sprite)
     return;
@@ -253,7 +261,8 @@ meta_cursor_renderer_set_position (MetaCursorRenderer *renderer,
                                    float               x,
                                    float               y)
 {
-  MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer);
+  MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (
+    renderer);
 
   g_assert (meta_is_wayland_compositor ());
 
@@ -270,15 +279,16 @@ meta_cursor_renderer_get_position (MetaCursorRenderer *renderer)
     meta_cursor_renderer_get_instance_private (renderer);
 
   return (ClutterPoint) {
-    .x = priv->current_x,
-    .y = priv->current_y
+           .x = priv->current_x,
+           .y = priv->current_y
   };
 }
 
 MetaCursorSprite *
 meta_cursor_renderer_get_cursor (MetaCursorRenderer *renderer)
 {
-  MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer);
+  MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (
+    renderer);
 
   return priv->displayed_cursor;
 }
diff --git a/src/backends/meta-cursor-sprite-xcursor.c b/src/backends/meta-cursor-sprite-xcursor.c
index 49d10b94c..a5f81d79d 100644
--- a/src/backends/meta-cursor-sprite-xcursor.c
+++ b/src/backends/meta-cursor-sprite-xcursor.c
@@ -99,8 +99,8 @@ meta_cursor_sprite_xcursor_get_cursor (MetaCursorSpriteXcursor *sprite_xcursor)
 }
 
 Cursor
-meta_create_x_cursor (Display    *xdisplay,
-                      MetaCursor  cursor)
+meta_create_x_cursor (Display   *xdisplay,
+                      MetaCursor cursor)
 {
   return XcursorLibraryLoadCursor (xdisplay, translate_meta_cursor (cursor));
 }
@@ -160,8 +160,9 @@ load_from_current_xcursor_image (MetaCursorSpriteXcursor *sprite_xcursor)
 }
 
 void
-meta_cursor_sprite_xcursor_set_theme_scale (MetaCursorSpriteXcursor *sprite_xcursor,
-                                            int                      theme_scale)
+meta_cursor_sprite_xcursor_set_theme_scale (
+  MetaCursorSpriteXcursor *sprite_xcursor,
+  int                      theme_scale)
 {
   if (sprite_xcursor->theme_scale != theme_scale)
     sprite_xcursor->theme_dirty = TRUE;
@@ -178,7 +179,8 @@ meta_cursor_sprite_xcursor_is_animated (MetaCursorSprite *sprite)
 }
 
 XcursorImage *
-meta_cursor_sprite_xcursor_get_current_image (MetaCursorSpriteXcursor *sprite_xcursor)
+meta_cursor_sprite_xcursor_get_current_image (
+  MetaCursorSpriteXcursor *sprite_xcursor)
 {
   return sprite_xcursor->xcursor_images->images[sprite_xcursor->current_frame];
 }
diff --git a/src/backends/meta-cursor-tracker.c b/src/backends/meta-cursor-tracker.c
index d33fa300a..d7597b9b3 100644
--- a/src/backends/meta-cursor-tracker.c
+++ b/src/backends/meta-cursor-tracker.c
@@ -46,7 +46,8 @@
 
 G_DEFINE_TYPE (MetaCursorTracker, meta_cursor_tracker, G_TYPE_OBJECT);
 
-enum {
+enum
+{
   CURSOR_CHANGED,
   LAST_SIGNAL
 };
@@ -204,7 +205,7 @@ meta_cursor_tracker_handle_xevent (MetaCursorTracker *tracker,
   if (xevent->xany.type != x11_display->xfixes_event_base + XFixesCursorNotify)
     return FALSE;
 
-  notify_event = (XFixesCursorNotifyEvent *)xevent;
+  notify_event = (XFixesCursorNotifyEvent *) xevent;
   if (notify_event->subtype != XFixesDisplayCursorNotify)
     return FALSE;
 
@@ -337,9 +338,9 @@ meta_cursor_tracker_update_position (MetaCursorTracker *tracker,
 }
 
 static void
-get_pointer_position_gdk (int         *x,
-                          int         *y,
-                          int         *mods)
+get_pointer_position_gdk (int *x,
+                          int *y,
+                          int *mods)
 {
   GdkSeat *gseat;
   GdkDevice *gdevice;
@@ -352,20 +353,21 @@ get_pointer_position_gdk (int         *x,
   if (mods)
     gdk_device_get_state (gdevice,
                           gdk_screen_get_root_window (gscreen),
-                          NULL, (GdkModifierType*)mods);
+                          NULL, (GdkModifierType *) mods);
 }
 
 static void
-get_pointer_position_clutter (int         *x,
-                              int         *y,
-                              int         *mods)
+get_pointer_position_clutter (int *x,
+                              int *y,
+                              int *mods)
 {
   ClutterDeviceManager *cmanager;
   ClutterInputDevice *cdevice;
   ClutterPoint point;
 
   cmanager = clutter_device_manager_get_default ();
-  cdevice = clutter_device_manager_get_core_device (cmanager, CLUTTER_POINTER_DEVICE);
+  cdevice = clutter_device_manager_get_core_device (cmanager,
+                                                    CLUTTER_POINTER_DEVICE);
 
   clutter_input_device_get_coords (cdevice, NULL, &point);
   if (x)
@@ -382,15 +384,17 @@ meta_cursor_tracker_get_pointer (MetaCursorTracker   *tracker,
                                  int                 *y,
                                  ClutterModifierType *mods)
 {
-  /* We can't use the clutter interface when not running as a wayland compositor,
-     because we need to query the server, rather than using the last cached value.
-     OTOH, on wayland we can't use GDK, because that only sees the events
-     we forward to xwayland.
-  */
+  /* We can't use the clutter interface when not running as a wayland
+   * compositor,
+   *  because we need to query the server, rather than using the last cached
+   * value.
+   *  OTOH, on wayland we can't use GDK, because that only sees the events
+   *  we forward to xwayland.
+   */
   if (meta_is_wayland_compositor ())
-    get_pointer_position_clutter (x, y, (int*)mods);
+    get_pointer_position_clutter (x, y, (int *) mods);
   else
-    get_pointer_position_gdk (x, y, (int*)mods);
+    get_pointer_position_gdk (x, y, (int *) mods);
 }
 
 void
diff --git a/src/backends/meta-dbus-session-watcher.c b/src/backends/meta-dbus-session-watcher.c
index 22718e6c2..bff96c1a2 100644
--- a/src/backends/meta-dbus-session-watcher.c
+++ b/src/backends/meta-dbus-session-watcher.c
@@ -92,8 +92,9 @@ meta_dbus_session_client_destroy (MetaDbusSessionClient *client)
 }
 
 static void
-meta_dbus_session_watcher_destroy_client (MetaDbusSessionWatcher *session_watcher,
-                                          MetaDbusSessionClient  *client)
+meta_dbus_session_watcher_destroy_client (
+  MetaDbusSessionWatcher *session_watcher,
+  MetaDbusSessionClient  *client)
 {
   g_hash_table_remove (session_watcher->clients, client->dbus_name);
 }
@@ -169,9 +170,10 @@ meta_dbus_session_watcher_get_client (MetaDbusSessionWatcher *session_watcher,
 }
 
 void
-meta_dbus_session_watcher_watch_session (MetaDbusSessionWatcher *session_watcher,
-                                         const char             *client_dbus_name,
-                                         MetaDbusSession        *session)
+meta_dbus_session_watcher_watch_session (
+  MetaDbusSessionWatcher *session_watcher,
+  const char             *client_dbus_name,
+  MetaDbusSession        *session)
 {
   MetaDbusSessionClient *client;
 
diff --git a/src/backends/meta-egl.c b/src/backends/meta-egl.c
index c60dd2eaa..4fa7f40b3 100644
--- a/src/backends/meta-egl.c
+++ b/src/backends/meta-egl.c
@@ -62,7 +62,8 @@ struct _MetaEgl
 
   PFNEGLSTREAMCONSUMEROUTPUTEXTPROC eglStreamConsumerOutputEXT;
 
-  PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC eglStreamConsumerGLTextureExternalKHR;
+  PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC
+    eglStreamConsumerGLTextureExternalKHR;
 
   PFNEGLSTREAMCONSUMERACQUIREKHRPROC eglStreamConsumerAcquireKHR;
   PFNEGLSTREAMCONSUMERACQUIREATTRIBNVPROC eglStreamConsumerAcquireAttribNV;
@@ -73,7 +74,7 @@ struct _MetaEgl
 
 G_DEFINE_TYPE (MetaEgl, meta_egl, G_TYPE_OBJECT)
 
-G_DEFINE_QUARK (-meta-egl-error-quark, meta_egl_error)
+G_DEFINE_QUARK (-meta - egl - error - quark, meta_egl_error)
 
 static const char *
 get_egl_error_str (EGLint error_number)
@@ -84,46 +85,58 @@ get_egl_error_str (EGLint error_number)
       return "The last function succeeded without error.";
       break;
     case EGL_NOT_INITIALIZED:
-      return "EGL is not initialized, or could not be initialized, for the specified EGL display 
connection.";
+      return
+        "EGL is not initialized, or could not be initialized, for the specified EGL display connection.";
       break;
     case EGL_BAD_ACCESS:
-      return "EGL cannot access a requested resource (for example a context is bound in another thread).";
+      return
+        "EGL cannot access a requested resource (for example a context is bound in another thread).";
       break;
     case EGL_BAD_ALLOC:
       return "EGL failed to allocate resources for the requested operation.";
       break;
     case EGL_BAD_ATTRIBUTE:
-      return "An unrecognized attribute or attribute value was passed in the attribute list.";
+      return
+        "An unrecognized attribute or attribute value was passed in the attribute list.";
       break;
     case EGL_BAD_CONTEXT:
-      return "An EGLContext argument does not name a valid EGL rendering context.";
+      return
+        "An EGLContext argument does not name a valid EGL rendering context.";
       break;
     case EGL_BAD_CONFIG:
-      return "An EGLConfig argument does not name a valid EGL frame buffer configuration.";
+      return
+        "An EGLConfig argument does not name a valid EGL frame buffer configuration.";
       break;
     case EGL_BAD_CURRENT_SURFACE:
-      return "The current surface of the calling thread is a window, pixel buffer or pixmap that is no 
longer valid.";
+      return
+        "The current surface of the calling thread is a window, pixel buffer or pixmap that is no longer 
valid.";
       break;
     case EGL_BAD_DISPLAY:
-      return "An EGLDisplay argument does not name a valid EGL display connection.";
+      return
+        "An EGLDisplay argument does not name a valid EGL display connection.";
       break;
     case EGL_BAD_SURFACE:
-      return "An EGLSurface argument does not name a valid surface (window, pixel buffer or pixmap) 
configured for GL rendering.";
+      return
+        "An EGLSurface argument does not name a valid surface (window, pixel buffer or pixmap) configured 
for GL rendering.";
       break;
     case EGL_BAD_MATCH:
-      return "Arguments are inconsistent (for example, a valid context requires buffers not supplied by a 
valid surface).";
+      return
+        "Arguments are inconsistent (for example, a valid context requires buffers not supplied by a valid 
surface).";
       break;
     case EGL_BAD_PARAMETER:
       return "One or more argument values are invalid.";
       break;
     case EGL_BAD_NATIVE_PIXMAP:
-      return "A NativePixmapType argument does not refer to a valid native pixmap.";
+      return
+        "A NativePixmapType argument does not refer to a valid native pixmap.";
       break;
     case EGL_BAD_NATIVE_WINDOW:
-      return "A NativeWindowType argument does not refer to a valid native window.";
+      return
+        "A NativeWindowType argument does not refer to a valid native window.";
       break;
     case EGL_CONTEXT_LOST:
-      return "A power management event has occurred. The application must destroy all contexts and 
reinitialise OpenGL ES state and objects to continue rendering. ";
+      return
+        "A power management event has occurred. The application must destroy all contexts and reinitialise 
OpenGL ES state and objects to continue rendering. ";
       break;
     case EGL_BAD_STREAM_KHR:
       return "An EGLStreamKHR argument does not name a valid EGL stream.";
@@ -135,9 +148,11 @@ get_egl_error_str (EGLint error_number)
       return "An EGLDeviceEXT argument does not name a valid EGL device.";
       break;
     case EGL_BAD_OUTPUT_LAYER_EXT:
-      return "An EGLOutputLayerEXT argument does not name a valid EGL output layer.";
+      return
+        "An EGLOutputLayerEXT argument does not name a valid EGL output layer.";
     case EGL_RESOURCE_BUSY_EXT:
-      return "The operation could not be completed on the requested resource because it is temporary 
unavailable.";
+      return
+        "The operation could not be completed on the requested resource because it is temporary 
unavailable.";
     default:
       return "Unknown error";
       break;
@@ -266,12 +281,12 @@ meta_egl_get_proc_address (MetaEgl    *egl,
 }
 
 gboolean
-meta_egl_get_config_attrib (MetaEgl     *egl,
-                            EGLDisplay   display,
-                            EGLConfig    config,
-                            EGLint       attribute,
-                            EGLint      *value,
-                            GError     **error)
+meta_egl_get_config_attrib (MetaEgl   *egl,
+                            EGLDisplay display,
+                            EGLConfig  config,
+                            EGLint     attribute,
+                            EGLint    *value,
+                            GError   **error)
 {
   if (!eglGetConfigAttrib (display,
                            config,
@@ -286,11 +301,11 @@ meta_egl_get_config_attrib (MetaEgl     *egl,
 }
 
 EGLConfig *
-meta_egl_choose_all_configs (MetaEgl       *egl,
-                             EGLDisplay     display,
-                             const EGLint  *attrib_list,
-                             EGLint        *out_num_configs,
-                             GError       **error)
+meta_egl_choose_all_configs (MetaEgl      *egl,
+                             EGLDisplay    display,
+                             const EGLint *attrib_list,
+                             EGLint       *out_num_configs,
+                             GError      **error)
 {
   EGLint num_configs;
   EGLConfig *configs;
@@ -312,7 +327,8 @@ meta_egl_choose_all_configs (MetaEgl       *egl,
 
   configs = g_new0 (EGLConfig, num_configs);
 
-  if (!eglChooseConfig (display, attrib_list, configs, num_configs, &num_matches))
+  if (!eglChooseConfig (display, attrib_list, configs, num_configs,
+                        &num_matches))
     {
       g_free (configs);
       set_egl_error (error);
@@ -332,11 +348,11 @@ meta_egl_choose_all_configs (MetaEgl       *egl,
 }
 
 gboolean
-meta_egl_choose_first_config (MetaEgl       *egl,
-                              EGLDisplay     display,
-                              const EGLint  *attrib_list,
-                              EGLConfig     *chosen_config,
-                              GError       **error)
+meta_egl_choose_first_config (MetaEgl      *egl,
+                              EGLDisplay    display,
+                              const EGLint *attrib_list,
+                              EGLConfig    *chosen_config,
+                              GError      **error)
 {
   EGLint num_configs;
   EGLConfig *configs;
@@ -358,7 +374,8 @@ meta_egl_choose_first_config (MetaEgl       *egl,
 
   configs = g_new0 (EGLConfig, num_configs);
 
-  if (!eglChooseConfig (display, attrib_list, configs, num_configs, &num_matches))
+  if (!eglChooseConfig (display, attrib_list, configs, num_configs,
+                        &num_matches))
     {
       g_free (configs);
       set_egl_error (error);
@@ -615,7 +632,7 @@ meta_egl_query_wayland_buffer (MetaEgl            *egl,
                                GError            **error)
 {
   if (!is_egl_proc_valid (egl->eglQueryWaylandBufferWL, error))
-   return FALSE;
+    return FALSE;
 
   if (!egl->eglQueryWaylandBufferWL (display, buffer, attribute, value))
     {
@@ -827,10 +844,10 @@ meta_egl_create_stream_attrib (MetaEgl         *egl,
 }
 
 EGLSurface
-meta_egl_create_stream_producer_surface (MetaEgl     *egl,
-                                         EGLDisplay   display,
-                                         EGLConfig    config,
-                                         EGLStreamKHR stream,
+meta_egl_create_stream_producer_surface (MetaEgl      *egl,
+                                         EGLDisplay    display,
+                                         EGLConfig     config,
+                                         EGLStreamKHR  stream,
                                          const EGLint *attrib_list,
                                          GError      **error)
 {
@@ -944,7 +961,7 @@ meta_egl_query_dma_buf_formats (MetaEgl   *egl,
       return FALSE;
     }
 
-    return TRUE;
+  return TRUE;
 }
 
 gboolean
@@ -968,7 +985,7 @@ meta_egl_query_dma_buf_modifiers (MetaEgl      *egl,
       return FALSE;
     }
 
-    return TRUE;
+  return TRUE;
 }
 
 #define GET_EGL_PROC_ADDR(proc) \
diff --git a/src/backends/meta-gles3.c b/src/backends/meta-gles3.c
index f467a8f94..98bfd8345 100644
--- a/src/backends/meta-gles3.c
+++ b/src/backends/meta-gles3.c
@@ -42,7 +42,7 @@ struct _MetaGles3
 G_DEFINE_TYPE (MetaGles3, meta_gles3, G_TYPE_OBJECT)
 
 MetaGles3Table *
-meta_gles3_get_table (MetaGles3 *gles3)
+meta_gles3_get_table (MetaGles3 * gles3)
 {
   return &gles3->table;
 }
@@ -72,15 +72,15 @@ get_gl_error_str (GLenum gl_error)
     case GL_INVALID_ENUM:
       return "An unacceptable value is specified for an enumerated argument.";
     case GL_INVALID_VALUE:
-        return "A numeric argument is out of range.";
+      return "A numeric argument is out of range.";
     case GL_INVALID_OPERATION:
-        return "The specified operation is not allowed in the current state.";
+      return "The specified operation is not allowed in the current state.";
     case GL_INVALID_FRAMEBUFFER_OPERATION:
-        return "The framebuffer object is not complete.";
+      return "The framebuffer object is not complete.";
     case GL_OUT_OF_MEMORY:
-        return "There is not enough memory left to execute the command.";
+      return "There is not enough memory left to execute the command.";
     default:
-        return "Unknown error";
+      return "Unknown error";
     }
 }
 
diff --git a/src/backends/meta-gpu.c b/src/backends/meta-gpu.c
index 3577391e5..164df6c44 100644
--- a/src/backends/meta-gpu.c
+++ b/src/backends/meta-gpu.c
@@ -65,8 +65,8 @@ meta_gpu_has_hotplug_mode_update (MetaGpu *gpu)
 }
 
 gboolean
-meta_gpu_read_current (MetaGpu  *gpu,
-                       GError  **error)
+meta_gpu_read_current (MetaGpu *gpu,
+                       GError **error)
 {
   MetaGpuPrivate *priv = meta_gpu_get_instance_private (gpu);
   gboolean ret;
@@ -131,7 +131,7 @@ meta_gpu_take_outputs (MetaGpu *gpu,
 
 void
 meta_gpu_take_crtcs (MetaGpu *gpu,
-                    GList   *crtcs)
+                     GList   *crtcs)
 {
   MetaGpuPrivate *priv = meta_gpu_get_instance_private (gpu);
 
diff --git a/src/backends/meta-idle-monitor-dbus.c b/src/backends/meta-idle-monitor-dbus.c
index e55275be7..94386f7d0 100644
--- a/src/backends/meta-idle-monitor-dbus.c
+++ b/src/backends/meta-idle-monitor-dbus.c
@@ -65,7 +65,8 @@ handle_reset_idletime (MetaDBusIdleMonitor   *skeleton,
   return TRUE;
 }
 
-typedef struct {
+typedef struct
+{
   MetaDBusIdleMonitor *dbus_monitor;
   MetaIdleMonitor *monitor;
   char *dbus_name;
@@ -92,11 +93,14 @@ dbus_idle_callback (MetaIdleMonitor *monitor,
                     gpointer         user_data)
 {
   DBusWatch *watch = user_data;
-  GDBusInterfaceSkeleton *skeleton = G_DBUS_INTERFACE_SKELETON (watch->dbus_monitor);
+  GDBusInterfaceSkeleton *skeleton = G_DBUS_INTERFACE_SKELETON (
+    watch->dbus_monitor);
 
-  g_dbus_connection_emit_signal (g_dbus_interface_skeleton_get_connection (skeleton),
+  g_dbus_connection_emit_signal (g_dbus_interface_skeleton_get_connection (
+                                   skeleton),
                                  watch->dbus_name,
-                                 g_dbus_interface_skeleton_get_object_path (skeleton),
+                                 g_dbus_interface_skeleton_get_object_path (
+                                   skeleton),
                                  "org.gnome.Mutter.IdleMonitor",
                                  "WatchFired",
                                  g_variant_new ("(u)", watch_id),
@@ -123,8 +127,10 @@ make_dbus_watch (MetaDBusIdleMonitor   *skeleton,
   watch = g_slice_new (DBusWatch);
   watch->dbus_monitor = g_object_ref (skeleton);
   watch->monitor = g_object_ref (monitor);
-  watch->dbus_name = g_strdup (g_dbus_method_invocation_get_sender (invocation));
-  watch->name_watcher_id = g_bus_watch_name_on_connection (g_dbus_method_invocation_get_connection 
(invocation),
+  watch->dbus_name =
+    g_strdup (g_dbus_method_invocation_get_sender (invocation));
+  watch->name_watcher_id = g_bus_watch_name_on_connection (g_dbus_method_invocation_get_connection (
+                                                             invocation),
                                                            watch->dbus_name,
                                                            G_BUS_NAME_WATCHER_FLAGS_NONE,
                                                            NULL, /* appeared */
@@ -144,9 +150,11 @@ handle_add_idle_watch (MetaDBusIdleMonitor   *skeleton,
 
   watch = make_dbus_watch (skeleton, invocation, monitor);
   watch->watch_id = meta_idle_monitor_add_idle_watch (monitor, interval,
-                                                      dbus_idle_callback, watch, destroy_dbus_watch);
+                                                      dbus_idle_callback, watch,
+                                                      destroy_dbus_watch);
 
-  meta_dbus_idle_monitor_complete_add_idle_watch (skeleton, invocation, watch->watch_id);
+  meta_dbus_idle_monitor_complete_add_idle_watch (skeleton, invocation,
+                                                  watch->watch_id);
 
   return TRUE;
 }
@@ -160,10 +168,12 @@ handle_add_user_active_watch (MetaDBusIdleMonitor   *skeleton,
 
   watch = make_dbus_watch (skeleton, invocation, monitor);
   watch->watch_id = meta_idle_monitor_add_user_active_watch (monitor,
-                                                             dbus_idle_callback, watch,
+                                                             dbus_idle_callback,
+                                                             watch,
                                                              destroy_dbus_watch);
 
-  meta_dbus_idle_monitor_complete_add_user_active_watch (skeleton, invocation, watch->watch_id);
+  meta_dbus_idle_monitor_complete_add_user_active_watch (skeleton, invocation,
+                                                         watch->watch_id);
 
   return TRUE;
 }
@@ -192,7 +202,8 @@ create_monitor_skeleton (GDBusObjectManagerServer *manager,
   g_signal_connect_object (skeleton, "handle-add-idle-watch",
                            G_CALLBACK (handle_add_idle_watch), monitor, 0);
   g_signal_connect_object (skeleton, "handle-add-user-active-watch",
-                           G_CALLBACK (handle_add_user_active_watch), monitor, 0);
+                           G_CALLBACK (handle_add_user_active_watch), monitor,
+                           0);
   g_signal_connect_object (skeleton, "handle-remove-watch",
                            G_CALLBACK (handle_remove_watch), monitor, 0);
   g_signal_connect_object (skeleton, "handle-reset-idletime",
@@ -203,7 +214,8 @@ create_monitor_skeleton (GDBusObjectManagerServer *manager,
   object = meta_dbus_object_skeleton_new (path);
   meta_dbus_object_skeleton_set_idle_monitor (object, skeleton);
 
-  g_dbus_object_manager_server_export (manager, G_DBUS_OBJECT_SKELETON (object));
+  g_dbus_object_manager_server_export (manager,
+                                       G_DBUS_OBJECT_SKELETON (object));
 
   g_object_unref (skeleton);
   g_object_unref (object);
@@ -214,7 +226,6 @@ on_device_added (ClutterDeviceManager     *device_manager,
                  ClutterInputDevice       *device,
                  GDBusObjectManagerServer *manager)
 {
-
   MetaIdleMonitor *monitor;
   int device_id;
   char *path;
@@ -254,8 +265,9 @@ on_bus_acquired (GDBusConnection *connection,
 
   manager = g_dbus_object_manager_server_new ("/org/gnome/Mutter/IdleMonitor");
 
-  /* We never clear the core monitor, as that's supposed to cumulate idle times from
-     all devices */
+  /* We never clear the core monitor, as that's supposed to cumulate idle times
+   * from
+   *  all devices */
   monitor = meta_idle_monitor_get_core ();
   path = g_strdup ("/org/gnome/Mutter/IdleMonitor/Core");
   create_monitor_skeleton (manager, monitor, path);
diff --git a/src/backends/meta-idle-monitor.c b/src/backends/meta-idle-monitor.c
index 6673fe06c..dc3737b1f 100644
--- a/src/backends/meta-idle-monitor.c
+++ b/src/backends/meta-idle-monitor.c
@@ -41,7 +41,7 @@
 #include "meta/meta-idle-monitor.h"
 #include "meta/util.h"
 
-G_STATIC_ASSERT(sizeof(unsigned long) == sizeof(gpointer));
+G_STATIC_ASSERT (sizeof (unsigned long) == sizeof (gpointer));
 
 enum
 {
@@ -149,8 +149,10 @@ meta_idle_monitor_class_init (MetaIdleMonitorClass *klass)
                       "Device ID",
                       "The device to listen to idletime on",
                       0, 255, 0,
-                      G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
-  g_object_class_install_property (object_class, PROP_DEVICE_ID, obj_props[PROP_DEVICE_ID]);
+                      G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE |
+                      G_PARAM_CONSTRUCT_ONLY);
+  g_object_class_install_property (object_class, PROP_DEVICE_ID,
+                                   obj_props[PROP_DEVICE_ID]);
 }
 
 static void
@@ -213,15 +215,16 @@ update_inhibited (MetaIdleMonitor *monitor,
 }
 
 static void
-meta_idle_monitor_inhibited_actions_changed (GDBusProxy  *session,
-                                             GVariant    *changed,
-                                             char       **invalidated,
-                                             gpointer     user_data)
+meta_idle_monitor_inhibited_actions_changed (GDBusProxy *session,
+                                             GVariant   *changed,
+                                             char      **invalidated,
+                                             gpointer    user_data)
 {
   MetaIdleMonitor *monitor = user_data;
   GVariant *v;
 
-  v = g_variant_lookup_value (changed, "InhibitedActions", G_VARIANT_TYPE_UINT32);
+  v =
+    g_variant_lookup_value (changed, "InhibitedActions", G_VARIANT_TYPE_UINT32);
   if (v)
     {
       gboolean inhibited;
@@ -311,9 +314,9 @@ get_next_watch_serial (void)
 }
 
 static gboolean
-idle_monitor_dispatch_timeout (GSource     *source,
-                               GSourceFunc  callback,
-                               gpointer     user_data)
+idle_monitor_dispatch_timeout (GSource    *source,
+                               GSourceFunc callback,
+                               gpointer    user_data)
 {
   MetaIdleMonitorWatch *watch = (MetaIdleMonitorWatch *) user_data;
 
@@ -323,7 +326,8 @@ idle_monitor_dispatch_timeout (GSource     *source,
   return TRUE;
 }
 
-static GSourceFuncs idle_monitor_source_funcs = {
+static GSourceFuncs idle_monitor_source_funcs =
+{
   .prepare = NULL,
   .check = NULL,
   .dispatch = idle_monitor_dispatch_timeout,
@@ -331,11 +335,11 @@ static GSourceFuncs idle_monitor_source_funcs = {
 };
 
 static MetaIdleMonitorWatch *
-make_watch (MetaIdleMonitor           *monitor,
-            guint64                    timeout_msec,
-            MetaIdleMonitorWatchFunc   callback,
-            gpointer                   user_data,
-            GDestroyNotify             notify)
+make_watch (MetaIdleMonitor         *monitor,
+            guint64                  timeout_msec,
+            MetaIdleMonitorWatchFunc callback,
+            gpointer                 user_data,
+            GDestroyNotify           notify)
 {
   MetaIdleMonitorWatch *watch;
 
@@ -395,11 +399,11 @@ make_watch (MetaIdleMonitor           *monitor,
  * meta_idle_monitor_add_user_active_watch().
  */
 guint
-meta_idle_monitor_add_idle_watch (MetaIdleMonitor             *monitor,
-                                  guint64                      interval_msec,
-                                  MetaIdleMonitorWatchFunc      callback,
-                                  gpointer                     user_data,
-                                  GDestroyNotify               notify)
+meta_idle_monitor_add_idle_watch (MetaIdleMonitor         *monitor,
+                                  guint64                  interval_msec,
+                                  MetaIdleMonitorWatchFunc callback,
+                                  gpointer                 user_data,
+                                  GDestroyNotify           notify)
 {
   MetaIdleMonitorWatch *watch;
 
@@ -432,10 +436,10 @@ meta_idle_monitor_add_idle_watch (MetaIdleMonitor        *monitor,
  * meta_idle_monitor_add_idle_watch(), has triggered.
  */
 guint
-meta_idle_monitor_add_user_active_watch (MetaIdleMonitor          *monitor,
-                                         MetaIdleMonitorWatchFunc  callback,
-                                         gpointer                 user_data,
-                                         GDestroyNotify                   notify)
+meta_idle_monitor_add_user_active_watch (MetaIdleMonitor         *monitor,
+                                         MetaIdleMonitorWatchFunc callback,
+                                         gpointer                 user_data,
+                                         GDestroyNotify           notify)
 {
   MetaIdleMonitorWatch *watch;
 
@@ -461,7 +465,7 @@ meta_idle_monitor_add_user_active_watch (MetaIdleMonitor          *monitor,
  */
 void
 meta_idle_monitor_remove_watch (MetaIdleMonitor *monitor,
-                                guint           id)
+                                guint            id)
 {
   g_return_if_fail (META_IS_IDLE_MONITOR (monitor));
 
diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c
index 1d1a9ae35..998619bae 100644
--- a/src/backends/meta-input-settings.c
+++ b/src/backends/meta-input-settings.c
@@ -90,7 +90,8 @@ struct _MetaInputSettingsPrivate
   GHashTable *two_finger_devices;
 
   /* Pad ring/strip emission */
-  struct {
+  struct
+  {
     ClutterInputDevice *pad;
     MetaPadActionType action;
     guint number;
@@ -108,7 +109,8 @@ typedef void (*ConfigUintFunc)   (MetaInputSettings  *input_settings,
                                   ClutterInputDevice *device,
                                   guint               value);
 
-typedef enum {
+typedef enum
+{
   META_PAD_DIRECTION_NONE = -1,
   META_PAD_DIRECTION_UP = 0,
   META_PAD_DIRECTION_DOWN,
@@ -116,11 +118,12 @@ typedef enum {
   META_PAD_DIRECTION_CCW,
 } MetaPadDirection;
 
-G_DEFINE_TYPE_WITH_PRIVATE (MetaInputSettings, meta_input_settings, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (MetaInputSettings, meta_input_settings,
+                            G_TYPE_OBJECT)
 
 static GSList *
-meta_input_settings_get_devices (MetaInputSettings      *settings,
-                                 ClutterInputDeviceType  type)
+meta_input_settings_get_devices (MetaInputSettings * settings,
+                                 ClutterInputDeviceType type)
 {
   MetaInputSettingsPrivate *priv;
   const GSList *devices;
@@ -134,7 +137,8 @@ meta_input_settings_get_devices (MetaInputSettings      *settings,
       ClutterInputDevice *device = devices->data;
 
       if (clutter_input_device_get_device_type (device) == type &&
-          clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_MASTER)
+          clutter_input_device_get_device_mode (device) !=
+          CLUTTER_INPUT_MODE_MASTER)
         list = g_slist_prepend (list, device);
 
       devices = devices->next;
@@ -147,7 +151,8 @@ static void
 meta_input_settings_dispose (GObject *object)
 {
   MetaInputSettings *settings = META_INPUT_SETTINGS (object);
-  MetaInputSettingsPrivate *priv = meta_input_settings_get_instance_private (settings);
+  MetaInputSettingsPrivate *priv = meta_input_settings_get_instance_private (
+    settings);
 
   g_clear_object (&priv->virtual_pad_keyboard);
 
@@ -189,10 +194,10 @@ settings_device_set_bool_setting (MetaInputSettings  *input_settings,
 }
 
 static void
-settings_set_bool_setting (MetaInputSettings      *input_settings,
-                           ClutterInputDeviceType  type,
-                           ConfigBoolFunc          func,
-                           gboolean                enabled)
+settings_set_bool_setting (MetaInputSettings     *input_settings,
+                           ClutterInputDeviceType type,
+                           ConfigBoolFunc         func,
+                           gboolean               enabled)
 {
   GSList *devices, *d;
 
@@ -214,10 +219,10 @@ settings_device_set_double_setting (MetaInputSettings  *input_settings,
 }
 
 static void
-settings_set_double_setting (MetaInputSettings      *input_settings,
-                             ClutterInputDeviceType  type,
-                             ConfigDoubleFunc        func,
-                             gdouble                 value)
+settings_set_double_setting (MetaInputSettings     *input_settings,
+                             ClutterInputDeviceType type,
+                             ConfigDoubleFunc       func,
+                             gdouble                value)
 {
   GSList *devices, *d;
 
@@ -239,10 +244,10 @@ settings_device_set_uint_setting (MetaInputSettings  *input_settings,
 }
 
 static void
-settings_set_uint_setting (MetaInputSettings      *input_settings,
-                           ClutterInputDeviceType  type,
-                           ConfigUintFunc          func,
-                           guint                   value)
+settings_set_uint_setting (MetaInputSettings     *input_settings,
+                           ClutterInputDeviceType type,
+                           ConfigUintFunc         func,
+                           guint                  value)
 {
   GSList *devices, *d;
 
@@ -397,8 +402,8 @@ update_pointer_accel_profile (MetaInputSettings  *input_settings,
 }
 
 static GSettings *
-get_settings_for_device_type (MetaInputSettings      *input_settings,
-                              ClutterInputDeviceType  type)
+get_settings_for_device_type (MetaInputSettings     *input_settings,
+                              ClutterInputDeviceType type)
 {
   MetaInputSettingsPrivate *priv;
   priv = meta_input_settings_get_instance_private (input_settings);
@@ -414,8 +419,8 @@ get_settings_for_device_type (MetaInputSettings      *input_settings,
 }
 
 static void
-update_device_speed (MetaInputSettings      *input_settings,
-                     ClutterInputDevice     *device)
+update_device_speed (MetaInputSettings  *input_settings,
+                     ClutterInputDevice *device)
 {
   GSettings *settings;
   ConfigDoubleFunc func;
@@ -426,27 +431,32 @@ update_device_speed (MetaInputSettings      *input_settings,
   if (device)
     {
       settings = get_settings_for_device_type (input_settings,
-                                               clutter_input_device_get_device_type (device));
+                                               clutter_input_device_get_device_type (
+                                                 device));
       if (!settings)
         return;
 
       settings_device_set_double_setting (input_settings, device, func,
-                                          g_settings_get_double (settings, key));
+                                          g_settings_get_double (settings,
+                                                                 key));
     }
   else
     {
-      settings = get_settings_for_device_type (input_settings, CLUTTER_POINTER_DEVICE);
+      settings = get_settings_for_device_type (input_settings,
+                                               CLUTTER_POINTER_DEVICE);
       settings_set_double_setting (input_settings, CLUTTER_POINTER_DEVICE, func,
                                    g_settings_get_double (settings, key));
-      settings = get_settings_for_device_type (input_settings, CLUTTER_TOUCHPAD_DEVICE);
-      settings_set_double_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE, func,
+      settings = get_settings_for_device_type (input_settings,
+                                               CLUTTER_TOUCHPAD_DEVICE);
+      settings_set_double_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE,
+                                   func,
                                    g_settings_get_double (settings, key));
     }
 }
 
 static void
-update_device_natural_scroll (MetaInputSettings      *input_settings,
-                              ClutterInputDevice     *device)
+update_device_natural_scroll (MetaInputSettings  *input_settings,
+                              ClutterInputDevice *device)
 {
   GSettings *settings;
   ConfigBoolFunc func;
@@ -457,7 +467,8 @@ update_device_natural_scroll (MetaInputSettings      *input_settings,
   if (device)
     {
       settings = get_settings_for_device_type (input_settings,
-                                               clutter_input_device_get_device_type (device));
+                                               clutter_input_device_get_device_type (
+                                                 device));
       if (!settings)
         return;
 
@@ -466,10 +477,12 @@ update_device_natural_scroll (MetaInputSettings      *input_settings,
     }
   else
     {
-      settings = get_settings_for_device_type (input_settings, CLUTTER_POINTER_DEVICE);
+      settings = get_settings_for_device_type (input_settings,
+                                               CLUTTER_POINTER_DEVICE);
       settings_set_bool_setting (input_settings, CLUTTER_POINTER_DEVICE, func,
                                  g_settings_get_boolean (settings, key));
-      settings = get_settings_for_device_type (input_settings, CLUTTER_TOUCHPAD_DEVICE);
+      settings = get_settings_for_device_type (input_settings,
+                                               CLUTTER_TOUCHPAD_DEVICE);
       settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE, func,
                                  g_settings_get_boolean (settings, key));
     }
@@ -494,9 +507,10 @@ update_touchpad_disable_while_typing (MetaInputSettings  *input_settings,
   enabled = g_settings_get_boolean (priv->touchpad_settings, key);
 
   if (device)
-   {
+    {
       settings = get_settings_for_device_type (input_settings,
-                                               clutter_input_device_get_device_type (device));
+                                               clutter_input_device_get_device_type (
+                                                 device));
 
       if (!settings)
         return;
@@ -574,7 +588,7 @@ update_touchpad_tap_and_drag_enabled (MetaInputSettings  *input_settings,
 }
 
 static void
-update_touchpad_edge_scroll (MetaInputSettings *input_settings,
+update_touchpad_edge_scroll (MetaInputSettings  *input_settings,
                              ClutterInputDevice *device)
 {
   MetaInputSettingsClass *input_settings_class;
@@ -589,12 +603,16 @@ update_touchpad_edge_scroll (MetaInputSettings *input_settings,
 
   priv = meta_input_settings_get_instance_private (input_settings);
   input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
-  edge_scroll_enabled = g_settings_get_boolean (priv->touchpad_settings, "edge-scrolling-enabled");
-  two_finger_scroll_enabled = g_settings_get_boolean (priv->touchpad_settings, 
"two-finger-scrolling-enabled");
-  two_finger_scroll_available = g_hash_table_size (priv->two_finger_devices) > 0;
+  edge_scroll_enabled = g_settings_get_boolean (priv->touchpad_settings,
+                                                "edge-scrolling-enabled");
+  two_finger_scroll_enabled = g_settings_get_boolean (priv->touchpad_settings,
+                                                      "two-finger-scrolling-enabled");
+  two_finger_scroll_available = g_hash_table_size (priv->two_finger_devices) >
+                                0;
 
   /* If both are enabled we prefer two finger. */
-  if (edge_scroll_enabled && two_finger_scroll_enabled && two_finger_scroll_available)
+  if (edge_scroll_enabled && two_finger_scroll_enabled &&
+      two_finger_scroll_available)
     edge_scroll_enabled = FALSE;
 
   if (device)
@@ -612,7 +630,7 @@ update_touchpad_edge_scroll (MetaInputSettings *input_settings,
 }
 
 static void
-update_touchpad_two_finger_scroll (MetaInputSettings *input_settings,
+update_touchpad_two_finger_scroll (MetaInputSettings  *input_settings,
                                    ClutterInputDevice *device)
 {
   MetaInputSettingsClass *input_settings_class;
@@ -625,7 +643,8 @@ update_touchpad_two_finger_scroll (MetaInputSettings *input_settings,
 
   priv = meta_input_settings_get_instance_private (input_settings);
   input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
-  two_finger_scroll_enabled = g_settings_get_boolean (priv->touchpad_settings, 
"two-finger-scrolling-enabled");
+  two_finger_scroll_enabled = g_settings_get_boolean (priv->touchpad_settings,
+                                                      "two-finger-scrolling-enabled");
 
   /* Disable edge since they can't both be set. */
   if (two_finger_scroll_enabled)
@@ -650,7 +669,7 @@ update_touchpad_two_finger_scroll (MetaInputSettings *input_settings,
 }
 
 static void
-update_touchpad_click_method (MetaInputSettings *input_settings,
+update_touchpad_click_method (MetaInputSettings  *input_settings,
                               ClutterInputDevice *device)
 {
   MetaInputSettingsClass *input_settings_class;
@@ -720,12 +739,14 @@ update_trackball_scroll_button (MetaInputSettings  *input_settings,
   priv = meta_input_settings_get_instance_private (input_settings);
   input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
 
-  if (device && !input_settings_class->is_trackball_device (input_settings, device))
+  if (device &&
+      !input_settings_class->is_trackball_device (input_settings, device))
     return;
 
   /* This key is 'i' in the schema but it also specifies a minimum
    * range of 0 so the cast here is safe. */
-  button = (guint) g_settings_get_int (priv->trackball_settings, "scroll-wheel-emulation-button");
+  button = (guint) g_settings_get_int (priv->trackball_settings,
+                                       "scroll-wheel-emulation-button");
 
   if (device)
     {
@@ -741,8 +762,10 @@ update_trackball_scroll_button (MetaInputSettings  *input_settings,
         {
           device = devices->data;
 
-          if (input_settings_class->is_trackball_device (input_settings, device))
-            input_settings_class->set_scroll_button (input_settings, device, button);
+          if (input_settings_class->is_trackball_device (input_settings,
+                                                         device))
+            input_settings_class->set_scroll_button (input_settings, device,
+                                                     button);
 
           devices = devices->next;
         }
@@ -868,7 +891,8 @@ update_tablet_keep_aspect (MetaInputSettings  *input_settings,
                                                                 device);
     /* Keep aspect only makes sense in external tablets */
     if (wacom_device &&
-        libwacom_get_integration_flags (wacom_device) != WACOM_DEVICE_INTEGRATED_NONE)
+        libwacom_get_integration_flags (wacom_device) !=
+        WACOM_DEVICE_INTEGRATED_NONE)
       return;
   }
 #endif
@@ -905,14 +929,16 @@ update_device_display (MetaInputSettings  *input_settings,
   if (clutter_input_device_get_device_type (device) != CLUTTER_TABLET_DEVICE &&
       clutter_input_device_get_device_type (device) != CLUTTER_PEN_DEVICE &&
       clutter_input_device_get_device_type (device) != CLUTTER_ERASER_DEVICE &&
-      clutter_input_device_get_device_type (device) != CLUTTER_TOUCHSCREEN_DEVICE)
+      clutter_input_device_get_device_type (device) !=
+      CLUTTER_TOUCHSCREEN_DEVICE)
     return;
 
   priv = meta_input_settings_get_instance_private (input_settings);
   input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
 
   /* If mapping is relative, the device can move on all displays */
-  if (clutter_input_device_get_device_type (device) == CLUTTER_TOUCHSCREEN_DEVICE ||
+  if (clutter_input_device_get_device_type (device) ==
+      CLUTTER_TOUCHSCREEN_DEVICE ||
       clutter_input_device_get_mapping_mode (device) ==
       CLUTTER_INPUT_DEVICE_MAPPING_ABSOLUTE)
     meta_input_settings_find_monitor (input_settings, settings, device,
@@ -949,7 +975,8 @@ update_tablet_mapping (MetaInputSettings  *input_settings,
                                                                 device);
     /* Tablet mapping only makes sense on external tablets */
     if (wacom_device &&
-        (libwacom_get_integration_flags (wacom_device) != WACOM_DEVICE_INTEGRATED_NONE))
+        (libwacom_get_integration_flags (wacom_device) !=
+         WACOM_DEVICE_INTEGRATED_NONE))
       return;
   }
 #endif
@@ -990,7 +1017,8 @@ update_tablet_area (MetaInputSettings  *input_settings,
     /* Tablet area only makes sense on system/display integrated tablets */
     if (wacom_device &&
         (libwacom_get_integration_flags (wacom_device) &
-         (WACOM_DEVICE_INTEGRATED_SYSTEM | WACOM_DEVICE_INTEGRATED_DISPLAY)) == 0)
+         (WACOM_DEVICE_INTEGRATED_SYSTEM | WACOM_DEVICE_INTEGRATED_DISPLAY)) ==
+        0)
       return;
   }
 #endif
@@ -1031,7 +1059,8 @@ update_tablet_left_handed (MetaInputSettings  *input_settings,
                                                                 device);
     /* Left handed mode only makes sense on external tablets */
     if (wacom_device &&
-        (libwacom_get_integration_flags (wacom_device) != WACOM_DEVICE_INTEGRATED_NONE))
+        (libwacom_get_integration_flags (wacom_device) !=
+         WACOM_DEVICE_INTEGRATED_NONE))
       return;
   }
 #endif
@@ -1050,7 +1079,8 @@ meta_input_settings_changed_cb (GSettings  *settings,
                                 gpointer    user_data)
 {
   MetaInputSettings *input_settings = META_INPUT_SETTINGS (user_data);
-  MetaInputSettingsPrivate *priv = meta_input_settings_get_instance_private (input_settings);
+  MetaInputSettingsPrivate *priv = meta_input_settings_get_instance_private (
+    input_settings);
 
   if (settings == priv->mouse_settings)
     {
@@ -1075,7 +1105,7 @@ meta_input_settings_changed_cb (GSettings  *settings,
         update_touchpad_tap_enabled (input_settings, NULL);
       else if (strcmp (key, "tap-and-drag") == 0)
         update_touchpad_tap_and_drag_enabled (input_settings, NULL);
-      else if (strcmp(key, "disable-while-typing") == 0)
+      else if (strcmp (key, "disable-while-typing") == 0)
         update_touchpad_disable_while_typing (input_settings, NULL);
       else if (strcmp (key, "send-events") == 0)
         update_touchpad_send_events (input_settings, NULL);
@@ -1140,23 +1170,25 @@ apply_mappable_device_settings (MetaInputSettings *input_settings,
     }
 }
 
-struct _a11y_settings_flags_pair {
+struct _a11y_settings_flags_pair
+{
   const char *name;
   ClutterKeyboardA11yFlags flag;
-} settings_flags_pair[] = {
-  { "enable",                    CLUTTER_A11Y_KEYBOARD_ENABLED },
-  { "timeout-enable",            CLUTTER_A11Y_TIMEOUT_ENABLED },
-  { "mousekeys-enable",          CLUTTER_A11Y_MOUSE_KEYS_ENABLED },
-  { "slowkeys-enable",           CLUTTER_A11Y_SLOW_KEYS_ENABLED },
-  { "slowkeys-beep-press",       CLUTTER_A11Y_SLOW_KEYS_BEEP_PRESS },
-  { "slowkeys-beep-accept",      CLUTTER_A11Y_SLOW_KEYS_BEEP_ACCEPT },
-  { "slowkeys-beep-reject",      CLUTTER_A11Y_SLOW_KEYS_BEEP_REJECT },
-  { "bouncekeys-enable",         CLUTTER_A11Y_BOUNCE_KEYS_ENABLED },
-  { "bouncekeys-beep-reject",    CLUTTER_A11Y_BOUNCE_KEYS_BEEP_REJECT },
-  { "togglekeys-enable",         CLUTTER_A11Y_TOGGLE_KEYS_ENABLED },
-  { "stickykeys-enable",         CLUTTER_A11Y_STICKY_KEYS_ENABLED },
-  { "stickykeys-modifier-beep",  CLUTTER_A11Y_STICKY_KEYS_BEEP },
-  { "stickykeys-two-key-off",    CLUTTER_A11Y_STICKY_KEYS_TWO_KEY_OFF },
+} settings_flags_pair[] =
+{
+  { "enable", CLUTTER_A11Y_KEYBOARD_ENABLED },
+  { "timeout-enable", CLUTTER_A11Y_TIMEOUT_ENABLED },
+  { "mousekeys-enable", CLUTTER_A11Y_MOUSE_KEYS_ENABLED },
+  { "slowkeys-enable", CLUTTER_A11Y_SLOW_KEYS_ENABLED },
+  { "slowkeys-beep-press", CLUTTER_A11Y_SLOW_KEYS_BEEP_PRESS },
+  { "slowkeys-beep-accept", CLUTTER_A11Y_SLOW_KEYS_BEEP_ACCEPT },
+  { "slowkeys-beep-reject", CLUTTER_A11Y_SLOW_KEYS_BEEP_REJECT },
+  { "bouncekeys-enable", CLUTTER_A11Y_BOUNCE_KEYS_ENABLED },
+  { "bouncekeys-beep-reject", CLUTTER_A11Y_BOUNCE_KEYS_BEEP_REJECT },
+  { "togglekeys-enable", CLUTTER_A11Y_TOGGLE_KEYS_ENABLED },
+  { "stickykeys-enable", CLUTTER_A11Y_STICKY_KEYS_ENABLED },
+  { "stickykeys-modifier-beep", CLUTTER_A11Y_STICKY_KEYS_BEEP },
+  { "stickykeys-two-key-off", CLUTTER_A11Y_STICKY_KEYS_TWO_KEY_OFF },
   { "feature-state-change-beep", CLUTTER_A11Y_FEATURE_STATE_CHANGE_BEEP },
 };
 
@@ -1164,19 +1196,22 @@ static void
 load_keyboard_a11y_settings (MetaInputSettings  *input_settings,
                              ClutterInputDevice *device)
 {
-  MetaInputSettingsPrivate *priv = meta_input_settings_get_instance_private (input_settings);
+  MetaInputSettingsPrivate *priv = meta_input_settings_get_instance_private (
+    input_settings);
   ClutterKbdA11ySettings kbd_a11y_settings;
   ClutterInputDevice *core_keyboard;
   guint i;
 
-  core_keyboard = clutter_device_manager_get_core_device (priv->device_manager, CLUTTER_KEYBOARD_DEVICE);
+  core_keyboard = clutter_device_manager_get_core_device (priv->device_manager,
+                                                          CLUTTER_KEYBOARD_DEVICE);
   if (device && device != core_keyboard)
     return;
 
   kbd_a11y_settings.controls = 0;
   for (i = 0; i < G_N_ELEMENTS (settings_flags_pair); i++)
     {
-      if (g_settings_get_boolean (priv->a11y_settings, settings_flags_pair[i].name))
+      if (g_settings_get_boolean (priv->a11y_settings,
+                                  settings_flags_pair[i].name))
         kbd_a11y_settings.controls |= settings_flags_pair[i].flag;
     }
 
@@ -1186,14 +1221,18 @@ load_keyboard_a11y_settings (MetaInputSettings  *input_settings,
                                                          "slowkeys-delay");
   kbd_a11y_settings.debounce_delay = g_settings_get_int (priv->a11y_settings,
                                                          "bouncekeys-delay");
-  kbd_a11y_settings.mousekeys_init_delay = g_settings_get_int (priv->a11y_settings,
-                                                               "mousekeys-init-delay");
-  kbd_a11y_settings.mousekeys_max_speed = g_settings_get_int (priv->a11y_settings,
-                                                              "mousekeys-max-speed");
-  kbd_a11y_settings.mousekeys_accel_time = g_settings_get_int (priv->a11y_settings,
-                                                               "mousekeys-accel-time");
+  kbd_a11y_settings.mousekeys_init_delay = g_settings_get_int (
+    priv->a11y_settings,
+    "mousekeys-init-delay");
+  kbd_a11y_settings.mousekeys_max_speed = g_settings_get_int (
+    priv->a11y_settings,
+    "mousekeys-max-speed");
+  kbd_a11y_settings.mousekeys_accel_time = g_settings_get_int (
+    priv->a11y_settings,
+    "mousekeys-accel-time");
 
-  clutter_device_manager_set_kbd_a11y_settings (priv->device_manager, &kbd_a11y_settings);
+  clutter_device_manager_set_kbd_a11y_settings (priv->device_manager,
+                                                &kbd_a11y_settings);
 }
 
 static void
@@ -1202,7 +1241,8 @@ on_keyboard_a11y_settings_changed (ClutterDeviceManager    *device_manager,
                                    ClutterKeyboardA11yFlags what_changed,
                                    MetaInputSettings       *input_settings)
 {
-  MetaInputSettingsPrivate *priv = meta_input_settings_get_instance_private (input_settings);
+  MetaInputSettingsPrivate *priv = meta_input_settings_get_instance_private (
+    input_settings);
   guint i;
 
   for (i = 0; i < G_N_ELEMENTS (settings_flags_pair); i++)
@@ -1210,7 +1250,8 @@ on_keyboard_a11y_settings_changed (ClutterDeviceManager    *device_manager,
       if (settings_flags_pair[i].flag & what_changed)
         g_settings_set_boolean (priv->a11y_settings,
                                 settings_flags_pair[i].name,
-                                (new_flags & settings_flags_pair[i].flag) ? TRUE : FALSE);
+                                (new_flags &
+                                 settings_flags_pair[i].flag) ? TRUE : FALSE);
     }
 }
 
@@ -1278,13 +1319,15 @@ lookup_tool_settings (ClutterInputDeviceTool *tool,
 
   if (serial == 0)
     {
-      path = g_strdup_printf ("/org/gnome/desktop/peripherals/stylus/default-%s:%s/",
-                              clutter_input_device_get_vendor_id (device),
-                              clutter_input_device_get_product_id (device));
+      path = g_strdup_printf (
+        "/org/gnome/desktop/peripherals/stylus/default-%s:%s/",
+        clutter_input_device_get_vendor_id (device),
+        clutter_input_device_get_product_id (device));
     }
   else
     {
-      path = g_strdup_printf ("/org/gnome/desktop/peripherals/stylus/%lx/", serial);
+      path = g_strdup_printf ("/org/gnome/desktop/peripherals/stylus/%lx/",
+                              serial);
     }
 
   tool_settings =
@@ -1336,7 +1379,8 @@ lookup_pad_action_settings (ClutterInputDevice *device,
     }
 
   path = g_string_new (NULL);
-  g_string_append_printf (path, "/org/gnome/desktop/peripherals/tablets/%s:%s/%s%c",
+  g_string_append_printf (path,
+                          "/org/gnome/desktop/peripherals/tablets/%s:%s/%s%c",
                           vendor, product, action_type, action_label);
 
   if (detail_type)
@@ -1347,8 +1391,9 @@ lookup_pad_action_settings (ClutterInputDevice *device,
 
   g_string_append_c (path, '/');
 
-  settings = g_settings_new_with_path ("org.gnome.desktop.peripherals.tablet.pad-button",
-                                       path->str);
+  settings = g_settings_new_with_path (
+    "org.gnome.desktop.peripherals.tablet.pad-button",
+    path->str);
   g_string_free (path, TRUE);
 
   return settings;
@@ -1421,7 +1466,8 @@ check_add_mappable_device (MetaInputSettings  *input_settings,
       WacomError *error = libwacom_error_new ();
 
       info->wacom_device = libwacom_new_from_path (priv->wacom_db,
-                                                   clutter_input_device_get_device_node (device),
+                                                   clutter_input_device_get_device_node (
+                                                     device),
                                                    WFALLBACK_NONE, error);
       if (!info->wacom_device)
         {
@@ -1514,7 +1560,8 @@ update_stylus_pressure (MetaInputSettings      *input_settings,
     return;
 
   input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
-  input_settings_class->set_stylus_pressure (input_settings, device, tool, curve);
+  input_settings_class->set_stylus_pressure (input_settings, device, tool,
+                                             curve);
 }
 
 static void
@@ -1576,7 +1623,8 @@ meta_input_settings_device_added (ClutterDeviceManager *device_manager,
                                   ClutterInputDevice   *device,
                                   MetaInputSettings    *input_settings)
 {
-  if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER)
+  if (clutter_input_device_get_device_mode (device) ==
+      CLUTTER_INPUT_MODE_MASTER)
     return;
 
   evaluate_two_finger_scrolling (input_settings, device);
@@ -1674,7 +1722,8 @@ check_mappable_devices (MetaInputSettings *input_settings)
     {
       ClutterInputDevice *device = l->data;
 
-      if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER)
+      if (clutter_input_device_get_device_mode (device) ==
+          CLUTTER_INPUT_MODE_MASTER)
         continue;
 
       check_add_mappable_device (input_settings, device);
@@ -1687,7 +1736,8 @@ meta_input_settings_constructed (GObject *object)
   MetaInputSettings *input_settings = META_INPUT_SETTINGS (object);
   GSList *devices, *d;
 
-  devices = meta_input_settings_get_devices (input_settings, CLUTTER_TOUCHPAD_DEVICE);
+  devices = meta_input_settings_get_devices (input_settings,
+                                             CLUTTER_TOUCHPAD_DEVICE);
   for (d = devices; d; d = d->next)
     evaluate_two_finger_scrolling (input_settings, d->data);
 
@@ -1728,22 +1778,26 @@ meta_input_settings_init (MetaInputSettings *settings)
   g_signal_connect (priv->mouse_settings, "changed",
                     G_CALLBACK (meta_input_settings_changed_cb), settings);
 
-  priv->touchpad_settings = g_settings_new ("org.gnome.desktop.peripherals.touchpad");
+  priv->touchpad_settings = g_settings_new (
+    "org.gnome.desktop.peripherals.touchpad");
   g_signal_connect (priv->touchpad_settings, "changed",
                     G_CALLBACK (meta_input_settings_changed_cb), settings);
 
-  priv->trackball_settings = g_settings_new ("org.gnome.desktop.peripherals.trackball");
+  priv->trackball_settings = g_settings_new (
+    "org.gnome.desktop.peripherals.trackball");
   g_signal_connect (priv->trackball_settings, "changed",
                     G_CALLBACK (meta_input_settings_changed_cb), settings);
 
-  priv->keyboard_settings = g_settings_new ("org.gnome.desktop.peripherals.keyboard");
+  priv->keyboard_settings = g_settings_new (
+    "org.gnome.desktop.peripherals.keyboard");
   g_signal_connect (priv->keyboard_settings, "changed",
                     G_CALLBACK (meta_input_settings_changed_cb), settings);
 
-  priv->gsd_settings = g_settings_new ("org.gnome.settings-daemon.peripherals.mouse");
+  priv->gsd_settings = g_settings_new (
+    "org.gnome.settings-daemon.peripherals.mouse");
 
   g_settings_bind (priv->gsd_settings, "double-click",
-                   clutter_settings_get_default(), "double-click-time",
+                   clutter_settings_get_default (), "double-click-time",
                    G_SETTINGS_BIND_GET);
 
   priv->a11y_settings = g_settings_new ("org.gnome.desktop.a11y.keyboard");
@@ -1753,10 +1807,12 @@ meta_input_settings_init (MetaInputSettings *settings)
                     G_CALLBACK (on_keyboard_a11y_settings_changed), settings);
 
   priv->mappable_devices =
-    g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) device_mapping_info_free);
+    g_hash_table_new_full (NULL, NULL, NULL,
+                           (GDestroyNotify) device_mapping_info_free);
 
   priv->current_tools =
-    g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) current_tool_info_free);
+    g_hash_table_new_full (NULL, NULL, NULL,
+                           (GDestroyNotify) current_tool_info_free);
 
   priv->monitor_manager = g_object_ref (meta_monitor_manager_get ());
   g_signal_connect (priv->monitor_manager, "monitors-changed-internal",
@@ -1831,9 +1887,9 @@ meta_input_settings_get_tablet_mapping (MetaInputSettings  *settings,
 }
 
 static GDesktopPadButtonAction
-meta_input_settings_get_pad_button_action (MetaInputSettings   *input_settings,
-                                           ClutterInputDevice  *pad,
-                                           guint                button)
+meta_input_settings_get_pad_button_action (MetaInputSettings  *input_settings,
+                                           ClutterInputDevice *pad,
+                                           guint               button)
 {
   GDesktopPadButtonAction action;
   GSettings *settings;
@@ -1853,7 +1909,7 @@ meta_input_settings_get_pad_button_action (MetaInputSettings   *input_settings,
 
 #ifdef HAVE_LIBWACOM
 WacomDevice *
-meta_input_settings_get_tablet_wacom_device (MetaInputSettings *settings,
+meta_input_settings_get_tablet_wacom_device (MetaInputSettings  *settings,
                                              ClutterInputDevice *device)
 {
   MetaInputSettingsPrivate *priv;
@@ -1917,8 +1973,10 @@ meta_input_settings_cycle_tablet_output (MetaInputSettings  *input_settings,
 
   g_return_if_fail (META_IS_INPUT_SETTINGS (input_settings));
   g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device));
-  g_return_if_fail (clutter_input_device_get_device_type (device) == CLUTTER_TABLET_DEVICE ||
-                    clutter_input_device_get_device_type (device) == CLUTTER_PAD_DEVICE);
+  g_return_if_fail (clutter_input_device_get_device_type (
+                      device) == CLUTTER_TABLET_DEVICE ||
+                    clutter_input_device_get_device_type (
+                      device) == CLUTTER_PAD_DEVICE);
 
   priv = meta_input_settings_get_instance_private (input_settings);
   info = g_hash_table_lookup (priv->mappable_devices, device);
@@ -1928,7 +1986,8 @@ meta_input_settings_cycle_tablet_output (MetaInputSettings  *input_settings,
   if (info->wacom_device)
     {
       /* Output rotation only makes sense on external tablets */
-      if (libwacom_get_integration_flags (info->wacom_device) != WACOM_DEVICE_INTEGRATED_NONE)
+      if (libwacom_get_integration_flags (info->wacom_device) !=
+          WACOM_DEVICE_INTEGRATED_NONE)
         return;
 
       pretty_name = libwacom_get_name (info->wacom_device);
@@ -1971,10 +2030,12 @@ emulate_modifiers (ClutterVirtualInputDevice *device,
                    ClutterKeyState            state)
 {
   guint i;
-  struct {
+  struct
+  {
     ClutterModifierType mod;
     guint keyval;
-  } mod_map[] = {
+  } mod_map[] =
+  {
     { CLUTTER_SHIFT_MASK, CLUTTER_KEY_Shift_L },
     { CLUTTER_CONTROL_MASK, CLUTTER_KEY_Control_L },
     { CLUTTER_MOD1_MASK, CLUTTER_KEY_Meta_L }
@@ -1992,9 +2053,9 @@ emulate_modifiers (ClutterVirtualInputDevice *device,
 }
 
 static void
-meta_input_settings_emulate_keybinding (MetaInputSettings  *input_settings,
-                                        const gchar        *accel,
-                                        gboolean            is_press)
+meta_input_settings_emulate_keybinding (MetaInputSettings *input_settings,
+                                        const gchar       *accel,
+                                        gboolean           is_press)
 {
   MetaInputSettingsPrivate *priv;
   ClutterKeyState state;
@@ -2039,14 +2100,16 @@ meta_input_settings_is_pad_button_grabbed (MetaInputSettings  *input_settings,
   g_return_val_if_fail (clutter_input_device_get_device_type (pad) ==
                         CLUTTER_PAD_DEVICE, FALSE);
 
-  return (meta_input_settings_get_pad_button_action (input_settings, pad, button) !=
+  return (meta_input_settings_get_pad_button_action (input_settings, pad,
+                                                     button) !=
           G_DESKTOP_PAD_BUTTON_ACTION_NONE);
 }
 
 static gboolean
-meta_input_settings_handle_pad_button (MetaInputSettings           *input_settings,
-                                       ClutterInputDevice          *pad,
-                                       const ClutterPadButtonEvent *event)
+meta_input_settings_handle_pad_button (
+  MetaInputSettings           *input_settings,
+  ClutterInputDevice          *pad,
+  const ClutterPadButtonEvent *event)
 {
   GDesktopPadButtonAction action;
   gint button, group, mode;
@@ -2082,7 +2145,8 @@ meta_input_settings_handle_pad_button (MetaInputSettings           *input_settin
       info->group_modes[group] = mode;
     }
 
-  action = meta_input_settings_get_pad_button_action (input_settings, pad, button);
+  action = meta_input_settings_get_pad_button_action (input_settings, pad,
+                                                      button);
 
   switch (action)
     {
@@ -2096,7 +2160,8 @@ meta_input_settings_handle_pad_button (MetaInputSettings           *input_settin
       return TRUE;
     case G_DESKTOP_PAD_BUTTON_ACTION_KEYBINDING:
       settings = lookup_pad_action_settings (pad, META_PAD_ACTION_BUTTON,
-                                             button, META_PAD_DIRECTION_NONE, -1);
+                                             button, META_PAD_DIRECTION_NONE,
+                                             -1);
       accel = g_settings_get_string (settings, "keybinding");
       meta_input_settings_emulate_keybinding (input_settings, accel, is_press);
       g_object_unref (settings);
@@ -2109,12 +2174,12 @@ meta_input_settings_handle_pad_button (MetaInputSettings           *input_settin
 }
 
 static gboolean
-meta_input_settings_handle_pad_action (MetaInputSettings         *input_settings,
-                                       ClutterInputDevice        *pad,
-                                       MetaPadActionType          action,
-                                       guint                      number,
-                                       MetaPadDirection           direction,
-                                       guint                      mode)
+meta_input_settings_handle_pad_action (MetaInputSettings  *input_settings,
+                                       ClutterInputDevice *pad,
+                                       MetaPadActionType   action,
+                                       guint               number,
+                                       MetaPadDirection    direction,
+                                       guint               mode)
 {
   GSettings *settings;
   gboolean handled = FALSE;
@@ -2137,9 +2202,10 @@ meta_input_settings_handle_pad_action (MetaInputSettings         *input_settings
 }
 
 static gboolean
-meta_input_settings_get_pad_action_direction (MetaInputSettings  *input_settings,
-                                              const ClutterEvent *event,
-                                              MetaPadDirection   *direction)
+meta_input_settings_get_pad_action_direction (
+  MetaInputSettings  *input_settings,
+  const ClutterEvent *event,
+  MetaPadDirection   *direction)
 {
   MetaInputSettingsPrivate *priv;
   ClutterInputDevice *pad = clutter_event_get_device (event);
@@ -2178,7 +2244,7 @@ meta_input_settings_get_pad_action_direction (MetaInputSettings  *input_settings
       value >= 0 && priv->last_pad_action_info.value >= 0)
     {
       *direction = (value - priv->last_pad_action_info.value) > 0 ?
-        inc_dir : dec_dir;
+                   inc_dir : dec_dir;
       has_direction = TRUE;
     }
 
@@ -2310,22 +2376,24 @@ meta_input_settings_get_button_label (MetaInputSettings  *input_settings,
       return g_strdup_printf (_("Mode Switch (Group %d)"), group);
     }
 
-  action = meta_input_settings_get_pad_button_action (input_settings, pad, button);
+  action = meta_input_settings_get_pad_button_action (input_settings, pad,
+                                                      button);
 
   switch (action)
     {
     case G_DESKTOP_PAD_BUTTON_ACTION_KEYBINDING:
-      {
-        GSettings *settings;
-        gchar *accel;
+    {
+      GSettings *settings;
+      gchar *accel;
 
-        settings = lookup_pad_action_settings (pad, META_PAD_ACTION_BUTTON,
-                                               button, META_PAD_DIRECTION_NONE, -1);
-        accel = g_settings_get_string (settings, "keybinding");
-        g_object_unref (settings);
+      settings = lookup_pad_action_settings (pad, META_PAD_ACTION_BUTTON,
+                                             button, META_PAD_DIRECTION_NONE,
+                                             -1);
+      accel = g_settings_get_string (settings, "keybinding");
+      g_object_unref (settings);
 
-        return accel;
-      }
+      return accel;
+    }
     case G_DESKTOP_PAD_BUTTON_ACTION_SWITCH_MONITOR:
       /* TRANSLATORS: This string refers to an action, cycles drawing tablets'
        * mapping through the available outputs.
diff --git a/src/backends/meta-logical-monitor.c b/src/backends/meta-logical-monitor.c
index 1b6151638..e6596eee8 100644
--- a/src/backends/meta-logical-monitor.c
+++ b/src/backends/meta-logical-monitor.c
@@ -30,8 +30,8 @@
 G_DEFINE_TYPE (MetaLogicalMonitor, meta_logical_monitor, G_TYPE_OBJECT)
 
 static MetaMonitor *
-get_first_monitor (MetaMonitorManager *monitor_manager,
-                   GList              *monitor_configs)
+get_first_monitor (MetaMonitorManager * monitor_manager,
+                   GList * monitor_configs)
 {
   MetaMonitorConfig *first_monitor_config;
   MetaMonitorSpec *first_monitor_spec;
@@ -89,9 +89,9 @@ meta_logical_monitor_new (MetaMonitorManager       *monitor_manager,
   logical_monitor->is_presentation = TRUE;
   g_list_foreach (monitor_configs, (GFunc) add_monitor_from_config,
                   &(AddMonitorFromConfigData) {
-                    .monitor_manager = monitor_manager,
-                    .logical_monitor = logical_monitor
-                  });
+    .monitor_manager = monitor_manager,
+    .logical_monitor = logical_monitor
+  });
 
   return logical_monitor;
 }
@@ -240,7 +240,8 @@ meta_logical_monitor_foreach_crtc (MetaLogicalMonitor        *logical_monitor,
     {
       MetaMonitor *monitor = l->data;
       MetaMonitorMode *mode;
-      ForeachCrtcData data = {
+      ForeachCrtcData data =
+      {
         .logical_monitor = logical_monitor,
         .func = func,
         .user_data = user_data
@@ -279,9 +280,9 @@ meta_logical_monitor_class_init (MetaLogicalMonitorClass *klass)
 }
 
 gboolean
-meta_logical_monitor_has_neighbor (MetaLogicalMonitor   *logical_monitor,
-                                   MetaLogicalMonitor   *neighbor,
-                                   MetaDisplayDirection  neighbor_direction)
+meta_logical_monitor_has_neighbor (MetaLogicalMonitor  *logical_monitor,
+                                   MetaLogicalMonitor  *neighbor,
+                                   MetaDisplayDirection neighbor_direction)
 {
   switch (neighbor_direction)
     {
diff --git a/src/backends/meta-monitor-config-manager.c b/src/backends/meta-monitor-config-manager.c
index a3e92f2e7..3a1bae911 100644
--- a/src/backends/meta-monitor-config-manager.c
+++ b/src/backends/meta-monitor-config-manager.c
@@ -330,14 +330,15 @@ meta_monitor_config_manager_assign (MetaMonitorManager *manager,
 static gboolean
 is_lid_closed (MetaMonitorManager *monitor_manager)
 {
-    MetaBackend *backend;
+  MetaBackend *backend;
 
-    backend = meta_monitor_manager_get_backend (monitor_manager);
-    return meta_backend_is_lid_closed (backend);
+  backend = meta_monitor_manager_get_backend (monitor_manager);
+  return meta_backend_is_lid_closed (backend);
 }
 
 MetaMonitorsConfigKey *
-meta_create_monitors_config_key_for_current_state (MetaMonitorManager *monitor_manager)
+meta_create_monitors_config_key_for_current_state (
+  MetaMonitorManager *monitor_manager)
 {
   MetaMonitorsConfigKey *config_key;
   GList *l;
@@ -399,7 +400,8 @@ meta_monitor_config_manager_get_stored (MetaMonitorConfigManager *config_manager
           g_warning ("Failed to finish monitors config migration: %s",
                      error->message);
           g_error_free (error);
-          meta_monitor_config_store_remove (config_manager->config_store, config);
+          meta_monitor_config_store_remove (config_manager->config_store,
+                                            config);
           return NULL;
         }
     }
@@ -414,8 +416,9 @@ typedef enum _MonitorMatchRule
 } MonitorMatchRule;
 
 static MetaMonitor *
-find_monitor_with_highest_preferred_resolution (MetaMonitorManager *monitor_manager,
-                                                MonitorMatchRule    match_rule)
+find_monitor_with_highest_preferred_resolution (
+  MetaMonitorManager *monitor_manager,
+  MonitorMatchRule    match_rule)
 {
   GList *monitors;
   GList *l;
@@ -517,12 +520,13 @@ create_monitor_config (MetaMonitor     *monitor,
 }
 
 static MetaLogicalMonitorConfig *
-create_preferred_logical_monitor_config (MetaMonitorManager          *monitor_manager,
-                                         MetaMonitor                 *monitor,
-                                         int                          x,
-                                         int                          y,
-                                         MetaLogicalMonitorConfig    *primary_logical_monitor_config,
-                                         MetaLogicalMonitorLayoutMode layout_mode)
+create_preferred_logical_monitor_config (
+  MetaMonitorManager          *monitor_manager,
+  MetaMonitor                 *monitor,
+  int                          x,
+  int                          y,
+  MetaLogicalMonitorConfig    *primary_logical_monitor_config,
+  MetaLogicalMonitorLayoutMode layout_mode)
 {
   MetaMonitorMode *mode;
   int width, height;
@@ -570,7 +574,8 @@ create_preferred_logical_monitor_config (MetaMonitorManager          *monitor_ma
 }
 
 MetaMonitorsConfig *
-meta_monitor_config_manager_create_linear (MetaMonitorConfigManager *config_manager)
+meta_monitor_config_manager_create_linear (
+  MetaMonitorConfigManager *config_manager)
 {
   MetaMonitorManager *monitor_manager = config_manager->monitor_manager;
   GList *logical_monitor_configs;
@@ -630,7 +635,8 @@ meta_monitor_config_manager_create_linear (MetaMonitorConfigManager *config_mana
 }
 
 MetaMonitorsConfig *
-meta_monitor_config_manager_create_fallback (MetaMonitorConfigManager *config_manager)
+meta_monitor_config_manager_create_fallback (
+  MetaMonitorConfigManager *config_manager)
 {
   MetaMonitorManager *monitor_manager = config_manager->monitor_manager;
   MetaMonitor *primary_monitor;
@@ -661,7 +667,8 @@ meta_monitor_config_manager_create_fallback (MetaMonitorConfigManager *config_ma
 }
 
 MetaMonitorsConfig *
-meta_monitor_config_manager_create_suggested (MetaMonitorConfigManager *config_manager)
+meta_monitor_config_manager_create_suggested (
+  MetaMonitorConfigManager *config_manager)
 {
   MetaMonitorManager *monitor_manager = config_manager->monitor_manager;
   MetaLogicalMonitorConfig *primary_logical_monitor_config = NULL;
@@ -717,7 +724,8 @@ meta_monitor_config_manager_create_suggested (MetaMonitorConfigManager *config_m
       if (meta_rectangle_overlaps_with_region (region,
                                                &logical_monitor_config->layout))
         {
-          g_warning ("Suggested monitor config has overlapping region, rejecting");
+          g_warning (
+            "Suggested monitor config has overlapping region, rejecting");
           g_list_free (region);
           g_list_free_full (logical_monitor_configs,
                             (GDestroyNotify) meta_logical_monitor_config_free);
@@ -751,19 +759,23 @@ create_for_builtin_display_rotation (MetaMonitorConfigManager *config_manager,
   MetaMonitorConfig *monitor_config;
   MetaMonitorConfig *current_monitor_config;
 
-  if (!meta_monitor_manager_get_is_builtin_display_on (config_manager->monitor_manager))
+  if (!meta_monitor_manager_get_is_builtin_display_on (config_manager->
+                                                       monitor_manager))
     return NULL;
 
   if (!config_manager->current_config)
     return NULL;
 
-  if (g_list_length (config_manager->current_config->logical_monitor_configs) != 1)
+  if (g_list_length (config_manager->current_config->logical_monitor_configs) !=
+      1)
     return NULL;
 
-  current_logical_monitor_config = config_manager->current_config->logical_monitor_configs->data;
+  current_logical_monitor_config =
+    config_manager->current_config->logical_monitor_configs->data;
 
   if (rotate)
-    transform = (current_logical_monitor_config->transform + 1) % META_MONITOR_TRANSFORM_FLIPPED;
+    transform = (current_logical_monitor_config->transform + 1) %
+                META_MONITOR_TRANSFORM_FLIPPED;
   else
     {
       /*
@@ -785,24 +797,33 @@ create_for_builtin_display_rotation (MetaMonitorConfigManager *config_manager,
   if (g_list_length (current_logical_monitor_config->monitor_configs) != 1)
     return NULL;
 
-  current_monitor_config = current_logical_monitor_config->monitor_configs->data;
+  current_monitor_config =
+    current_logical_monitor_config->monitor_configs->data;
 
   monitor_config = g_new0 (MetaMonitorConfig, 1);
   *monitor_config = (MetaMonitorConfig) {
-    .monitor_spec = meta_monitor_spec_clone (current_monitor_config->monitor_spec),
-    .mode_spec = g_memdup (current_monitor_config->mode_spec, sizeof (MetaMonitorModeSpec)),
+    .monitor_spec = meta_monitor_spec_clone (
+      current_monitor_config->monitor_spec),
+    .mode_spec =
+      g_memdup (current_monitor_config->mode_spec,
+                sizeof (MetaMonitorModeSpec)),
     .enable_underscanning = current_monitor_config->enable_underscanning
   };
 
-  logical_monitor_config = g_memdup (current_logical_monitor_config, sizeof (MetaLogicalMonitorConfig));
-  logical_monitor_config->monitor_configs = g_list_append (NULL, monitor_config);
+  logical_monitor_config =
+    g_memdup (current_logical_monitor_config,
+              sizeof (MetaLogicalMonitorConfig));
+  logical_monitor_config->monitor_configs =
+    g_list_append (NULL, monitor_config);
   logical_monitor_config->transform = transform;
 
-  if (meta_monitor_transform_is_rotated (current_logical_monitor_config->transform) !=
+  if (meta_monitor_transform_is_rotated (current_logical_monitor_config->
+                                         transform) !=
       meta_monitor_transform_is_rotated (logical_monitor_config->transform))
     {
       int temp = logical_monitor_config->layout.width;
-      logical_monitor_config->layout.width = logical_monitor_config->layout.height;
+      logical_monitor_config->layout.width =
+        logical_monitor_config->layout.height;
       logical_monitor_config->layout.height = temp;
     }
 
@@ -815,16 +836,19 @@ create_for_builtin_display_rotation (MetaMonitorConfigManager *config_manager,
 }
 
 MetaMonitorsConfig *
-meta_monitor_config_manager_create_for_orientation (MetaMonitorConfigManager *config_manager,
-                                                    MetaMonitorTransform      transform)
+meta_monitor_config_manager_create_for_orientation (
+  MetaMonitorConfigManager *config_manager,
+  MetaMonitorTransform      transform)
 {
   return create_for_builtin_display_rotation (config_manager, FALSE, transform);
 }
 
 MetaMonitorsConfig *
-meta_monitor_config_manager_create_for_rotate_monitor (MetaMonitorConfigManager *config_manager)
+meta_monitor_config_manager_create_for_rotate_monitor (
+  MetaMonitorConfigManager *config_manager)
 {
-  return create_for_builtin_display_rotation (config_manager, TRUE, META_MONITOR_TRANSFORM_NORMAL);
+  return create_for_builtin_display_rotation (config_manager, TRUE,
+                                              META_MONITOR_TRANSFORM_NORMAL);
 }
 
 static MetaMonitorsConfig *
@@ -914,9 +938,11 @@ create_for_switch_config_all_mirror (MetaMonitorConfigManager *config_manager)
       if (!mode)
         continue;
 
-      scale = meta_monitor_manager_calculate_monitor_mode_scale (monitor_manager, monitor, mode);
+      scale = meta_monitor_manager_calculate_monitor_mode_scale (
+        monitor_manager, monitor, mode);
       best_scale = MAX (best_scale, scale);
-      monitor_configs = g_list_prepend (monitor_configs, create_monitor_config (monitor, mode));
+      monitor_configs =
+        g_list_prepend (monitor_configs, create_monitor_config (monitor, mode));
     }
 
   logical_monitor_config = g_new0 (MetaLogicalMonitorConfig, 1);
@@ -1013,8 +1039,9 @@ create_for_switch_config_builtin (MetaMonitorConfigManager *config_manager)
 }
 
 MetaMonitorsConfig *
-meta_monitor_config_manager_create_for_switch_config (MetaMonitorConfigManager    *config_manager,
-                                                      MetaMonitorSwitchConfigType  config_type)
+meta_monitor_config_manager_create_for_switch_config (
+  MetaMonitorConfigManager   *config_manager,
+  MetaMonitorSwitchConfigType config_type)
 {
   MetaMonitorManager *monitor_manager = config_manager->monitor_manager;
   MetaMonitorsConfig *config;
@@ -1049,8 +1076,9 @@ meta_monitor_config_manager_create_for_switch_config (MetaMonitorConfigManager
 }
 
 void
-meta_monitor_config_manager_set_current (MetaMonitorConfigManager *config_manager,
-                                         MetaMonitorsConfig       *config)
+meta_monitor_config_manager_set_current (
+  MetaMonitorConfigManager *config_manager,
+  MetaMonitorsConfig       *config)
 {
   if (config_manager->current_config)
     {
@@ -1065,7 +1093,8 @@ meta_monitor_config_manager_set_current (MetaMonitorConfigManager *config_manage
 }
 
 void
-meta_monitor_config_manager_save_current (MetaMonitorConfigManager *config_manager)
+meta_monitor_config_manager_save_current (
+  MetaMonitorConfigManager *config_manager)
 {
   g_return_if_fail (config_manager->current_config);
 
@@ -1074,27 +1103,32 @@ meta_monitor_config_manager_save_current (MetaMonitorConfigManager *config_manag
 }
 
 MetaMonitorsConfig *
-meta_monitor_config_manager_get_current (MetaMonitorConfigManager *config_manager)
+meta_monitor_config_manager_get_current (
+  MetaMonitorConfigManager *config_manager)
 {
   return config_manager->current_config;
 }
 
 MetaMonitorsConfig *
-meta_monitor_config_manager_pop_previous (MetaMonitorConfigManager *config_manager)
+meta_monitor_config_manager_pop_previous (
+  MetaMonitorConfigManager *config_manager)
 {
   return g_queue_pop_head (&config_manager->config_history);
 }
 
 MetaMonitorsConfig *
-meta_monitor_config_manager_get_previous (MetaMonitorConfigManager *config_manager)
+meta_monitor_config_manager_get_previous (
+  MetaMonitorConfigManager *config_manager)
 {
   return g_queue_peek_head (&config_manager->config_history);
 }
 
 void
-meta_monitor_config_manager_clear_history (MetaMonitorConfigManager *config_manager)
+meta_monitor_config_manager_clear_history (
+  MetaMonitorConfigManager *config_manager)
 {
-  g_queue_foreach (&config_manager->config_history, (GFunc) g_object_unref, NULL);
+  g_queue_foreach (&config_manager->config_history, (GFunc) g_object_unref,
+                   NULL);
   g_queue_clear (&config_manager->config_history);
 }
 
@@ -1133,7 +1167,8 @@ meta_monitor_config_free (MetaMonitorConfig *monitor_config)
 }
 
 void
-meta_logical_monitor_config_free (MetaLogicalMonitorConfig *logical_monitor_config)
+meta_logical_monitor_config_free (
+  MetaLogicalMonitorConfig *logical_monitor_config)
 {
   g_list_free_full (logical_monitor_config->monitor_configs,
                     (GDestroyNotify) meta_monitor_config_free);
@@ -1244,17 +1279,18 @@ meta_monitors_config_get_switch_config (MetaMonitorsConfig *config)
 }
 
 void
-meta_monitors_config_set_switch_config (MetaMonitorsConfig          *config,
-                                        MetaMonitorSwitchConfigType  switch_config)
+meta_monitors_config_set_switch_config (MetaMonitorsConfig         *config,
+                                        MetaMonitorSwitchConfigType switch_config)
 {
   config->switch_config = switch_config;
 }
 
 MetaMonitorsConfig *
-meta_monitors_config_new_full (GList                        *logical_monitor_configs,
-                               GList                        *disabled_monitor_specs,
-                               MetaLogicalMonitorLayoutMode  layout_mode,
-                               MetaMonitorsConfigFlag        flags)
+meta_monitors_config_new_full (
+  GList                       *logical_monitor_configs,
+  GList                       *disabled_monitor_specs,
+  MetaLogicalMonitorLayoutMode layout_mode,
+  MetaMonitorsConfigFlag       flags)
 {
   MetaMonitorsConfig *config;
 
@@ -1271,10 +1307,10 @@ meta_monitors_config_new_full (GList                        *logical_monitor_con
 }
 
 MetaMonitorsConfig *
-meta_monitors_config_new (MetaMonitorManager           *monitor_manager,
-                          GList                        *logical_monitor_configs,
-                          MetaLogicalMonitorLayoutMode  layout_mode,
-                          MetaMonitorsConfigFlag        flags)
+meta_monitors_config_new (MetaMonitorManager          *monitor_manager,
+                          GList                       *logical_monitor_configs,
+                          MetaLogicalMonitorLayoutMode layout_mode,
+                          MetaMonitorsConfigFlag       flags)
 {
   GList *disabled_monitor_specs = NULL;
   GList *monitors;
@@ -1400,10 +1436,11 @@ meta_verify_monitor_config (MetaMonitorConfig *monitor_config,
 }
 
 gboolean
-meta_verify_logical_monitor_config (MetaLogicalMonitorConfig    *logical_monitor_config,
-                                    MetaLogicalMonitorLayoutMode layout_mode,
-                                    MetaMonitorManager          *monitor_manager,
-                                    GError                     **error)
+meta_verify_logical_monitor_config (
+  MetaLogicalMonitorConfig    *logical_monitor_config,
+  MetaLogicalMonitorLayoutMode layout_mode,
+  MetaMonitorManager          *monitor_manager,
+  GError                     **error)
 {
   GList *l;
   int expected_mode_width = 0;
@@ -1494,8 +1531,9 @@ has_adjecent_neighbour (MetaMonitorsConfig       *config,
 }
 
 gboolean
-meta_logical_monitor_configs_have_monitor (GList           *logical_monitor_configs,
-                                           MetaMonitorSpec *monitor_spec)
+meta_logical_monitor_configs_have_monitor (
+  GList           *logical_monitor_configs,
+  MetaMonitorSpec *monitor_spec)
 {
   GList *l;
 
@@ -1521,8 +1559,9 @@ static gboolean
 meta_monitors_config_is_monitor_enabled (MetaMonitorsConfig *config,
                                          MetaMonitorSpec    *monitor_spec)
 {
-  return meta_logical_monitor_configs_have_monitor (config->logical_monitor_configs,
-                                                    monitor_spec);
+  return meta_logical_monitor_configs_have_monitor (
+    config->logical_monitor_configs,
+    monitor_spec);
 }
 
 gboolean
diff --git a/src/backends/meta-monitor-config-migration.c b/src/backends/meta-monitor-config-migration.c
index d619dc433..ece99abfa 100644
--- a/src/backends/meta-monitor-config-migration.c
+++ b/src/backends/meta-monitor-config-migration.c
@@ -24,7 +24,8 @@
  */
 
 /*
- * Portions of this file are derived from gnome-desktop/libgnome-desktop/gnome-rr-config.c
+ * Portions of this file are derived from
+ *gnome-desktop/libgnome-desktop/gnome-rr-config.c
  *
  * Copyright 2007, 2008, Red Hat, Inc.
  * Copyright 2010 Giovanni Campagna
@@ -44,10 +45,11 @@
 #include "backends/meta-monitor-manager-private.h"
 #include "meta/boxes.h"
 
-#define META_MONITORS_CONFIG_MIGRATION_ERROR (meta_monitors_config_migration_error_quark ())
+#define META_MONITORS_CONFIG_MIGRATION_ERROR ( \
+    meta_monitors_config_migration_error_quark ())
 static GQuark meta_monitors_config_migration_error_quark (void);
 
-G_DEFINE_QUARK (meta-monitors-config-migration-error-quark,
+G_DEFINE_QUARK (meta - monitors - config - migration - error - quark,
                 meta_monitors_config_migration_error)
 
 enum _MetaConfigMigrationError
@@ -198,125 +200,125 @@ handle_start_element (GMarkupParseContext *context,
   switch (parser->state)
     {
     case STATE_INITIAL:
-      {
-        char *version;
+    {
+      char *version;
 
-        if (strcmp (element_name, "monitors") != 0)
-          {
-            g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
-                         "Invalid document element %s", element_name);
-            return;
-          }
-
-        if (!g_markup_collect_attributes (element_name,
-                                          attribute_names,
-                                          attribute_values,
-                                          error,
-                                          G_MARKUP_COLLECT_STRING,
-                                          "version", &version,
-                                          G_MARKUP_COLLECT_INVALID))
+      if (strcmp (element_name, "monitors") != 0)
+        {
+          g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
+                       "Invalid document element %s", element_name);
           return;
+        }
 
-        if (strcmp (version, "1") != 0)
-          {
-            g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
-                         "Invalid or unsupported version %s", version);
-            return;
-          }
-
-        parser->state = STATE_MONITORS;
+      if (!g_markup_collect_attributes (element_name,
+                                        attribute_names,
+                                        attribute_values,
+                                        error,
+                                        G_MARKUP_COLLECT_STRING,
+                                        "version", &version,
+                                        G_MARKUP_COLLECT_INVALID))
         return;
-      }
+
+      if (strcmp (version, "1") != 0)
+        {
+          g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
+                       "Invalid or unsupported version %s", version);
+          return;
+        }
+
+      parser->state = STATE_MONITORS;
+      return;
+    }
 
     case STATE_MONITORS:
-      {
-        if (strcmp (element_name, "configuration") != 0)
-          {
-            g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
-                         "Invalid toplevel element %s", element_name);
-            return;
-          }
+    {
+      if (strcmp (element_name, "configuration") != 0)
+        {
+          g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
+                       "Invalid toplevel element %s", element_name);
+          return;
+        }
 
-        parser->key_array = g_array_new (FALSE, FALSE,
-                                         sizeof (MetaOutputKey));
-        parser->output_array = g_array_new (FALSE, FALSE,
-                                            sizeof (MetaOutputConfig));
-        parser->state = STATE_CONFIGURATION;
-        return;
-      }
+      parser->key_array = g_array_new (FALSE, FALSE,
+                                       sizeof (MetaOutputKey));
+      parser->output_array = g_array_new (FALSE, FALSE,
+                                          sizeof (MetaOutputConfig));
+      parser->state = STATE_CONFIGURATION;
+      return;
+    }
 
     case STATE_CONFIGURATION:
-      {
-        if (strcmp (element_name, "clone") == 0 &&
-            parser->unknown_count == 0)
-          {
-            parser->state = STATE_CLONE;
-          }
-        else if (strcmp (element_name, "output") == 0 &&
-                 parser->unknown_count == 0)
-          {
-            char *name;
-
-            if (!g_markup_collect_attributes (element_name,
-                                              attribute_names,
-                                              attribute_values,
-                                              error,
-                                              G_MARKUP_COLLECT_STRING,
-                                              "name", &name,
-                                              G_MARKUP_COLLECT_INVALID))
-              return;
-
-            memset (&parser->key, 0, sizeof (MetaOutputKey));
-            memset (&parser->output, 0, sizeof (MetaOutputConfig));
-
-            parser->key.connector = g_strdup (name);
-            parser->state = STATE_OUTPUT;
-          }
-        else
-          {
-            parser->unknown_count++;
-          }
+    {
+      if (strcmp (element_name, "clone") == 0 &&
+          parser->unknown_count == 0)
+        {
+          parser->state = STATE_CLONE;
+        }
+      else if (strcmp (element_name, "output") == 0 &&
+               parser->unknown_count == 0)
+        {
+          char *name;
+
+          if (!g_markup_collect_attributes (element_name,
+                                            attribute_names,
+                                            attribute_values,
+                                            error,
+                                            G_MARKUP_COLLECT_STRING,
+                                            "name", &name,
+                                            G_MARKUP_COLLECT_INVALID))
+            return;
 
-        return;
-      }
+          memset (&parser->key, 0, sizeof (MetaOutputKey));
+          memset (&parser->output, 0, sizeof (MetaOutputConfig));
+
+          parser->key.connector = g_strdup (name);
+          parser->state = STATE_OUTPUT;
+        }
+      else
+        {
+          parser->unknown_count++;
+        }
+
+      return;
+    }
 
     case STATE_OUTPUT:
-      {
-        if ((strcmp (element_name, "vendor") == 0 ||
-             strcmp (element_name, "product") == 0 ||
-             strcmp (element_name, "serial") == 0 ||
-             strcmp (element_name, "width") == 0 ||
-             strcmp (element_name, "height") == 0 ||
-             strcmp (element_name, "rate") == 0 ||
-             strcmp (element_name, "x") == 0 ||
-             strcmp (element_name, "y") == 0 ||
-             strcmp (element_name, "rotation") == 0 ||
-             strcmp (element_name, "reflect_x") == 0 ||
-             strcmp (element_name, "reflect_y") == 0 ||
-             strcmp (element_name, "primary") == 0 ||
-             strcmp (element_name, "presentation") == 0 ||
-             strcmp (element_name, "underscanning") == 0) &&
-            parser->unknown_count == 0)
-          {
-            parser->state = STATE_OUTPUT_FIELD;
-
-            parser->output_field = g_strdup (element_name);
-          }
-        else
-          {
-            parser->unknown_count++;
-          }
+    {
+      if ((strcmp (element_name, "vendor") == 0 ||
+           strcmp (element_name, "product") == 0 ||
+           strcmp (element_name, "serial") == 0 ||
+           strcmp (element_name, "width") == 0 ||
+           strcmp (element_name, "height") == 0 ||
+           strcmp (element_name, "rate") == 0 ||
+           strcmp (element_name, "x") == 0 ||
+           strcmp (element_name, "y") == 0 ||
+           strcmp (element_name, "rotation") == 0 ||
+           strcmp (element_name, "reflect_x") == 0 ||
+           strcmp (element_name, "reflect_y") == 0 ||
+           strcmp (element_name, "primary") == 0 ||
+           strcmp (element_name, "presentation") == 0 ||
+           strcmp (element_name, "underscanning") == 0) &&
+          parser->unknown_count == 0)
+        {
+          parser->state = STATE_OUTPUT_FIELD;
 
-        return;
-      }
+          parser->output_field = g_strdup (element_name);
+        }
+      else
+        {
+          parser->unknown_count++;
+        }
+
+      return;
+    }
 
     case STATE_CLONE:
     case STATE_OUTPUT_FIELD:
-      {
-        g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
-                     "Unexpected element %s", element_name);
-        return;
-      }
+    {
+      g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
+                   "Unexpected element %s", element_name);
+      return;
+    }
 
     default:
       g_assert_not_reached ();
@@ -334,92 +336,92 @@ handle_end_element (GMarkupParseContext *context,
   switch (parser->state)
     {
     case STATE_MONITORS:
-      {
-        parser->state = STATE_INITIAL;
-        return;
-      }
+    {
+      parser->state = STATE_INITIAL;
+      return;
+    }
 
     case STATE_CONFIGURATION:
-      {
-        if (strcmp (element_name, "configuration") == 0 &&
-            parser->unknown_count == 0)
-          {
-            MetaLegacyMonitorsConfig *config = legacy_config_new ();
+    {
+      if (strcmp (element_name, "configuration") == 0 &&
+          parser->unknown_count == 0)
+        {
+          MetaLegacyMonitorsConfig *config = legacy_config_new ();
 
-            g_assert (parser->key_array->len == parser->output_array->len);
+          g_assert (parser->key_array->len == parser->output_array->len);
 
-            config->n_outputs = parser->key_array->len;
-            config->keys = (void*)g_array_free (parser->key_array, FALSE);
-            config->outputs = (void*)g_array_free (parser->output_array, FALSE);
+          config->n_outputs = parser->key_array->len;
+          config->keys = (void *) g_array_free (parser->key_array, FALSE);
+          config->outputs = (void *) g_array_free (parser->output_array, FALSE);
 
-            g_hash_table_replace (parser->configs, config, config);
+          g_hash_table_replace (parser->configs, config, config);
 
-            parser->key_array = NULL;
-            parser->output_array = NULL;
-            parser->state = STATE_MONITORS;
-          }
-        else
-          {
-            parser->unknown_count--;
+          parser->key_array = NULL;
+          parser->output_array = NULL;
+          parser->state = STATE_MONITORS;
+        }
+      else
+        {
+          parser->unknown_count--;
 
-            g_assert (parser->unknown_count >= 0);
-          }
+          g_assert (parser->unknown_count >= 0);
+        }
 
-        return;
-      }
+      return;
+    }
 
     case STATE_OUTPUT:
-      {
-        if (strcmp (element_name, "output") == 0 && parser->unknown_count == 0)
-          {
-            if (parser->key.vendor == NULL ||
-                parser->key.product == NULL ||
-                parser->key.serial == NULL)
-              {
-                /* Disconnected output, ignore */
-                free_output_key (&parser->key);
-              }
-            else
-              {
-                if (parser->output.rect.width == 0 ||
-                    parser->output.rect.height == 0)
-                  parser->output.enabled = FALSE;
-                else
-                  parser->output.enabled = TRUE;
-
-                g_array_append_val (parser->key_array, parser->key);
-                g_array_append_val (parser->output_array, parser->output);
-              }
-
-            memset (&parser->key, 0, sizeof (MetaOutputKey));
-            memset (&parser->output, 0, sizeof (MetaOutputConfig));
-
-            parser->state = STATE_CONFIGURATION;
-          }
-        else
-          {
-            parser->unknown_count--;
-
-            g_assert (parser->unknown_count >= 0);
-          }
+    {
+      if (strcmp (element_name, "output") == 0 && parser->unknown_count == 0)
+        {
+          if (parser->key.vendor == NULL ||
+              parser->key.product == NULL ||
+              parser->key.serial == NULL)
+            {
+              /* Disconnected output, ignore */
+              free_output_key (&parser->key);
+            }
+          else
+            {
+              if (parser->output.rect.width == 0 ||
+                  parser->output.rect.height == 0)
+                parser->output.enabled = FALSE;
+              else
+                parser->output.enabled = TRUE;
 
-        return;
-      }
+              g_array_append_val (parser->key_array, parser->key);
+              g_array_append_val (parser->output_array, parser->output);
+            }
+
+          memset (&parser->key, 0, sizeof (MetaOutputKey));
+          memset (&parser->output, 0, sizeof (MetaOutputConfig));
+
+          parser->state = STATE_CONFIGURATION;
+        }
+      else
+        {
+          parser->unknown_count--;
+
+          g_assert (parser->unknown_count >= 0);
+        }
+
+      return;
+    }
 
     case STATE_CLONE:
-      {
-        parser->state = STATE_CONFIGURATION;
-        return;
-      }
+    {
+      parser->state = STATE_CONFIGURATION;
+      return;
+    }
 
     case STATE_OUTPUT_FIELD:
-      {
-        g_free (parser->output_field);
-        parser->output_field = NULL;
+    {
+      g_free (parser->output_field);
+      parser->output_field = NULL;
 
-        parser->state = STATE_OUTPUT;
-        return;
-      }
+      parser->state = STATE_OUTPUT;
+      return;
+    }
 
     case STATE_INITIAL:
     default:
@@ -451,10 +453,10 @@ read_int (const char *text,
 }
 
 static void
-read_float (const char  *text,
-            gsize        text_len,
-            gfloat      *field,
-            GError     **error)
+read_float (const char *text,
+            gsize       text_len,
+            gfloat     *field,
+            GError    **error)
 {
   char buf[64];
   gfloat v;
@@ -474,9 +476,9 @@ read_float (const char  *text,
 }
 
 static gboolean
-read_bool (const char  *text,
-           gsize        text_len,
-           GError     **error)
+read_bool (const char *text,
+           gsize       text_len,
+           GError    **error)
 {
   if (strncmp (text, "no", text_len) == 0)
     return FALSE;
@@ -484,7 +486,7 @@ read_bool (const char  *text,
     return TRUE;
   else
     g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
-                 "Invalid boolean value %.*s", (int)text_len, text);
+                 "Invalid boolean value %.*s", (int) text_len, text);
 
   return FALSE;
 }
@@ -514,101 +516,101 @@ handle_text (GMarkupParseContext *context,
   switch (parser->state)
     {
     case STATE_MONITORS:
-      {
-        if (!is_all_whitespace (text, text_len))
-          g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
-                       "Unexpected content at this point");
-        return;
-      }
+    {
+      if (!is_all_whitespace (text, text_len))
+        g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
+                     "Unexpected content at this point");
+      return;
+    }
 
     case STATE_CONFIGURATION:
-      {
-        if (parser->unknown_count == 0)
-          {
-            if (!is_all_whitespace (text, text_len))
-              g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
-                           "Unexpected content at this point");
-          }
-        else
-          {
-            /* Handling unknown element, ignore */
-          }
+    {
+      if (parser->unknown_count == 0)
+        {
+          if (!is_all_whitespace (text, text_len))
+            g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
+                         "Unexpected content at this point");
+        }
+      else
+        {
+          /* Handling unknown element, ignore */
+        }
 
-        return;
-      }
+      return;
+    }
 
     case STATE_OUTPUT:
-      {
-        if (parser->unknown_count == 0)
-          {
-            if (!is_all_whitespace (text, text_len))
-              g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
-                           "Unexpected content at this point");
-          }
-        else
-          {
-            /* Handling unknown element, ignore */
-          }
-        return;
-      }
+    {
+      if (parser->unknown_count == 0)
+        {
+          if (!is_all_whitespace (text, text_len))
+            g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
+                         "Unexpected content at this point");
+        }
+      else
+        {
+          /* Handling unknown element, ignore */
+        }
+      return;
+    }
 
     case STATE_CLONE:
-      {
-        /* Ignore the clone flag */
-        return;
-      }
+    {
+      /* Ignore the clone flag */
+      return;
+    }
 
     case STATE_OUTPUT_FIELD:
-      {
-        if (strcmp (parser->output_field, "vendor") == 0)
-          parser->key.vendor = g_strndup (text, text_len);
-        else if (strcmp (parser->output_field, "product") == 0)
-          parser->key.product = g_strndup (text, text_len);
-        else if (strcmp (parser->output_field, "serial") == 0)
-          parser->key.serial = g_strndup (text, text_len);
-        else if (strcmp (parser->output_field, "width") == 0)
-          read_int (text, text_len, &parser->output.rect.width, error);
-        else if (strcmp (parser->output_field, "height") == 0)
-          read_int (text, text_len, &parser->output.rect.height, error);
-        else if (strcmp (parser->output_field, "rate") == 0)
-          read_float (text, text_len, &parser->output.refresh_rate, error);
-        else if (strcmp (parser->output_field, "x") == 0)
-          read_int (text, text_len, &parser->output.rect.x, error);
-        else if (strcmp (parser->output_field, "y") == 0)
-          read_int (text, text_len, &parser->output.rect.y, error);
-        else if (strcmp (parser->output_field, "rotation") == 0)
-          {
-            if (strncmp (text, "normal", text_len) == 0)
-              parser->output.transform = META_MONITOR_TRANSFORM_NORMAL;
-            else if (strncmp (text, "left", text_len) == 0)
-              parser->output.transform = META_MONITOR_TRANSFORM_90;
-            else if (strncmp (text, "upside_down", text_len) == 0)
-              parser->output.transform = META_MONITOR_TRANSFORM_180;
-            else if (strncmp (text, "right", text_len) == 0)
-              parser->output.transform = META_MONITOR_TRANSFORM_270;
-            else
-              g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
-                           "Invalid rotation type %.*s", (int)text_len, text);
-          }
-        else if (strcmp (parser->output_field, "reflect_x") == 0)
-          parser->output.transform += read_bool (text, text_len, error) ?
-            META_MONITOR_TRANSFORM_FLIPPED : 0;
-        else if (strcmp (parser->output_field, "reflect_y") == 0)
-          {
-            if (read_bool (text, text_len, error))
-              g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
-                           "Y reflection is not supported");
-          }
-        else if (strcmp (parser->output_field, "primary") == 0)
-          parser->output.is_primary = read_bool (text, text_len, error);
-        else if (strcmp (parser->output_field, "presentation") == 0)
-          parser->output.is_presentation = read_bool (text, text_len, error);
-        else if (strcmp (parser->output_field, "underscanning") == 0)
-          parser->output.is_underscanning = read_bool (text, text_len, error);
-        else
-          g_assert_not_reached ();
-        return;
-      }
+    {
+      if (strcmp (parser->output_field, "vendor") == 0)
+        parser->key.vendor = g_strndup (text, text_len);
+      else if (strcmp (parser->output_field, "product") == 0)
+        parser->key.product = g_strndup (text, text_len);
+      else if (strcmp (parser->output_field, "serial") == 0)
+        parser->key.serial = g_strndup (text, text_len);
+      else if (strcmp (parser->output_field, "width") == 0)
+        read_int (text, text_len, &parser->output.rect.width, error);
+      else if (strcmp (parser->output_field, "height") == 0)
+        read_int (text, text_len, &parser->output.rect.height, error);
+      else if (strcmp (parser->output_field, "rate") == 0)
+        read_float (text, text_len, &parser->output.refresh_rate, error);
+      else if (strcmp (parser->output_field, "x") == 0)
+        read_int (text, text_len, &parser->output.rect.x, error);
+      else if (strcmp (parser->output_field, "y") == 0)
+        read_int (text, text_len, &parser->output.rect.y, error);
+      else if (strcmp (parser->output_field, "rotation") == 0)
+        {
+          if (strncmp (text, "normal", text_len) == 0)
+            parser->output.transform = META_MONITOR_TRANSFORM_NORMAL;
+          else if (strncmp (text, "left", text_len) == 0)
+            parser->output.transform = META_MONITOR_TRANSFORM_90;
+          else if (strncmp (text, "upside_down", text_len) == 0)
+            parser->output.transform = META_MONITOR_TRANSFORM_180;
+          else if (strncmp (text, "right", text_len) == 0)
+            parser->output.transform = META_MONITOR_TRANSFORM_270;
+          else
+            g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
+                         "Invalid rotation type %.*s", (int) text_len, text);
+        }
+      else if (strcmp (parser->output_field, "reflect_x") == 0)
+        parser->output.transform += read_bool (text, text_len, error) ?
+                                    META_MONITOR_TRANSFORM_FLIPPED : 0;
+      else if (strcmp (parser->output_field, "reflect_y") == 0)
+        {
+          if (read_bool (text, text_len, error))
+            g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
+                         "Y reflection is not supported");
+        }
+      else if (strcmp (parser->output_field, "primary") == 0)
+        parser->output.is_primary = read_bool (text, text_len, error);
+      else if (strcmp (parser->output_field, "presentation") == 0)
+        parser->output.is_presentation = read_bool (text, text_len, error);
+      else if (strcmp (parser->output_field, "underscanning") == 0)
+        parser->output.is_underscanning = read_bool (text, text_len, error);
+      else
+        g_assert_not_reached ();
+      return;
+    }
 
     case STATE_INITIAL:
     default:
@@ -616,7 +618,8 @@ handle_text (GMarkupParseContext *context,
     }
 }
 
-static const GMarkupParser config_parser = {
+static const GMarkupParser config_parser =
+{
   .start_element = handle_start_element,
   .end_element = handle_end_element,
   .text = handle_text,
diff --git a/src/backends/meta-monitor-config-store.c b/src/backends/meta-monitor-config-store.c
index ed0ce34f0..c21ccaa57 100644
--- a/src/backends/meta-monitor-config-store.c
+++ b/src/backends/meta-monitor-config-store.c
@@ -32,7 +32,7 @@
 #define MONITORS_CONFIG_XML_FORMAT_VERSION 2
 
 #define QUOTE1(a) #a
-#define QUOTE(a) QUOTE1(a)
+#define QUOTE(a) QUOTE1 (a)
 
 /*
  * Example configuration:
@@ -130,7 +130,7 @@ enum
   META_MONITOR_CONFIG_STORE_ERROR_NEEDS_MIGRATION
 };
 
-G_DEFINE_QUARK (meta-monitor-config-store-error-quark,
+G_DEFINE_QUARK (meta - monitor - config - store - error - quark,
                 meta_monitor_config_store_error)
 
 typedef enum
@@ -185,316 +185,320 @@ G_DEFINE_TYPE (MetaMonitorConfigStore, meta_monitor_config_store,
                G_TYPE_OBJECT)
 
 static void
-handle_start_element (GMarkupParseContext  *context,
-                      const char           *element_name,
-                      const char          **attribute_names,
-                      const char          **attribute_values,
-                      gpointer              user_data,
-                      GError              **error)
+handle_start_element (GMarkupParseContext *context,
+                      const char          *element_name,
+                      const char         **attribute_names,
+                      const char         **attribute_values,
+                      gpointer             user_data,
+                      GError             **error)
 {
   ConfigParser *parser = user_data;
 
   switch (parser->state)
     {
     case STATE_INITIAL:
-      {
-        char *version;
+    {
+      char *version;
 
-        if (!g_str_equal (element_name, "monitors"))
-          {
-            g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
-                         "Invalid document element '%s'", element_name);
-            return;
-          }
-
-        if (!g_markup_collect_attributes (element_name, attribute_names, attribute_values,
-                                          error,
-                                          G_MARKUP_COLLECT_STRING, "version", &version,
-                                          G_MARKUP_COLLECT_INVALID))
-          {
-            g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
-                         "Missing config file format version");
-          }
-        
-        if (g_str_equal (version, "1"))
-          {
-            g_set_error_literal (error,
-                                 META_MONITOR_CONFIG_STORE_ERROR,
-                                 META_MONITOR_CONFIG_STORE_ERROR_NEEDS_MIGRATION,
-                                 "monitors.xml has the old format");
-            return;
-          }
+      if (!g_str_equal (element_name, "monitors"))
+        {
+          g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
+                       "Invalid document element '%s'", element_name);
+          return;
+        }
 
-        if (!g_str_equal (version, QUOTE (MONITORS_CONFIG_XML_FORMAT_VERSION)))
-          {
-            g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
-                         "Invalid or unsupported version '%s'", version);
-            return;
-          }
+      if (!g_markup_collect_attributes (element_name, attribute_names,
+                                        attribute_values,
+                                        error,
+                                        G_MARKUP_COLLECT_STRING, "version",
+                                        &version,
+                                        G_MARKUP_COLLECT_INVALID))
+        {
+          g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
+                       "Missing config file format version");
+        }
 
-        parser->state = STATE_MONITORS;
-        return;
-      }
+      if (g_str_equal (version, "1"))
+        {
+          g_set_error_literal (error,
+                               META_MONITOR_CONFIG_STORE_ERROR,
+                               META_MONITOR_CONFIG_STORE_ERROR_NEEDS_MIGRATION,
+                               "monitors.xml has the old format");
+          return;
+        }
+
+      if (!g_str_equal (version, QUOTE (MONITORS_CONFIG_XML_FORMAT_VERSION)))
+        {
+          g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
+                       "Invalid or unsupported version '%s'", version);
+          return;
+        }
+
+      parser->state = STATE_MONITORS;
+      return;
+    }
 
     case STATE_MONITORS:
-      {
-        if (!g_str_equal (element_name, "configuration"))
-          {
-            g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
-                         "Invalid toplevel element '%s'", element_name);
-            return;
-          }
+    {
+      if (!g_str_equal (element_name, "configuration"))
+        {
+          g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
+                       "Invalid toplevel element '%s'", element_name);
+          return;
+        }
 
-        parser->state = STATE_CONFIGURATION;
-        parser->current_was_migrated = FALSE;
+      parser->state = STATE_CONFIGURATION;
+      parser->current_was_migrated = FALSE;
 
-        return;
-      }
+      return;
+    }
 
     case STATE_CONFIGURATION:
-      {
-        if (g_str_equal (element_name, "logicalmonitor"))
-          {
-            parser->current_logical_monitor_config =
-              g_new0 (MetaLogicalMonitorConfig, 1);
-
-            parser->state = STATE_LOGICAL_MONITOR;
-          }
-        else if (g_str_equal (element_name, "migrated"))
-          {
-            parser->current_was_migrated = TRUE;
-
-            parser->state = STATE_MIGRATED;
-          }
-        else if (g_str_equal (element_name, "disabled"))
-          {
-            parser->state = STATE_DISABLED;
-          }
-        else
-          {
-            g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
-                         "Invalid configuration element '%s'", element_name);
-            return;
-          }
+    {
+      if (g_str_equal (element_name, "logicalmonitor"))
+        {
+          parser->current_logical_monitor_config =
+            g_new0 (MetaLogicalMonitorConfig, 1);
 
-        return;
-      }
+          parser->state = STATE_LOGICAL_MONITOR;
+        }
+      else if (g_str_equal (element_name, "migrated"))
+        {
+          parser->current_was_migrated = TRUE;
+
+          parser->state = STATE_MIGRATED;
+        }
+      else if (g_str_equal (element_name, "disabled"))
+        {
+          parser->state = STATE_DISABLED;
+        }
+      else
+        {
+          g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
+                       "Invalid configuration element '%s'", element_name);
+          return;
+        }
+
+      return;
+    }
 
     case STATE_MIGRATED:
-      {
-        g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
-                     "Unexpected element '%s'", element_name);
-        return;
-      }
+    {
+      g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
+                   "Unexpected element '%s'", element_name);
+      return;
+    }
 
     case STATE_LOGICAL_MONITOR:
-      {
-        if (g_str_equal (element_name, "x"))
-          {
-            parser->state = STATE_LOGICAL_MONITOR_X;
-          }
-        else if (g_str_equal (element_name, "y"))
-          {
-            parser->state = STATE_LOGICAL_MONITOR_Y;
-          }
-        else if (g_str_equal (element_name, "scale"))
-          {
-            parser->state = STATE_LOGICAL_MONITOR_SCALE;
-          }
-        else if (g_str_equal (element_name, "primary"))
-          {
-            parser->state = STATE_LOGICAL_MONITOR_PRIMARY;
-          }
-        else if (g_str_equal (element_name, "presentation"))
-          {
-            parser->state = STATE_LOGICAL_MONITOR_PRESENTATION;
-          }
-        else if (g_str_equal (element_name, "transform"))
-          {
-            parser->state = STATE_TRANSFORM;
-          }
-        else if (g_str_equal (element_name, "monitor"))
-          {
-            parser->current_monitor_config = g_new0 (MetaMonitorConfig, 1);;
-
-            parser->state = STATE_MONITOR;
-          }
-        else
-          {
-            g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
-                         "Invalid monitor logicalmonitor element '%s'", element_name);
-            return;
-          }
+    {
+      if (g_str_equal (element_name, "x"))
+        {
+          parser->state = STATE_LOGICAL_MONITOR_X;
+        }
+      else if (g_str_equal (element_name, "y"))
+        {
+          parser->state = STATE_LOGICAL_MONITOR_Y;
+        }
+      else if (g_str_equal (element_name, "scale"))
+        {
+          parser->state = STATE_LOGICAL_MONITOR_SCALE;
+        }
+      else if (g_str_equal (element_name, "primary"))
+        {
+          parser->state = STATE_LOGICAL_MONITOR_PRIMARY;
+        }
+      else if (g_str_equal (element_name, "presentation"))
+        {
+          parser->state = STATE_LOGICAL_MONITOR_PRESENTATION;
+        }
+      else if (g_str_equal (element_name, "transform"))
+        {
+          parser->state = STATE_TRANSFORM;
+        }
+      else if (g_str_equal (element_name, "monitor"))
+        {
+          parser->current_monitor_config = g_new0 (MetaMonitorConfig, 1);
 
-        return;
-      }
+          parser->state = STATE_MONITOR;
+        }
+      else
+        {
+          g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
+                       "Invalid monitor logicalmonitor element '%s'",
+                       element_name);
+          return;
+        }
+
+      return;
+    }
 
     case STATE_LOGICAL_MONITOR_X:
     case STATE_LOGICAL_MONITOR_Y:
     case STATE_LOGICAL_MONITOR_SCALE:
     case STATE_LOGICAL_MONITOR_PRIMARY:
     case STATE_LOGICAL_MONITOR_PRESENTATION:
-      {
-        g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
-                     "Invalid logical monitor element '%s'", element_name);
-        return;
-      }
+    {
+      g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
+                   "Invalid logical monitor element '%s'", element_name);
+      return;
+    }
 
     case STATE_TRANSFORM:
-      {
-        if (g_str_equal (element_name, "rotation"))
-          {
-            parser->state = STATE_TRANSFORM_ROTATION;
-          }
-        else if (g_str_equal (element_name, "flipped"))
-          {
-            parser->state = STATE_TRANSFORM_FLIPPED;
-          }
+    {
+      if (g_str_equal (element_name, "rotation"))
+        {
+          parser->state = STATE_TRANSFORM_ROTATION;
+        }
+      else if (g_str_equal (element_name, "flipped"))
+        {
+          parser->state = STATE_TRANSFORM_FLIPPED;
+        }
 
-        return;
-      }
+      return;
+    }
 
     case STATE_TRANSFORM_ROTATION:
     case STATE_TRANSFORM_FLIPPED:
-      {
-        g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
-                     "Invalid transform element '%s'", element_name);
-        return;
-      }
+    {
+      g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
+                   "Invalid transform element '%s'", element_name);
+      return;
+    }
 
     case STATE_MONITOR:
-      {
-        if (g_str_equal (element_name, "monitorspec"))
-          {
-            parser->current_monitor_spec = g_new0 (MetaMonitorSpec, 1);
-            parser->monitor_spec_parent_state = STATE_MONITOR;
-            parser->state = STATE_MONITOR_SPEC;
-          }
-        else if (g_str_equal (element_name, "mode"))
-          {
-            parser->current_monitor_mode_spec = g_new0 (MetaMonitorModeSpec, 1);
-
-            parser->state = STATE_MONITOR_MODE;
-          }
-        else if (g_str_equal (element_name, "underscanning"))
-          {
-            parser->state = STATE_MONITOR_UNDERSCANNING;
-          }
-        else
-          {
-            g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
-                         "Invalid monitor element '%s'", element_name);
-            return;
-          }
+    {
+      if (g_str_equal (element_name, "monitorspec"))
+        {
+          parser->current_monitor_spec = g_new0 (MetaMonitorSpec, 1);
+          parser->monitor_spec_parent_state = STATE_MONITOR;
+          parser->state = STATE_MONITOR_SPEC;
+        }
+      else if (g_str_equal (element_name, "mode"))
+        {
+          parser->current_monitor_mode_spec = g_new0 (MetaMonitorModeSpec, 1);
 
-        return;
-      }
+          parser->state = STATE_MONITOR_MODE;
+        }
+      else if (g_str_equal (element_name, "underscanning"))
+        {
+          parser->state = STATE_MONITOR_UNDERSCANNING;
+        }
+      else
+        {
+          g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
+                       "Invalid monitor element '%s'", element_name);
+          return;
+        }
+
+      return;
+    }
 
     case STATE_MONITOR_SPEC:
-      {
-        if (g_str_equal (element_name, "connector"))
-          {
-            parser->state = STATE_MONITOR_SPEC_CONNECTOR;
-          }
-        else if (g_str_equal (element_name, "vendor"))
-          {
-            parser->state = STATE_MONITOR_SPEC_VENDOR;
-          }
-        else if (g_str_equal (element_name, "product"))
-          {
-            parser->state = STATE_MONITOR_SPEC_PRODUCT;
-          }
-        else if (g_str_equal (element_name, "serial"))
-          {
-            parser->state = STATE_MONITOR_SPEC_SERIAL;
-          }
-        else
-          {
-            g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
-                         "Invalid monitor spec element '%s'", element_name);
-            return;
-          }
+    {
+      if (g_str_equal (element_name, "connector"))
+        {
+          parser->state = STATE_MONITOR_SPEC_CONNECTOR;
+        }
+      else if (g_str_equal (element_name, "vendor"))
+        {
+          parser->state = STATE_MONITOR_SPEC_VENDOR;
+        }
+      else if (g_str_equal (element_name, "product"))
+        {
+          parser->state = STATE_MONITOR_SPEC_PRODUCT;
+        }
+      else if (g_str_equal (element_name, "serial"))
+        {
+          parser->state = STATE_MONITOR_SPEC_SERIAL;
+        }
+      else
+        {
+          g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
+                       "Invalid monitor spec element '%s'", element_name);
+          return;
+        }
 
-        return;
-      }
+      return;
+    }
 
     case STATE_MONITOR_SPEC_CONNECTOR:
     case STATE_MONITOR_SPEC_VENDOR:
     case STATE_MONITOR_SPEC_PRODUCT:
     case STATE_MONITOR_SPEC_SERIAL:
-      {
-        g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
-                     "Invalid monitor spec element '%s'", element_name);
-        return;
-      }
+    {
+      g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
+                   "Invalid monitor spec element '%s'", element_name);
+      return;
+    }
 
     case STATE_MONITOR_MODE:
-      {
-        if (g_str_equal (element_name, "width"))
-          {
-            parser->state = STATE_MONITOR_MODE_WIDTH;
-          }
-        else if (g_str_equal (element_name, "height"))
-          {
-            parser->state = STATE_MONITOR_MODE_HEIGHT;
-          }
-        else if (g_str_equal (element_name, "rate"))
-          {
-            parser->state = STATE_MONITOR_MODE_RATE;
-          }
-        else if (g_str_equal (element_name, "flag"))
-          {
-            parser->state = STATE_MONITOR_MODE_FLAG;
-          }
-        else
-          {
-            g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
-                         "Invalid mode element '%s'", element_name);
-            return;
-          }
+    {
+      if (g_str_equal (element_name, "width"))
+        {
+          parser->state = STATE_MONITOR_MODE_WIDTH;
+        }
+      else if (g_str_equal (element_name, "height"))
+        {
+          parser->state = STATE_MONITOR_MODE_HEIGHT;
+        }
+      else if (g_str_equal (element_name, "rate"))
+        {
+          parser->state = STATE_MONITOR_MODE_RATE;
+        }
+      else if (g_str_equal (element_name, "flag"))
+        {
+          parser->state = STATE_MONITOR_MODE_FLAG;
+        }
+      else
+        {
+          g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
+                       "Invalid mode element '%s'", element_name);
+          return;
+        }
 
-        return;
-      }
+      return;
+    }
 
     case STATE_MONITOR_MODE_WIDTH:
     case STATE_MONITOR_MODE_HEIGHT:
     case STATE_MONITOR_MODE_RATE:
     case STATE_MONITOR_MODE_FLAG:
-      {
-        g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
-                     "Invalid mode sub element '%s'", element_name);
-        return;
-      }
+    {
+      g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
+                   "Invalid mode sub element '%s'", element_name);
+      return;
+    }
 
     case STATE_MONITOR_UNDERSCANNING:
-      {
-        g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
-                     "Invalid element '%s' under underscanning", element_name);
-        return;
-      }
+    {
+      g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
+                   "Invalid element '%s' under underscanning", element_name);
+      return;
+    }
 
     case STATE_DISABLED:
-      {
-        if (!g_str_equal (element_name, "monitorspec"))
-          {
-            g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
-                         "Invalid element '%s' under disabled", element_name);
-            return;
-          }
+    {
+      if (!g_str_equal (element_name, "monitorspec"))
+        {
+          g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
+                       "Invalid element '%s' under disabled", element_name);
+          return;
+        }
 
-        parser->current_monitor_spec = g_new0 (MetaMonitorSpec, 1);
-        parser->monitor_spec_parent_state = STATE_DISABLED;
-        parser->state = STATE_MONITOR_SPEC;
+      parser->current_monitor_spec = g_new0 (MetaMonitorSpec, 1);
+      parser->monitor_spec_parent_state = STATE_DISABLED;
+      parser->state = STATE_MONITOR_SPEC;
 
-        return;
-      }
+      return;
+    }
     }
 }
 
 static gboolean
-derive_logical_monitor_layout (MetaLogicalMonitorConfig    *logical_monitor_config,
-                               MetaLogicalMonitorLayoutMode layout_mode,
-                               GError                     **error)
+derive_logical_monitor_layout (
+  MetaLogicalMonitorConfig    *logical_monitor_config,
+  MetaLogicalMonitorLayoutMode layout_mode,
+  GError                     **error)
 {
   MetaMonitorConfig *monitor_config;
   int mode_width, mode_height;
@@ -551,22 +555,22 @@ finish_monitor_spec (ConfigParser *parser)
   switch (parser->monitor_spec_parent_state)
     {
     case STATE_MONITOR:
-      {
-        parser->current_monitor_config->monitor_spec =
-          parser->current_monitor_spec;
-        parser->current_monitor_spec = NULL;
+    {
+      parser->current_monitor_config->monitor_spec =
+        parser->current_monitor_spec;
+      parser->current_monitor_spec = NULL;
 
-        return;
-      }
+      return;
+    }
     case STATE_DISABLED:
-      {
-        parser->current_disabled_monitor_specs =
-          g_list_prepend (parser->current_disabled_monitor_specs,
-                          parser->current_monitor_spec);
-        parser->current_monitor_spec = NULL;
+    {
+      parser->current_disabled_monitor_specs =
+        g_list_prepend (parser->current_disabled_monitor_specs,
+                        parser->current_monitor_spec);
+      parser->current_monitor_spec = NULL;
 
-        return;
-      }
+      return;
+    }
 
     default:
       g_assert_not_reached ();
@@ -574,10 +578,10 @@ finish_monitor_spec (ConfigParser *parser)
 }
 
 static void
-handle_end_element (GMarkupParseContext  *context,
-                    const char           *element_name,
-                    gpointer              user_data,
-                    GError              **error)
+handle_end_element (GMarkupParseContext *context,
+                    const char          *element_name,
+                    gpointer             user_data,
+                    GError             **error)
 {
   ConfigParser *parser = user_data;
 
@@ -588,227 +592,227 @@ handle_end_element (GMarkupParseContext  *context,
     case STATE_LOGICAL_MONITOR_SCALE:
     case STATE_LOGICAL_MONITOR_PRIMARY:
     case STATE_LOGICAL_MONITOR_PRESENTATION:
-      {
-        parser->state = STATE_LOGICAL_MONITOR;
-        return;
-      }
+    {
+      parser->state = STATE_LOGICAL_MONITOR;
+      return;
+    }
 
     case STATE_TRANSFORM:
-      {
-        g_assert (g_str_equal (element_name, "transform"));
+    {
+      g_assert (g_str_equal (element_name, "transform"));
 
-        parser->current_logical_monitor_config->transform =
-          parser->current_transform;
-        if (parser->current_transform_flipped)
-          {
-            parser->current_logical_monitor_config->transform +=
-              META_MONITOR_TRANSFORM_FLIPPED;
-          }
+      parser->current_logical_monitor_config->transform =
+        parser->current_transform;
+      if (parser->current_transform_flipped)
+        {
+          parser->current_logical_monitor_config->transform +=
+            META_MONITOR_TRANSFORM_FLIPPED;
+        }
 
-        parser->current_transform = META_MONITOR_TRANSFORM_NORMAL;
-        parser->current_transform_flipped = FALSE;
+      parser->current_transform = META_MONITOR_TRANSFORM_NORMAL;
+      parser->current_transform_flipped = FALSE;
 
-        parser->state = STATE_LOGICAL_MONITOR;
-        return;
-      }
+      parser->state = STATE_LOGICAL_MONITOR;
+      return;
+    }
 
     case STATE_TRANSFORM_ROTATION:
     case STATE_TRANSFORM_FLIPPED:
-      {
-        parser->state = STATE_TRANSFORM;
-        return;
-      }
+    {
+      parser->state = STATE_TRANSFORM;
+      return;
+    }
 
     case STATE_MONITOR_SPEC_CONNECTOR:
     case STATE_MONITOR_SPEC_VENDOR:
     case STATE_MONITOR_SPEC_PRODUCT:
     case STATE_MONITOR_SPEC_SERIAL:
-      {
-        parser->state = STATE_MONITOR_SPEC;
-        return;
-      }
+    {
+      parser->state = STATE_MONITOR_SPEC;
+      return;
+    }
 
     case STATE_MONITOR_SPEC:
-      {
-        g_assert (g_str_equal (element_name, "monitorspec"));
+    {
+      g_assert (g_str_equal (element_name, "monitorspec"));
 
-        if (!meta_verify_monitor_spec (parser->current_monitor_spec, error))
-          return;
+      if (!meta_verify_monitor_spec (parser->current_monitor_spec, error))
+        return;
 
-        finish_monitor_spec (parser);
+      finish_monitor_spec (parser);
 
-        parser->state = parser->monitor_spec_parent_state;
-        return;
-      }
+      parser->state = parser->monitor_spec_parent_state;
+      return;
+    }
 
     case STATE_MONITOR_MODE_WIDTH:
     case STATE_MONITOR_MODE_HEIGHT:
     case STATE_MONITOR_MODE_RATE:
     case STATE_MONITOR_MODE_FLAG:
-      {
-        parser->state = STATE_MONITOR_MODE;
-        return;
-      }
+    {
+      parser->state = STATE_MONITOR_MODE;
+      return;
+    }
 
     case STATE_MONITOR_MODE:
-      {
-        g_assert (g_str_equal (element_name, "mode"));
+    {
+      g_assert (g_str_equal (element_name, "mode"));
 
-        if (!meta_verify_monitor_mode_spec (parser->current_monitor_mode_spec,
-                                            error))
-          return;
+      if (!meta_verify_monitor_mode_spec (parser->current_monitor_mode_spec,
+                                          error))
+        return;
 
-        parser->current_monitor_config->mode_spec =
-          parser->current_monitor_mode_spec;
-        parser->current_monitor_mode_spec = NULL;
+      parser->current_monitor_config->mode_spec =
+        parser->current_monitor_mode_spec;
+      parser->current_monitor_mode_spec = NULL;
 
-        parser->state = STATE_MONITOR;
-        return;
-      }
+      parser->state = STATE_MONITOR;
+      return;
+    }
 
     case STATE_MONITOR_UNDERSCANNING:
-      {
-        g_assert (g_str_equal (element_name, "underscanning"));
+    {
+      g_assert (g_str_equal (element_name, "underscanning"));
 
-        parser->state = STATE_MONITOR;
-        return;
-      }
+      parser->state = STATE_MONITOR;
+      return;
+    }
 
     case STATE_MONITOR:
-      {
-        MetaLogicalMonitorConfig *logical_monitor_config;
+    {
+      MetaLogicalMonitorConfig *logical_monitor_config;
 
-        g_assert (g_str_equal (element_name, "monitor"));
+      g_assert (g_str_equal (element_name, "monitor"));
 
-        if (!meta_verify_monitor_config (parser->current_monitor_config, error))
-          return;
+      if (!meta_verify_monitor_config (parser->current_monitor_config, error))
+        return;
 
-        logical_monitor_config = parser->current_logical_monitor_config;
+      logical_monitor_config = parser->current_logical_monitor_config;
 
-        logical_monitor_config->monitor_configs =
-          g_list_append (logical_monitor_config->monitor_configs,
-                         parser->current_monitor_config);
-        parser->current_monitor_config = NULL;
+      logical_monitor_config->monitor_configs =
+        g_list_append (logical_monitor_config->monitor_configs,
+                       parser->current_monitor_config);
+      parser->current_monitor_config = NULL;
 
-        parser->state = STATE_LOGICAL_MONITOR;
-        return;
-      }
+      parser->state = STATE_LOGICAL_MONITOR;
+      return;
+    }
 
     case STATE_LOGICAL_MONITOR:
-      {
-        MetaLogicalMonitorConfig *logical_monitor_config =
-          parser->current_logical_monitor_config;
+    {
+      MetaLogicalMonitorConfig *logical_monitor_config =
+        parser->current_logical_monitor_config;
 
-        g_assert (g_str_equal (element_name, "logicalmonitor"));
+      g_assert (g_str_equal (element_name, "logicalmonitor"));
 
-        if (parser->current_was_migrated)
-          logical_monitor_config->scale = -1;
-        else if (logical_monitor_config->scale == 0)
-          logical_monitor_config->scale = 1;
+      if (parser->current_was_migrated)
+        logical_monitor_config->scale = -1;
+      else if (logical_monitor_config->scale == 0)
+        logical_monitor_config->scale = 1;
 
-        parser->current_logical_monitor_configs =
-          g_list_append (parser->current_logical_monitor_configs,
-                         logical_monitor_config);
-        parser->current_logical_monitor_config = NULL;
+      parser->current_logical_monitor_configs =
+        g_list_append (parser->current_logical_monitor_configs,
+                       logical_monitor_config);
+      parser->current_logical_monitor_config = NULL;
 
-        parser->state = STATE_CONFIGURATION;
-        return;
-      }
+      parser->state = STATE_CONFIGURATION;
+      return;
+    }
 
     case STATE_MIGRATED:
-      {
-        g_assert (g_str_equal (element_name, "migrated"));
+    {
+      g_assert (g_str_equal (element_name, "migrated"));
 
-        parser->state = STATE_CONFIGURATION;
-        return;
-      }
+      parser->state = STATE_CONFIGURATION;
+      return;
+    }
 
     case STATE_DISABLED:
-      {
-        g_assert (g_str_equal (element_name, "disabled"));
+    {
+      g_assert (g_str_equal (element_name, "disabled"));
 
-        parser->state = STATE_CONFIGURATION;
-        return;
-      }
+      parser->state = STATE_CONFIGURATION;
+      return;
+    }
 
     case STATE_CONFIGURATION:
-      {
-        MetaMonitorConfigStore *store = parser->config_store;
-        MetaMonitorsConfig *config;
-        GList *l;
-        MetaLogicalMonitorLayoutMode layout_mode;
-        MetaMonitorsConfigFlag config_flags = META_MONITORS_CONFIG_FLAG_NONE;
-
-        g_assert (g_str_equal (element_name, "configuration"));
-
-        if (parser->current_was_migrated)
-          layout_mode = META_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL;
-        else
-          layout_mode =
-            meta_monitor_manager_get_default_layout_mode (store->monitor_manager);
-
-        for (l = parser->current_logical_monitor_configs; l; l = l->next)
-          {
-            MetaLogicalMonitorConfig *logical_monitor_config = l->data;
-
-            if (!derive_logical_monitor_layout (logical_monitor_config,
-                                                layout_mode,
-                                                error))
-              return;
-
-            if (!meta_verify_logical_monitor_config (logical_monitor_config,
-                                                     layout_mode,
-                                                     store->monitor_manager,
-                                                     error))
-              return;
-          }
-
-        if (parser->current_was_migrated)
-          config_flags |= META_MONITORS_CONFIG_FLAG_MIGRATED;
-
-        config =
-          meta_monitors_config_new_full (parser->current_logical_monitor_configs,
-                                         parser->current_disabled_monitor_specs,
-                                         layout_mode,
-                                         config_flags);
-
-        parser->current_logical_monitor_configs = NULL;
-        parser->current_disabled_monitor_specs = NULL;
-
-        if (!meta_verify_monitors_config (config, store->monitor_manager,
-                                          error))
-          {
-            g_object_unref (config);
+    {
+      MetaMonitorConfigStore *store = parser->config_store;
+      MetaMonitorsConfig *config;
+      GList *l;
+      MetaLogicalMonitorLayoutMode layout_mode;
+      MetaMonitorsConfigFlag config_flags = META_MONITORS_CONFIG_FLAG_NONE;
+
+      g_assert (g_str_equal (element_name, "configuration"));
+
+      if (parser->current_was_migrated)
+        layout_mode = META_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL;
+      else
+        layout_mode =
+          meta_monitor_manager_get_default_layout_mode (store->monitor_manager);
+
+      for (l = parser->current_logical_monitor_configs; l; l = l->next)
+        {
+          MetaLogicalMonitorConfig *logical_monitor_config = l->data;
+
+          if (!derive_logical_monitor_layout (logical_monitor_config,
+                                              layout_mode,
+                                              error))
+            return;
+
+          if (!meta_verify_logical_monitor_config (logical_monitor_config,
+                                                   layout_mode,
+                                                   store->monitor_manager,
+                                                   error))
             return;
-          }
+        }
 
-        g_hash_table_replace (parser->config_store->configs,
-                              config->key, config);
+      if (parser->current_was_migrated)
+        config_flags |= META_MONITORS_CONFIG_FLAG_MIGRATED;
 
-        parser->state = STATE_MONITORS;
-        return;
-      }
+      config =
+        meta_monitors_config_new_full (parser->current_logical_monitor_configs,
+                                       parser->current_disabled_monitor_specs,
+                                       layout_mode,
+                                       config_flags);
+
+      parser->current_logical_monitor_configs = NULL;
+      parser->current_disabled_monitor_specs = NULL;
+
+      if (!meta_verify_monitors_config (config, store->monitor_manager,
+                                        error))
+        {
+          g_object_unref (config);
+          return;
+        }
+
+      g_hash_table_replace (parser->config_store->configs,
+                            config->key, config);
+
+      parser->state = STATE_MONITORS;
+      return;
+    }
 
     case STATE_MONITORS:
-      {
-        g_assert (g_str_equal (element_name, "monitors"));
+    {
+      g_assert (g_str_equal (element_name, "monitors"));
 
-        parser->state = STATE_INITIAL;
-        return;
-      }
+      parser->state = STATE_INITIAL;
+      return;
+    }
 
     case STATE_INITIAL:
-      {
-        g_assert_not_reached ();
-      }
+    {
+      g_assert_not_reached ();
+    }
     }
 }
 
 static gboolean
-read_int (const char  *text,
-          gsize        text_len,
-          gint        *out_value,
-          GError     **error)
+read_int (const char *text,
+          gsize       text_len,
+          gint       *out_value,
+          GError    **error)
 {
   char buf[64];
   int64_t value;
@@ -833,10 +837,10 @@ read_int (const char  *text,
 }
 
 static gboolean
-read_float (const char  *text,
-            gsize        text_len,
-            float       *out_value,
-            GError     **error)
+read_float (const char *text,
+            gsize       text_len,
+            float      *out_value,
+            GError    **error)
 {
   char buf[64];
   float value;
@@ -861,10 +865,10 @@ read_float (const char  *text,
 }
 
 static gboolean
-read_bool (const char  *text,
-           gsize        text_len,
-           gboolean    *out_value,
-           GError     **error)
+read_bool (const char *text,
+           gsize       text_len,
+           gboolean   *out_value,
+           GError    **error)
 {
   if (strncmp (text, "no", text_len) == 0)
     {
@@ -918,160 +922,161 @@ handle_text (GMarkupParseContext *context,
     case STATE_MONITOR_MODE:
     case STATE_TRANSFORM:
     case STATE_DISABLED:
-      {
-        if (!is_all_whitespace (text, text_len))
-          g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
-                       "Unexpected content at this point");
-        return;
-      }
+    {
+      if (!is_all_whitespace (text, text_len))
+        g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
+                     "Unexpected content at this point");
+      return;
+    }
 
     case STATE_MONITOR_SPEC_CONNECTOR:
-      {
-        parser->current_monitor_spec->connector = g_strndup (text, text_len);
-        return;
-      }
+    {
+      parser->current_monitor_spec->connector = g_strndup (text, text_len);
+      return;
+    }
 
     case STATE_MONITOR_SPEC_VENDOR:
-      {
-        parser->current_monitor_spec->vendor = g_strndup (text, text_len);
-        return;
-      }
+    {
+      parser->current_monitor_spec->vendor = g_strndup (text, text_len);
+      return;
+    }
 
     case STATE_MONITOR_SPEC_PRODUCT:
-      {
-        parser->current_monitor_spec->product = g_strndup (text, text_len);
-        return;
-      }
+    {
+      parser->current_monitor_spec->product = g_strndup (text, text_len);
+      return;
+    }
 
     case STATE_MONITOR_SPEC_SERIAL:
-      {
-        parser->current_monitor_spec->serial = g_strndup (text, text_len);
-        return;
-      }
+    {
+      parser->current_monitor_spec->serial = g_strndup (text, text_len);
+      return;
+    }
 
     case STATE_LOGICAL_MONITOR_X:
-      {
-        read_int (text, text_len,
-                  &parser->current_logical_monitor_config->layout.x, error);
-        return;
-      }
+    {
+      read_int (text, text_len,
+                &parser->current_logical_monitor_config->layout.x, error);
+      return;
+    }
 
     case STATE_LOGICAL_MONITOR_Y:
-      {
-        read_int (text, text_len,
-                  &parser->current_logical_monitor_config->layout.y, error);
-        return;
-      }
+    {
+      read_int (text, text_len,
+                &parser->current_logical_monitor_config->layout.y, error);
+      return;
+    }
 
     case STATE_LOGICAL_MONITOR_SCALE:
-      {
-        if (!read_float (text, text_len,
-                         &parser->current_logical_monitor_config->scale, error))
-          return;
+    {
+      if (!read_float (text, text_len,
+                       &parser->current_logical_monitor_config->scale, error))
+        return;
 
-        if (parser->current_logical_monitor_config->scale <= 0.0)
-          {
-            g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
-                         "Logical monitor scale '%g' invalid",
-                         parser->current_logical_monitor_config->scale);
-            return;
-          }
+      if (parser->current_logical_monitor_config->scale <= 0.0)
+        {
+          g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+                       "Logical monitor scale '%g' invalid",
+                       parser->current_logical_monitor_config->scale);
+          return;
+        }
 
-        return;
-      }
+      return;
+    }
 
     case STATE_LOGICAL_MONITOR_PRIMARY:
-      {
-        read_bool (text, text_len,
-                   &parser->current_logical_monitor_config->is_primary,
-                   error);
-        return;
-      }
+    {
+      read_bool (text, text_len,
+                 &parser->current_logical_monitor_config->is_primary,
+                 error);
+      return;
+    }
 
     case STATE_LOGICAL_MONITOR_PRESENTATION:
-      {
-        read_bool (text, text_len,
-                   &parser->current_logical_monitor_config->is_presentation,
-                   error);
-        return;
-      }
+    {
+      read_bool (text, text_len,
+                 &parser->current_logical_monitor_config->is_presentation,
+                 error);
+      return;
+    }
 
     case STATE_TRANSFORM_ROTATION:
-      {
-        if (strncmp (text, "normal", text_len) == 0)
-          parser->current_transform = META_MONITOR_TRANSFORM_NORMAL;
-        else if (strncmp (text, "left", text_len) == 0)
-          parser->current_transform = META_MONITOR_TRANSFORM_90;
-        else if (strncmp (text, "upside_down", text_len) == 0)
-          parser->current_transform = META_MONITOR_TRANSFORM_180;
-        else if (strncmp (text, "right", text_len) == 0)
-          parser->current_transform = META_MONITOR_TRANSFORM_270;
-        else
-          g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
-                       "Invalid rotation type %.*s", (int)text_len, text);
+    {
+      if (strncmp (text, "normal", text_len) == 0)
+        parser->current_transform = META_MONITOR_TRANSFORM_NORMAL;
+      else if (strncmp (text, "left", text_len) == 0)
+        parser->current_transform = META_MONITOR_TRANSFORM_90;
+      else if (strncmp (text, "upside_down", text_len) == 0)
+        parser->current_transform = META_MONITOR_TRANSFORM_180;
+      else if (strncmp (text, "right", text_len) == 0)
+        parser->current_transform = META_MONITOR_TRANSFORM_270;
+      else
+        g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
+                     "Invalid rotation type %.*s", (int) text_len, text);
 
-        return;
-      }
+      return;
+    }
 
     case STATE_TRANSFORM_FLIPPED:
-      {
-        read_bool (text, text_len,
-                   &parser->current_transform_flipped,
-                   error);
-        return;
-      }
+    {
+      read_bool (text, text_len,
+                 &parser->current_transform_flipped,
+                 error);
+      return;
+    }
 
     case STATE_MONITOR_MODE_WIDTH:
-      {
-        read_int (text, text_len,
-                  &parser->current_monitor_mode_spec->width,
-                  error);
-        return;
-      }
+    {
+      read_int (text, text_len,
+                &parser->current_monitor_mode_spec->width,
+                error);
+      return;
+    }
 
     case STATE_MONITOR_MODE_HEIGHT:
-      {
-        read_int (text, text_len,
-                  &parser->current_monitor_mode_spec->height,
-                  error);
-        return;
-      }
+    {
+      read_int (text, text_len,
+                &parser->current_monitor_mode_spec->height,
+                error);
+      return;
+    }
 
     case STATE_MONITOR_MODE_RATE:
-      {
-        read_float (text, text_len,
-                    &parser->current_monitor_mode_spec->refresh_rate,
-                    error);
-        return;
-      }
+    {
+      read_float (text, text_len,
+                  &parser->current_monitor_mode_spec->refresh_rate,
+                  error);
+      return;
+    }
 
     case STATE_MONITOR_MODE_FLAG:
-      {
-        if (strncmp (text, "interlace", text_len) == 0)
-          {
-            parser->current_monitor_mode_spec->flags |=
-              META_CRTC_MODE_FLAG_INTERLACE;
-          }
-        else
-          {
-            g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
-                         "Invalid mode flag %.*s", (int) text_len, text);
-          }
+    {
+      if (strncmp (text, "interlace", text_len) == 0)
+        {
+          parser->current_monitor_mode_spec->flags |=
+            META_CRTC_MODE_FLAG_INTERLACE;
+        }
+      else
+        {
+          g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
+                       "Invalid mode flag %.*s", (int) text_len, text);
+        }
 
-        return;
-      }
+      return;
+    }
 
     case STATE_MONITOR_UNDERSCANNING:
-      {
-        read_bool (text, text_len,
-                   &parser->current_monitor_config->enable_underscanning,
-                   error);
-        return;
-      }
+    {
+      read_bool (text, text_len,
+                 &parser->current_monitor_config->enable_underscanning,
+                 error);
+      return;
+    }
     }
 }
 
-static const GMarkupParser config_parser = {
+static const GMarkupParser config_parser =
+{
   .start_element = handle_start_element,
   .end_element = handle_end_element,
   .text = handle_text
@@ -1107,7 +1112,7 @@ read_config_file (MetaMonitorConfigStore *config_store,
                        meta_monitor_spec_free);
       g_free (parser.current_monitor_mode_spec);
       g_clear_pointer (&parser.current_monitor_config,
-                      meta_monitor_config_free);
+                       meta_monitor_config_free);
       g_clear_pointer (&parser.current_logical_monitor_config,
                        meta_logical_monitor_config_free);
       return FALSE;
@@ -1175,7 +1180,8 @@ append_monitors (GString *buffer,
         g_string_append_printf (buffer, "          <flag>interlace</flag>\n");
       g_string_append (buffer, "        </mode>\n");
       if (monitor_config->enable_underscanning)
-        g_string_append (buffer, "        <underscanning>yes</underscanning>\n");
+        g_string_append (buffer,
+                         "        <underscanning>yes</underscanning>\n");
       g_string_append (buffer, "      </monitor>\n");
     }
 }
@@ -1324,7 +1330,8 @@ saved_cb (GObject      *object,
     {
       if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
         {
-          g_warning ("Saving monitor configuration failed: %s\n", error->message);
+          g_warning ("Saving monitor configuration failed: %s\n",
+                     error->message);
           g_clear_object (&data->config_store->save_cancellable);
         }
 
@@ -1468,7 +1475,8 @@ meta_monitor_config_store_get_config_count (MetaMonitorConfigStore *config_store
 }
 
 MetaMonitorManager *
-meta_monitor_config_store_get_monitor_manager (MetaMonitorConfigStore *config_store)
+meta_monitor_config_store_get_monitor_manager (
+  MetaMonitorConfigStore *config_store)
 {
   return config_store->monitor_manager;
 }
diff --git a/src/backends/meta-monitor-manager-dummy.c b/src/backends/meta-monitor-manager-dummy.c
index f11bf5cf7..2775a8ed2 100644
--- a/src/backends/meta-monitor-manager-dummy.c
+++ b/src/backends/meta-monitor-manager-dummy.c
@@ -62,7 +62,8 @@ typedef struct _MetaOutputDummy
   float scale;
 } MetaOutputDummy;
 
-G_DEFINE_TYPE (MetaMonitorManagerDummy, meta_monitor_manager_dummy, META_TYPE_MONITOR_MANAGER);
+G_DEFINE_TYPE (MetaMonitorManagerDummy, meta_monitor_manager_dummy,
+               META_TYPE_MONITOR_MANAGER);
 
 struct _MetaGpuDummy
 {
@@ -106,7 +107,8 @@ append_monitor (MetaMonitorManager *manager,
 {
   MetaMonitorManagerDummy *manager_dummy = META_MONITOR_MANAGER_DUMMY (manager);
   MetaGpu *gpu = manager_dummy->gpu;
-  CrtcModeSpec mode_specs[] = {
+  CrtcModeSpec mode_specs[] =
+  {
     {
       .width = 800,
       .height = 600,
@@ -195,7 +197,8 @@ append_tiled_monitor (MetaMonitorManager *manager,
 {
   MetaMonitorManagerDummy *manager_dummy = META_MONITOR_MANAGER_DUMMY (manager);
   MetaGpu *gpu = manager_dummy->gpu;
-  CrtcModeSpec mode_specs[] = {
+  CrtcModeSpec mode_specs[] =
+  {
     {
       .width = 800,
       .height = 600,
@@ -483,7 +486,7 @@ apply_crtc_assignments (MetaMonitorManager *manager,
 
           for (j = 0; j < crtc_info->outputs->len; j++)
             {
-              output = ((MetaOutput**)crtc_info->outputs->pdata)[j];
+              output = ((MetaOutput **) crtc_info->outputs->pdata)[j];
 
               output->is_dirty = TRUE;
               meta_output_assign_crtc (output, crtc);
@@ -566,10 +569,11 @@ update_screen_size (MetaMonitorManager *manager,
 }
 
 static gboolean
-meta_monitor_manager_dummy_apply_monitors_config (MetaMonitorManager      *manager,
-                                                  MetaMonitorsConfig      *config,
-                                                  MetaMonitorsConfigMethod method,
-                                                  GError                 **error)
+meta_monitor_manager_dummy_apply_monitors_config (
+  MetaMonitorManager      *manager,
+  MetaMonitorsConfig      *config,
+  MetaMonitorsConfigMethod method,
+  GError                 **error)
 {
   GPtrArray *crtc_infos;
   GPtrArray *output_infos;
@@ -621,9 +625,10 @@ meta_monitor_manager_dummy_is_transform_handled (MetaMonitorManager  *manager,
 }
 
 static float
-meta_monitor_manager_dummy_calculate_monitor_mode_scale (MetaMonitorManager *manager,
-                                                         MetaMonitor        *monitor,
-                                                         MetaMonitorMode    *monitor_mode)
+meta_monitor_manager_dummy_calculate_monitor_mode_scale (
+  MetaMonitorManager *manager,
+  MetaMonitor        *monitor,
+  MetaMonitorMode    *monitor_mode)
 {
   MetaOutput *output;
   MetaOutputDummy *output_dummy;
@@ -635,11 +640,12 @@ meta_monitor_manager_dummy_calculate_monitor_mode_scale (MetaMonitorManager *man
 }
 
 static float *
-meta_monitor_manager_dummy_calculate_supported_scales (MetaMonitorManager          *manager,
-                                                       MetaLogicalMonitorLayoutMode layout_mode,
-                                                       MetaMonitor                 *monitor,
-                                                       MetaMonitorMode             *monitor_mode,
-                                                       int                         *n_supported_scales)
+meta_monitor_manager_dummy_calculate_supported_scales (
+  MetaMonitorManager          *manager,
+  MetaLogicalMonitorLayoutMode layout_mode,
+  MetaMonitor                 *monitor,
+  MetaMonitorMode             *monitor_mode,
+  int                         *n_supported_scales)
 {
   MetaMonitorScalesConstraint constraints =
     META_MONITOR_SCALES_CONSTRAINT_NONE;
@@ -718,14 +724,21 @@ meta_monitor_manager_dummy_class_init (MetaMonitorManagerDummyClass *klass)
 {
   MetaMonitorManagerClass *manager_class = META_MONITOR_MANAGER_CLASS (klass);
 
-  manager_class->ensure_initial_config = meta_monitor_manager_dummy_ensure_initial_config;
-  manager_class->apply_monitors_config = meta_monitor_manager_dummy_apply_monitors_config;
-  manager_class->is_transform_handled = meta_monitor_manager_dummy_is_transform_handled;
-  manager_class->calculate_monitor_mode_scale = meta_monitor_manager_dummy_calculate_monitor_mode_scale;
-  manager_class->calculate_supported_scales = meta_monitor_manager_dummy_calculate_supported_scales;
+  manager_class->ensure_initial_config =
+    meta_monitor_manager_dummy_ensure_initial_config;
+  manager_class->apply_monitors_config =
+    meta_monitor_manager_dummy_apply_monitors_config;
+  manager_class->is_transform_handled =
+    meta_monitor_manager_dummy_is_transform_handled;
+  manager_class->calculate_monitor_mode_scale =
+    meta_monitor_manager_dummy_calculate_monitor_mode_scale;
+  manager_class->calculate_supported_scales =
+    meta_monitor_manager_dummy_calculate_supported_scales;
   manager_class->get_capabilities = meta_monitor_manager_dummy_get_capabilities;
-  manager_class->get_max_screen_size = meta_monitor_manager_dummy_get_max_screen_size;
-  manager_class->get_default_layout_mode = meta_monitor_manager_dummy_get_default_layout_mode;
+  manager_class->get_max_screen_size =
+    meta_monitor_manager_dummy_get_max_screen_size;
+  manager_class->get_default_layout_mode =
+    meta_monitor_manager_dummy_get_default_layout_mode;
 }
 
 static void
@@ -748,8 +761,8 @@ meta_monitor_manager_dummy_init (MetaMonitorManagerDummy *manager_dummy)
 }
 
 static gboolean
-meta_gpu_dummy_read_current (MetaGpu  *gpu,
-                             GError  **error)
+meta_gpu_dummy_read_current (MetaGpu *gpu,
+                             GError **error)
 {
   MetaMonitorManager *manager = meta_gpu_get_monitor_manager (gpu);
 
diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c
index a411055fc..896201e6b 100644
--- a/src/backends/meta-monitor-manager.c
+++ b/src/backends/meta-monitor-manager.c
@@ -58,30 +58,36 @@ enum
 
 static GParamSpec *obj_props[PROP_LAST];
 
-enum {
+enum
+{
   MONITORS_CHANGED_INTERNAL,
   CONFIRM_DISPLAY_CHANGE,
   SIGNALS_LAST
 };
 
 /* Array index matches MetaMonitorTransform */
-static gfloat transform_matrices[][6] = {
-  {  1,  0,  0,  0,  1,  0 }, /* normal */
-  {  0, -1,  1,  1,  0,  0 }, /* 90° */
-  { -1,  0,  1,  0, -1,  1 }, /* 180° */
-  {  0,  1,  0, -1,  0,  1 }, /* 270° */
-  { -1,  0,  1,  0,  1,  0 }, /* normal flipped */
-  {  0,  1,  0,  1,  0,  0 }, /* 90° flipped */
-  {  1,  0,  0,  0, -1,  1 }, /* 180° flipped */
-  {  0, -1,  1, -1,  0,  1 }, /* 270° flipped */
+static gfloat transform_matrices[][6] =
+{
+  {  1, 0, 0, 0, 1, 0 },      /* normal */
+  {  0, -1, 1, 1, 0, 0 },     /* 90° */
+  { -1, 0, 1, 0, -1, 1 },     /* 180° */
+  {  0, 1, 0, -1, 0, 1 },     /* 270° */
+  { -1, 0, 1, 0, 1, 0 },      /* normal flipped */
+  {  0, 1, 0, 1, 0, 0 },      /* 90° flipped */
+  {  1, 0, 0, 0, -1, 1 },     /* 180° flipped */
+  {  0, -1, 1, -1, 0, 1 },    /* 270° flipped */
 };
 
 static int signals[SIGNALS_LAST];
 
-static void meta_monitor_manager_display_config_init (MetaDBusDisplayConfigIface *iface);
+static void meta_monitor_manager_display_config_init (
+  MetaDBusDisplayConfigIface *iface);
 
-G_DEFINE_ABSTRACT_TYPE_WITH_CODE (MetaMonitorManager, meta_monitor_manager, 
META_DBUS_TYPE_DISPLAY_CONFIG_SKELETON,
-                                  G_IMPLEMENT_INTERFACE (META_DBUS_TYPE_DISPLAY_CONFIG, 
meta_monitor_manager_display_config_init));
+G_DEFINE_ABSTRACT_TYPE_WITH_CODE (MetaMonitorManager, meta_monitor_manager,
+                                  META_DBUS_TYPE_DISPLAY_CONFIG_SKELETON,
+                                  G_IMPLEMENT_INTERFACE (
+                                    META_DBUS_TYPE_DISPLAY_CONFIG,
+                                    meta_monitor_manager_display_config_init));
 
 static void initialize_dbus_interface (MetaMonitorManager *manager);
 
@@ -234,8 +240,9 @@ derive_scale_from_config (MetaMonitorManager *manager,
 }
 
 static void
-meta_monitor_manager_rebuild_logical_monitors_derived (MetaMonitorManager *manager,
-                                                       MetaMonitorsConfig *config)
+meta_monitor_manager_rebuild_logical_monitors_derived (
+  MetaMonitorManager *manager,
+  MetaMonitorsConfig *config)
 {
   GList *logical_monitors = NULL;
   GList *l;
@@ -320,7 +327,8 @@ power_save_mode_changed (MetaMonitorManager *manager,
                          gpointer            user_data)
 {
   MetaMonitorManagerClass *klass;
-  int mode = meta_dbus_display_config_get_power_save_mode (META_DBUS_DISPLAY_CONFIG (manager));
+  int mode = meta_dbus_display_config_get_power_save_mode (META_DBUS_DISPLAY_CONFIG (
+                                                             manager));
 
   if (mode == META_POWER_SAVE_UNSUPPORTED)
     return;
@@ -328,7 +336,9 @@ power_save_mode_changed (MetaMonitorManager *manager,
   /* If DPMS is unsupported, force the property back. */
   if (manager->power_save_mode == META_POWER_SAVE_UNSUPPORTED)
     {
-      meta_dbus_display_config_set_power_save_mode (META_DBUS_DISPLAY_CONFIG (manager), 
META_POWER_SAVE_UNSUPPORTED);
+      meta_dbus_display_config_set_power_save_mode (META_DBUS_DISPLAY_CONFIG (
+                                                      manager),
+                                                    META_POWER_SAVE_UNSUPPORTED);
       return;
     }
 
@@ -374,11 +384,12 @@ meta_monitor_manager_calculate_monitor_mode_scale (MetaMonitorManager *manager,
 }
 
 float *
-meta_monitor_manager_calculate_supported_scales (MetaMonitorManager          *manager,
-                                                 MetaLogicalMonitorLayoutMode layout_mode,
-                                                 MetaMonitor                 *monitor,
-                                                 MetaMonitorMode             *monitor_mode,
-                                                 int                         *n_supported_scales)
+meta_monitor_manager_calculate_supported_scales (
+  MetaMonitorManager          *manager,
+  MetaLogicalMonitorLayoutMode layout_mode,
+  MetaMonitor                 *monitor,
+  MetaMonitorMode             *monitor_mode,
+  int                         *n_supported_scales)
 {
   MetaMonitorManagerClass *manager_class =
     META_MONITOR_MANAGER_GET_CLASS (manager);
@@ -516,7 +527,8 @@ meta_monitor_manager_ensure_configured (MetaMonitorManager *manager)
         }
     }
 
-  config = meta_monitor_config_manager_create_suggested (manager->config_manager);
+  config =
+    meta_monitor_config_manager_create_suggested (manager->config_manager);
   if (config)
     {
       if (!meta_monitor_manager_apply_monitors_config (manager,
@@ -561,8 +573,9 @@ meta_monitor_manager_ensure_configured (MetaMonitorManager *manager)
     }
 
   config =
-    meta_monitor_config_manager_create_for_switch_config (manager->config_manager,
-                                                          META_MONITOR_SWITCH_CONFIG_ALL_LINEAR);
+    meta_monitor_config_manager_create_for_switch_config (
+      manager->config_manager,
+      META_MONITOR_SWITCH_CONFIG_ALL_LINEAR);
   if (config)
     {
       if (!meta_monitor_manager_apply_monitors_config (manager,
@@ -581,7 +594,8 @@ meta_monitor_manager_ensure_configured (MetaMonitorManager *manager)
         }
     }
 
-  config = meta_monitor_config_manager_create_fallback (manager->config_manager);
+  config =
+    meta_monitor_config_manager_create_fallback (manager->config_manager);
   if (config)
     {
       if (!meta_monitor_manager_apply_monitors_config (manager,
@@ -836,11 +850,11 @@ meta_monitor_manager_class_init (MetaMonitorManagerClass *klass)
 
   signals[CONFIRM_DISPLAY_CHANGE] =
     g_signal_new ("confirm-display-change",
-                 G_TYPE_FROM_CLASS (object_class),
-                 G_SIGNAL_RUN_LAST,
-                 0,
+                  G_TYPE_FROM_CLASS (object_class),
+                  G_SIGNAL_RUN_LAST,
+                  0,
                   NULL, NULL, NULL,
-                 G_TYPE_NONE, 0);
+                  G_TYPE_NONE, 0);
 
   obj_props[PROP_BACKEND] =
     g_param_spec_object ("backend",
@@ -853,10 +867,11 @@ meta_monitor_manager_class_init (MetaMonitorManagerClass *klass)
   g_object_class_install_properties (object_class, PROP_LAST, obj_props);
 }
 
-static const double known_diagonals[] = {
-    12.1,
-    13.3,
-    15.6
+static const double known_diagonals[] =
+{
+  12.1,
+  13.3,
+  15.6
 };
 
 static char *
@@ -868,7 +883,7 @@ diagonal_to_str (double d)
     {
       double delta;
 
-      delta = fabs(known_diagonals[i] - d);
+      delta = fabs (known_diagonals[i] - d);
       if (delta < 0.1)
         return g_strdup_printf ("%0.1lf\"", known_diagonals[i]);
     }
@@ -884,7 +899,7 @@ make_display_name (MetaMonitorManager *manager,
   g_autofree char *vendor_name = NULL;
 
   if (meta_output_is_laptop (output))
-      return g_strdup (_("Built-in display"));
+    return g_strdup (_("Built-in display"));
 
   if (output->width_mm > 0 && output->height_mm > 0)
     {
@@ -952,8 +967,8 @@ get_connector_type_name (MetaConnectorType connector_type)
 }
 
 static GList *
-combine_gpu_lists (MetaMonitorManager    *manager,
-                   GList              * (*list_getter) (MetaGpu *gpu))
+combine_gpu_lists (MetaMonitorManager *manager,
+                   GList * (*list_getter)(MetaGpu *gpu))
 {
   GList *list = NULL;
   GList *l;
@@ -973,7 +988,8 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
                                            GDBusMethodInvocation *invocation)
 {
   MetaMonitorManager *manager = META_MONITOR_MANAGER (skeleton);
-  MetaMonitorManagerClass *manager_class = META_MONITOR_MANAGER_GET_CLASS (skeleton);
+  MetaMonitorManagerClass *manager_class = META_MONITOR_MANAGER_GET_CLASS (
+    skeleton);
   GList *combined_modes;
   GList *combined_outputs;
   GList *combined_crtcs;
@@ -988,7 +1004,8 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
   combined_crtcs = combine_gpu_lists (manager, meta_gpu_get_crtcs);
 
   g_variant_builder_init (&crtc_builder, G_VARIANT_TYPE ("a(uxiiiiiuaua{sv})"));
-  g_variant_builder_init (&output_builder, G_VARIANT_TYPE ("a(uxiausauaua{sv})"));
+  g_variant_builder_init (&output_builder,
+                          G_VARIANT_TYPE ("a(uxiausauaua{sv})"));
   g_variant_builder_init (&mode_builder, G_VARIANT_TYPE ("a(uxuudu)"));
 
   for (l = combined_crtcs, i = 0; l; l = l->next, i++)
@@ -1008,13 +1025,13 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
         current_mode_index = -1;
       g_variant_builder_add (&crtc_builder, "(uxiiiiiuaua{sv})",
                              i, /* ID */
-                             (gint64)crtc->crtc_id,
-                             (int)crtc->rect.x,
-                             (int)crtc->rect.y,
-                             (int)crtc->rect.width,
-                             (int)crtc->rect.height,
+                             (gint64) crtc->crtc_id,
+                             (int) crtc->rect.x,
+                             (int) crtc->rect.y,
+                             (int) crtc->rect.width,
+                             (int) crtc->rect.height,
                              current_mode_index,
-                             (guint32)crtc->transform,
+                             (guint32) crtc->transform,
                              &transforms,
                              NULL /* properties */);
     }
@@ -1069,22 +1086,28 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
       g_variant_builder_add (&properties, "{sv}", "height-mm",
                              g_variant_new_int32 (output->height_mm));
       g_variant_builder_add (&properties, "{sv}", "display-name",
-                             g_variant_new_take_string (make_display_name (manager, output)));
+                             g_variant_new_take_string (make_display_name (
+                                                          manager, output)));
       g_variant_builder_add (&properties, "{sv}", "backlight",
                              g_variant_new_int32 (output->backlight));
       g_variant_builder_add (&properties, "{sv}", "min-backlight-step",
-                             g_variant_new_int32 ((output->backlight_max - output->backlight_min) ?
-                                                  100 / (output->backlight_max - output->backlight_min) : 
-1));
+                             g_variant_new_int32 ((output->backlight_max -
+                                                   output->backlight_min) ?
+                                                  100 /
+                                                  (output->backlight_max -
+                                                   output->backlight_min) : -1));
       g_variant_builder_add (&properties, "{sv}", "primary",
                              g_variant_new_boolean (output->is_primary));
       g_variant_builder_add (&properties, "{sv}", "presentation",
                              g_variant_new_boolean (output->is_presentation));
       g_variant_builder_add (&properties, "{sv}", "connector-type",
-                             g_variant_new_string (get_connector_type_name (output->connector_type)));
+                             g_variant_new_string (get_connector_type_name (
+                                                     output->connector_type)));
       g_variant_builder_add (&properties, "{sv}", "underscanning",
                              g_variant_new_boolean (output->is_underscanning));
       g_variant_builder_add (&properties, "{sv}", "supports-underscanning",
-                             g_variant_new_boolean (output->supports_underscanning));
+                             g_variant_new_boolean (output->
+                                                    supports_underscanning));
 
       edid_file = manager_class->get_edid_file (manager, output);
       if (edid_file)
@@ -1099,7 +1122,8 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
           if (edid)
             {
               g_variant_builder_add (&properties, "{sv}", "edid",
-                                     g_variant_new_from_bytes (G_VARIANT_TYPE ("ay"),
+                                     g_variant_new_from_bytes (G_VARIANT_TYPE (
+                                                                 "ay"),
                                                                edid, TRUE));
               g_bytes_unref (edid);
             }
@@ -1123,7 +1147,7 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
       crtc_index = crtc ? g_list_index (combined_crtcs, crtc) : -1;
       g_variant_builder_add (&output_builder, "(uxiausauaua{sv})",
                              i, /* ID */
-                             (gint64)output->winsys_id,
+                             (gint64) output->winsys_id,
                              crtc_index,
                              &crtcs,
                              output->name,
@@ -1138,11 +1162,11 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
 
       g_variant_builder_add (&mode_builder, "(uxuudu)",
                              i, /* ID */
-                             (gint64)mode->mode_id,
-                             (guint32)mode->width,
-                             (guint32)mode->height,
-                             (double)mode->refresh_rate,
-                             (guint32)mode->flags);
+                             (gint64) mode->mode_id,
+                             (guint32) mode->width,
+                             (guint32) mode->height,
+                             (double) mode->refresh_rate,
+                             (guint32) mode->flags);
     }
 
   if (!meta_monitor_manager_get_max_screen_size (manager,
@@ -1157,9 +1181,12 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
   meta_dbus_display_config_complete_get_resources (skeleton,
                                                    invocation,
                                                    manager->serial,
-                                                   g_variant_builder_end (&crtc_builder),
-                                                   g_variant_builder_end (&output_builder),
-                                                   g_variant_builder_end (&mode_builder),
+                                                   g_variant_builder_end (&
+                                                                          crtc_builder),
+                                                   g_variant_builder_end (&
+                                                                          output_builder),
+                                                   g_variant_builder_end (&
+                                                                          mode_builder),
                                                    max_screen_width,
                                                    max_screen_height);
 
@@ -1231,9 +1258,10 @@ cancel_persistent_confirmation (MetaMonitorManager *manager)
 static void
 request_persistent_confirmation (MetaMonitorManager *manager)
 {
-  manager->persistent_timeout_id = g_timeout_add_seconds 
(meta_monitor_manager_get_display_configuration_timeout (),
-                                                          save_config_timeout,
-                                                          manager);
+  manager->persistent_timeout_id = g_timeout_add_seconds (
+    meta_monitor_manager_get_display_configuration_timeout (),
+    save_config_timeout,
+    manager);
   g_source_set_name_by_id (manager->persistent_timeout_id,
                            "[mutter] save_config_timeout");
 
@@ -1633,7 +1661,6 @@ create_monitor_config_from_variant (MetaMonitorManager *manager,
                                     GVariant           *monitor_config_variant,
                                     GError            **error)
 {
-
   MetaMonitorConfig *monitor_config = NULL;
   g_autofree char *connector = NULL;
   g_autofree char *mode_id = NULL;
@@ -1665,7 +1692,8 @@ create_monitor_config_from_variant (MetaMonitorManager *manager,
       return NULL;
     }
 
-  g_variant_lookup (properties_variant, "underscanning", "b", &enable_underscanning);
+  g_variant_lookup (properties_variant, "underscanning", "b",
+                    &enable_underscanning);
 
   monitor_spec = meta_monitor_spec_clone (meta_monitor_get_spec (monitor));
 
@@ -1781,10 +1809,11 @@ derive_logical_monitor_size (MetaMonitorConfig           *monitor_config,
 }
 
 static MetaLogicalMonitorConfig *
-create_logical_monitor_config_from_variant (MetaMonitorManager          *manager,
-                                            GVariant                    *logical_monitor_config_variant,
-                                            MetaLogicalMonitorLayoutMode layout_mode,
-                                            GError                     **error)
+create_logical_monitor_config_from_variant (
+  MetaMonitorManager          *manager,
+  GVariant                    *logical_monitor_config_variant,
+  MetaLogicalMonitorLayoutMode layout_mode,
+  GError                     **error)
 {
   MetaLogicalMonitorConfig *logical_monitor_config;
   int x, y, width, height;
@@ -1854,7 +1883,8 @@ create_logical_monitor_config_from_variant (MetaMonitorManager          *manager
 
   logical_monitor_config = g_new0 (MetaLogicalMonitorConfig, 1);
   *logical_monitor_config = (MetaLogicalMonitorConfig) {
-    .layout = {
+    .layout =
+    {
       .x = x,
       .y = y,
       .width = width,
@@ -1896,12 +1926,13 @@ is_valid_layout_mode (MetaLogicalMonitorLayoutMode layout_mode)
 }
 
 static gboolean
-meta_monitor_manager_handle_apply_monitors_config (MetaDBusDisplayConfig *skeleton,
-                                                   GDBusMethodInvocation *invocation,
-                                                   guint                  serial,
-                                                   guint                  method,
-                                                   GVariant              *logical_monitor_configs_variant,
-                                                   GVariant              *properties_variant)
+meta_monitor_manager_handle_apply_monitors_config (
+  MetaDBusDisplayConfig *skeleton,
+  GDBusMethodInvocation *invocation,
+  guint                  serial,
+  guint                  method,
+  GVariant              *logical_monitor_configs_variant,
+  GVariant              *properties_variant)
 {
   MetaMonitorManager *manager = META_MONITOR_MANAGER (skeleton);
   MetaMonitorManagerCapability capabilities;
@@ -2030,7 +2061,8 @@ meta_monitor_manager_handle_apply_monitors_config (MetaDBusDisplayConfig *skelet
   if (method == META_MONITORS_CONFIG_METHOD_PERSISTENT)
     request_persistent_confirmation (manager);
 
-  meta_dbus_display_config_complete_apply_monitors_config (skeleton, invocation);
+  meta_dbus_display_config_complete_apply_monitors_config (skeleton,
+                                                           invocation);
 
   return TRUE;
 }
@@ -2113,9 +2145,11 @@ meta_monitor_manager_handle_change_backlight  (MetaDBusDisplayConfig *skeleton,
       return TRUE;
     }
 
-  META_MONITOR_MANAGER_GET_CLASS (manager)->change_backlight (manager, output, value);
+  META_MONITOR_MANAGER_GET_CLASS (manager)->change_backlight (manager, output,
+                                                              value);
 
-  meta_dbus_display_config_complete_change_backlight (skeleton, invocation, output->backlight);
+  meta_dbus_display_config_complete_change_backlight (skeleton, invocation,
+                                                      output->backlight);
   return TRUE;
 }
 
@@ -2230,9 +2264,9 @@ meta_monitor_manager_handle_set_crtc_gamma  (MetaDBusDisplayConfig *skeleton,
   blue_bytes = g_variant_get_data_as_bytes (blue_v);
 
   size = g_bytes_get_size (red_bytes) / sizeof (unsigned short);
-  red = (unsigned short*) g_bytes_get_data (red_bytes, &dummy);
-  green = (unsigned short*) g_bytes_get_data (green_bytes, &dummy);
-  blue = (unsigned short*) g_bytes_get_data (blue_bytes, &dummy);
+  red = (unsigned short *) g_bytes_get_data (red_bytes, &dummy);
+  green = (unsigned short *) g_bytes_get_data (green_bytes, &dummy);
+  blue = (unsigned short *) g_bytes_get_data (blue_bytes, &dummy);
 
   klass = META_MONITOR_MANAGER_GET_CLASS (manager);
   if (klass->set_crtc_gamma)
@@ -2253,8 +2287,10 @@ meta_monitor_manager_display_config_init (MetaDBusDisplayConfigIface *iface)
   iface->handle_change_backlight = meta_monitor_manager_handle_change_backlight;
   iface->handle_get_crtc_gamma = meta_monitor_manager_handle_get_crtc_gamma;
   iface->handle_set_crtc_gamma = meta_monitor_manager_handle_set_crtc_gamma;
-  iface->handle_get_current_state = meta_monitor_manager_handle_get_current_state;
-  iface->handle_apply_monitors_config = meta_monitor_manager_handle_apply_monitors_config;
+  iface->handle_get_current_state =
+    meta_monitor_manager_handle_get_current_state;
+  iface->handle_apply_monitors_config =
+    meta_monitor_manager_handle_apply_monitors_config;
 }
 
 static void
@@ -2329,10 +2365,12 @@ meta_monitor_manager_get_logical_monitors (MetaMonitorManager *manager)
 }
 
 MetaLogicalMonitor *
-meta_monitor_manager_get_logical_monitor_from_number (MetaMonitorManager *manager,
-                                                      int                 number)
+meta_monitor_manager_get_logical_monitor_from_number (
+  MetaMonitorManager *manager,
+  int                 number)
 {
-  g_return_val_if_fail ((unsigned int) number < g_list_length (manager->logical_monitors), NULL);
+  g_return_val_if_fail ((unsigned int) number <
+                        g_list_length (manager->logical_monitors), NULL);
 
   return g_list_nth (manager->logical_monitors, number)->data;
 }
@@ -2345,7 +2383,7 @@ meta_monitor_manager_get_primary_logical_monitor (MetaMonitorManager *manager)
 
 static MetaMonitor *
 find_monitor (MetaMonitorManager *monitor_manager,
-              gboolean (*match_func) (MetaMonitor *monitor))
+              gboolean (*match_func)(MetaMonitor *monitor))
 {
   GList *monitors;
   GList *l;
@@ -2784,7 +2822,8 @@ meta_output_parse_edid (MetaOutput *output,
           output->product[0] == '\0')
         {
           g_clear_pointer (&output->product, g_free);
-          output->product = g_strdup_printf ("0x%04x", (unsigned) parsed_edid->product_code);
+          output->product = g_strdup_printf ("0x%04x",
+                                             (unsigned) parsed_edid->product_code);
         }
 
       output->serial = g_strndup (parsed_edid->dsc_serial_number, 14);
@@ -2792,13 +2831,14 @@ meta_output_parse_edid (MetaOutput *output,
           output->serial[0] == '\0')
         {
           g_clear_pointer (&output->serial, g_free);
-          output->serial = g_strdup_printf ("0x%08x", parsed_edid->serial_number);
+          output->serial =
+            g_strdup_printf ("0x%08x", parsed_edid->serial_number);
         }
 
       g_free (parsed_edid);
     }
 
- out:
+out:
   if (!output->vendor)
     output->vendor = g_strdup ("unknown");
   if (!output->product)
@@ -2837,7 +2877,7 @@ calculate_viewport_matrix (MetaMonitorManager *manager,
 
   x = (float) logical_monitor->rect.x / manager->screen_width;
   y = (float) logical_monitor->rect.y / manager->screen_height;
-  width  = (float) logical_monitor->rect.width / manager->screen_width;
+  width = (float) logical_monitor->rect.width / manager->screen_width;
   height = (float) logical_monitor->rect.height / manager->screen_height;
 
   viewport[0] = width;
@@ -2852,8 +2892,8 @@ calculate_viewport_matrix (MetaMonitorManager *manager,
 
 static inline void
 multiply_matrix (float a[6],
-                float b[6],
-                float res[6])
+                 float b[6],
+                 float res[6])
 {
   res[0] = a[0] * b[0] + a[1] * b[3];
   res[1] = a[0] * b[1] + a[1] * b[4];
@@ -2928,7 +2968,8 @@ meta_monitor_manager_rotate_monitor (MetaMonitorManager *manager)
 {
   GError *error = NULL;
   MetaMonitorsConfig *config =
-    meta_monitor_config_manager_create_for_rotate_monitor (manager->config_manager);
+    meta_monitor_config_manager_create_for_rotate_monitor (
+      manager->config_manager);
 
   if (!config)
     return;
@@ -2946,8 +2987,8 @@ meta_monitor_manager_rotate_monitor (MetaMonitorManager *manager)
 }
 
 void
-meta_monitor_manager_switch_config (MetaMonitorManager          *manager,
-                                    MetaMonitorSwitchConfigType  config_type)
+meta_monitor_manager_switch_config (MetaMonitorManager         *manager,
+                                    MetaMonitorSwitchConfigType config_type)
 {
   GError *error = NULL;
   MetaMonitorsConfig *config;
@@ -2955,8 +2996,9 @@ meta_monitor_manager_switch_config (MetaMonitorManager          *manager,
   g_return_if_fail (config_type != META_MONITOR_SWITCH_CONFIG_UNKNOWN);
 
   config =
-    meta_monitor_config_manager_create_for_switch_config (manager->config_manager,
-                                                          config_type);
+    meta_monitor_config_manager_create_for_switch_config (
+      manager->config_manager,
+      config_type);
   if (!config)
     return;
 
diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c
index 60f36741a..c02edb13c 100644
--- a/src/backends/meta-monitor.c
+++ b/src/backends/meta-monitor.c
@@ -123,7 +123,8 @@ gboolean
 meta_monitor_spec_equals (MetaMonitorSpec *monitor_spec,
                           MetaMonitorSpec *other_monitor_spec)
 {
-  return (g_str_equal (monitor_spec->connector, other_monitor_spec->connector) &&
+  return (g_str_equal (monitor_spec->connector,
+                       other_monitor_spec->connector) &&
           g_str_equal (monitor_spec->vendor, other_monitor_spec->vendor) &&
           g_str_equal (monitor_spec->product, other_monitor_spec->product) &&
           g_str_equal (monitor_spec->serial, other_monitor_spec->serial));
@@ -353,8 +354,8 @@ meta_monitor_get_connector_type (MetaMonitor *monitor)
 }
 
 MetaMonitorTransform
-meta_monitor_logical_to_crtc_transform (MetaMonitor          *monitor,
-                                        MetaMonitorTransform  transform)
+meta_monitor_logical_to_crtc_transform (MetaMonitor         *monitor,
+                                        MetaMonitorTransform transform)
 {
   MetaOutput *output = meta_monitor_get_main_output (monitor);
   MetaMonitorTransform new_transform;
@@ -368,8 +369,8 @@ meta_monitor_logical_to_crtc_transform (MetaMonitor          *monitor,
 }
 
 MetaMonitorTransform
-meta_monitor_crtc_to_logical_transform (MetaMonitor          *monitor,
-                                        MetaMonitorTransform  transform)
+meta_monitor_crtc_to_logical_transform (MetaMonitor         *monitor,
+                                        MetaMonitorTransform transform)
 {
   MetaOutput *output = meta_monitor_get_main_output (monitor);
   MetaMonitorTransform new_transform;
@@ -483,10 +484,10 @@ meta_monitor_create_spec (MetaMonitor  *monitor,
     }
 
   return (MetaMonitorModeSpec) {
-    .width = width,
-    .height = height,
-    .refresh_rate = crtc_mode->refresh_rate,
-    .flags = crtc_mode->flags & HANDLED_CRTC_MODE_FLAGS
+           .width = width,
+           .height = height,
+           .refresh_rate = crtc_mode->refresh_rate,
+           .flags = crtc_mode->flags & HANDLED_CRTC_MODE_FLAGS
   };
 }
 
@@ -638,7 +639,8 @@ meta_monitor_normal_class_init (MetaMonitorNormalClass *klass)
   monitor_class->get_main_output = meta_monitor_normal_get_main_output;
   monitor_class->derive_layout = meta_monitor_normal_derive_layout;
   monitor_class->calculate_crtc_pos = meta_monitor_normal_calculate_crtc_pos;
-  monitor_class->get_suggested_position = meta_monitor_normal_get_suggested_position;
+  monitor_class->get_suggested_position =
+    meta_monitor_normal_get_suggested_position;
 }
 
 uint32_t
@@ -702,37 +704,45 @@ calculate_tile_coordinate (MetaMonitor         *monitor,
         {
         case META_MONITOR_TRANSFORM_NORMAL:
         case META_MONITOR_TRANSFORM_FLIPPED:
-          if (other_output->tile_info.loc_v_tile == output->tile_info.loc_v_tile &&
+          if (other_output->tile_info.loc_v_tile ==
+              output->tile_info.loc_v_tile &&
               other_output->tile_info.loc_h_tile < output->tile_info.loc_h_tile)
             x += other_output->tile_info.tile_w;
-          if (other_output->tile_info.loc_h_tile == output->tile_info.loc_h_tile &&
+          if (other_output->tile_info.loc_h_tile ==
+              output->tile_info.loc_h_tile &&
               other_output->tile_info.loc_v_tile < output->tile_info.loc_v_tile)
             y += other_output->tile_info.tile_h;
           break;
         case META_MONITOR_TRANSFORM_180:
         case META_MONITOR_TRANSFORM_FLIPPED_180:
-          if (other_output->tile_info.loc_v_tile == output->tile_info.loc_v_tile &&
+          if (other_output->tile_info.loc_v_tile ==
+              output->tile_info.loc_v_tile &&
               other_output->tile_info.loc_h_tile > output->tile_info.loc_h_tile)
             x += other_output->tile_info.tile_w;
-          if (other_output->tile_info.loc_h_tile == output->tile_info.loc_h_tile &&
+          if (other_output->tile_info.loc_h_tile ==
+              output->tile_info.loc_h_tile &&
               other_output->tile_info.loc_v_tile > output->tile_info.loc_v_tile)
             y += other_output->tile_info.tile_h;
           break;
         case META_MONITOR_TRANSFORM_270:
         case META_MONITOR_TRANSFORM_FLIPPED_270:
-          if (other_output->tile_info.loc_v_tile == output->tile_info.loc_v_tile &&
+          if (other_output->tile_info.loc_v_tile ==
+              output->tile_info.loc_v_tile &&
               other_output->tile_info.loc_h_tile < output->tile_info.loc_h_tile)
             y += other_output->tile_info.tile_w;
-          if (other_output->tile_info.loc_h_tile == output->tile_info.loc_h_tile &&
+          if (other_output->tile_info.loc_h_tile ==
+              output->tile_info.loc_h_tile &&
               other_output->tile_info.loc_v_tile < output->tile_info.loc_v_tile)
             x += other_output->tile_info.tile_h;
           break;
         case META_MONITOR_TRANSFORM_90:
         case META_MONITOR_TRANSFORM_FLIPPED_90:
-          if (other_output->tile_info.loc_v_tile == output->tile_info.loc_v_tile &&
+          if (other_output->tile_info.loc_v_tile ==
+              output->tile_info.loc_v_tile &&
               other_output->tile_info.loc_h_tile > output->tile_info.loc_h_tile)
             y += other_output->tile_info.tile_w;
-          if (other_output->tile_info.loc_h_tile == output->tile_info.loc_h_tile &&
+          if (other_output->tile_info.loc_h_tile ==
+              output->tile_info.loc_h_tile &&
               other_output->tile_info.loc_v_tile > output->tile_info.loc_v_tile)
             x += other_output->tile_info.tile_h;
           break;
@@ -1318,7 +1328,8 @@ meta_monitor_tiled_class_init (MetaMonitorTiledClass *klass)
   monitor_class->get_main_output = meta_monitor_tiled_get_main_output;
   monitor_class->derive_layout = meta_monitor_tiled_derive_layout;
   monitor_class->calculate_crtc_pos = meta_monitor_tiled_calculate_crtc_pos;
-  monitor_class->get_suggested_position = meta_monitor_tiled_get_suggested_position;
+  monitor_class->get_suggested_position =
+    meta_monitor_tiled_get_suggested_position;
 }
 
 static void
@@ -1368,7 +1379,8 @@ meta_monitor_mode_spec_equals (MetaMonitorModeSpec *monitor_mode_spec,
   return (monitor_mode_spec->width == other_monitor_mode_spec->width &&
           monitor_mode_spec->height == other_monitor_mode_spec->height &&
           ABS (monitor_mode_spec->refresh_rate -
-               other_monitor_mode_spec->refresh_rate) < MAXIMUM_REFRESH_RATE_DIFF &&
+               other_monitor_mode_spec->refresh_rate) <
+          MAXIMUM_REFRESH_RATE_DIFF &&
           monitor_mode_spec->flags == other_monitor_mode_spec->flags);
 }
 
@@ -1485,7 +1497,8 @@ meta_monitor_calculate_crtc_pos (MetaMonitor         *monitor,
  */
 #define HIDPI_MIN_HEIGHT 1200
 
-/* From http://en.wikipedia.org/wiki/4K_resolution#Resolutions_of_common_formats */
+/* From http://en.wikipedia.org/wiki/4K_resolution#Resolutions_of_common_formats
+ * */
 #define SMALLEST_4K_WIDTH 3656
 
 static float
@@ -1612,7 +1625,6 @@ get_closest_scale_factor_for_resolution (float width,
 
   do
     {
-
       for (j = 0; j < 2; j++)
         {
           float current_scale;
diff --git a/src/backends/meta-orientation-manager.c b/src/backends/meta-orientation-manager.c
index 4f57248eb..e01e20478 100644
--- a/src/backends/meta-orientation-manager.c
+++ b/src/backends/meta-orientation-manager.c
@@ -88,10 +88,13 @@ read_iio_proxy (MetaOrientationManager *self)
 
   if (has_accel)
     {
-      v = g_dbus_proxy_get_cached_property (self->iio_proxy, "AccelerometerOrientation");
+      v = g_dbus_proxy_get_cached_property (self->iio_proxy,
+                                            "AccelerometerOrientation");
       if (v)
         {
-          self->curr_orientation = orientation_from_string (g_variant_get_string (v, NULL));
+          self->curr_orientation = orientation_from_string (g_variant_get_string (
+                                                              v,
+                                                              NULL));
           g_variant_unref (v);
         }
     }
diff --git a/src/backends/meta-output.c b/src/backends/meta-output.c
index 2139a17a3..6dfbaf29f 100644
--- a/src/backends/meta-output.c
+++ b/src/backends/meta-output.c
@@ -30,7 +30,7 @@ typedef struct _MetaOutputPrivate
 G_DEFINE_TYPE_WITH_PRIVATE (MetaOutput, meta_output, G_TYPE_OBJECT)
 
 MetaGpu *
-meta_output_get_gpu (MetaOutput *output)
+meta_output_get_gpu (MetaOutput * output)
 {
   return output->gpu;
 }
diff --git a/src/backends/meta-pointer-constraint.c b/src/backends/meta-pointer-constraint.c
index 40ee3d32f..bd312bdce 100644
--- a/src/backends/meta-pointer-constraint.c
+++ b/src/backends/meta-pointer-constraint.c
@@ -46,8 +46,8 @@ meta_pointer_constraint_constrain (MetaPointerConstraint *constraint,
                                    guint32                time,
                                    float                  prev_x,
                                    float                  prev_y,
-                                   float                  *x,
-                                   float                  *y)
+                                   float                 *x,
+                                   float                 *y)
 {
   META_POINTER_CONSTRAINT_GET_CLASS (constraint)->constrain (constraint,
                                                              device,
diff --git a/src/backends/meta-remote-access-controller.c b/src/backends/meta-remote-access-controller.c
index 0e0ebe2bd..823da1a4b 100644
--- a/src/backends/meta-remote-access-controller.c
+++ b/src/backends/meta-remote-access-controller.c
@@ -87,8 +87,9 @@ meta_remote_access_handle_notify_stopped (MetaRemoteAccessHandle *handle)
 }
 
 void
-meta_remote_access_controller_notify_new_handle (MetaRemoteAccessController *controller,
-                                                 MetaRemoteAccessHandle     *handle)
+meta_remote_access_controller_notify_new_handle (
+  MetaRemoteAccessController *controller,
+  MetaRemoteAccessHandle     *handle)
 {
   g_signal_emit (controller, controller_signals[CONTROLLER_NEW_HANDLE], 0,
                  handle);
diff --git a/src/backends/meta-remote-desktop-session.c b/src/backends/meta-remote-desktop-session.c
index 50c6f9a88..4f22d13d0 100644
--- a/src/backends/meta-remote-desktop-session.c
+++ b/src/backends/meta-remote-desktop-session.c
@@ -38,7 +38,8 @@
 
 #include "meta-dbus-remote-desktop.h"
 
-#define META_REMOTE_DESKTOP_SESSION_DBUS_PATH "/org/gnome/Mutter/RemoteDesktop/Session"
+#define META_REMOTE_DESKTOP_SESSION_DBUS_PATH \
+  "/org/gnome/Mutter/RemoteDesktop/Session"
 
 enum _MetaRemoteDesktopNotifyAxisFlags
 {
@@ -65,7 +66,8 @@ struct _MetaRemoteDesktopSession
 };
 
 static void
-meta_remote_desktop_session_init_iface (MetaDBusRemoteDesktopSessionIface *iface);
+meta_remote_desktop_session_init_iface (
+  MetaDBusRemoteDesktopSessionIface *iface);
 
 static void
 meta_dbus_session_init_iface (MetaDbusSessionInterface *iface);
@@ -73,8 +75,9 @@ meta_dbus_session_init_iface (MetaDbusSessionInterface *iface);
 G_DEFINE_TYPE_WITH_CODE (MetaRemoteDesktopSession,
                          meta_remote_desktop_session,
                          META_DBUS_TYPE_REMOTE_DESKTOP_SESSION_SKELETON,
-                         G_IMPLEMENT_INTERFACE (META_DBUS_TYPE_REMOTE_DESKTOP_SESSION,
-                                                meta_remote_desktop_session_init_iface)
+                         G_IMPLEMENT_INTERFACE (
+                           META_DBUS_TYPE_REMOTE_DESKTOP_SESSION,
+                           meta_remote_desktop_session_init_iface)
                          G_IMPLEMENT_INTERFACE (META_TYPE_DBUS_SESSION,
                                                 meta_dbus_session_init_iface))
 
@@ -90,7 +93,7 @@ G_DEFINE_TYPE (MetaRemoteDesktopSessionHandle,
                META_TYPE_REMOTE_ACCESS_HANDLE)
 
 static MetaRemoteDesktopSessionHandle *
-meta_remote_desktop_session_handle_new (MetaRemoteDesktopSession *session);
+meta_remote_desktop_session_handle_new (MetaRemoteDesktopSession * session);
 
 static gboolean
 meta_remote_desktop_session_is_running (MetaRemoteDesktopSession *session)
@@ -107,7 +110,8 @@ init_remote_access_handle (MetaRemoteDesktopSession *session)
 
   session->handle = meta_remote_desktop_session_handle_new (session);
 
-  remote_access_controller = meta_backend_get_remote_access_controller (backend);
+  remote_access_controller =
+    meta_backend_get_remote_access_controller (backend);
   remote_access_handle = META_REMOTE_ACCESS_HANDLE (session->handle);
   meta_remote_access_controller_notify_new_handle (remote_access_controller,
                                                    remote_access_handle);
@@ -197,9 +201,10 @@ on_screen_cast_session_closed (MetaScreenCastSession    *screen_cast_session,
 }
 
 gboolean
-meta_remote_desktop_session_register_screen_cast (MetaRemoteDesktopSession  *session,
-                                                  MetaScreenCastSession     *screen_cast_session,
-                                                  GError                   **error)
+meta_remote_desktop_session_register_screen_cast (
+  MetaRemoteDesktopSession *session,
+  MetaScreenCastSession    *screen_cast_session,
+  GError                  **error)
 {
   if (session->screen_cast_session)
     {
@@ -219,9 +224,9 @@ meta_remote_desktop_session_register_screen_cast (MetaRemoteDesktopSession  *ses
 }
 
 MetaRemoteDesktopSession *
-meta_remote_desktop_session_new (MetaRemoteDesktop  *remote_desktop,
-                                 const char         *peer_name,
-                                 GError            **error)
+meta_remote_desktop_session_new (MetaRemoteDesktop *remote_desktop,
+                                 const char        *peer_name,
+                                 GError           **error)
 {
   GDBusInterfaceSkeleton *interface_skeleton;
   MetaRemoteDesktopSession *session;
@@ -452,11 +457,12 @@ handle_notify_pointer_axis (MetaDBusRemoteDesktopSession *skeleton,
                        CLUTTER_SCROLL_FINISHED_VERTICAL);
     }
 
-  clutter_virtual_input_device_notify_scroll_continuous (session->virtual_pointer,
-                                                         CLUTTER_CURRENT_TIME,
-                                                         dx, dy,
-                                                         CLUTTER_SCROLL_SOURCE_FINGER,
-                                                         finish_flags);
+  clutter_virtual_input_device_notify_scroll_continuous (
+    session->virtual_pointer,
+    CLUTTER_CURRENT_TIME,
+    dx, dy,
+    CLUTTER_SCROLL_SOURCE_FINGER,
+    finish_flags);
 
   meta_dbus_remote_desktop_session_complete_notify_pointer_axis (skeleton,
                                                                  invocation);
@@ -522,13 +528,15 @@ handle_notify_pointer_axis_discrete (MetaDBusRemoteDesktopSession *skeleton,
   direction = discrete_steps_to_scroll_direction (axis, steps);
 
   for (step_count = 0; step_count < abs (steps); step_count++)
-    clutter_virtual_input_device_notify_discrete_scroll (session->virtual_pointer,
-                                                         CLUTTER_CURRENT_TIME,
-                                                         direction,
-                                                         CLUTTER_SCROLL_SOURCE_WHEEL);
+    clutter_virtual_input_device_notify_discrete_scroll (
+      session->virtual_pointer,
+      CLUTTER_CURRENT_TIME,
+      direction,
+      CLUTTER_SCROLL_SOURCE_WHEEL);
 
-  meta_dbus_remote_desktop_session_complete_notify_pointer_axis_discrete (skeleton,
-                                                                          invocation);
+  meta_dbus_remote_desktop_session_complete_notify_pointer_axis_discrete (
+    skeleton,
+    invocation);
 
   return TRUE;
 }
@@ -553,8 +561,9 @@ handle_notify_pointer_motion_relative (MetaDBusRemoteDesktopSession *skeleton,
                                                        CLUTTER_CURRENT_TIME,
                                                        dx, dy);
 
-  meta_dbus_remote_desktop_session_complete_notify_pointer_motion_relative (skeleton,
-                                                                            invocation);
+  meta_dbus_remote_desktop_session_complete_notify_pointer_motion_relative (
+    skeleton,
+    invocation);
 
   return TRUE;
 }
@@ -602,8 +611,9 @@ handle_notify_pointer_motion_absolute (MetaDBusRemoteDesktopSession *skeleton,
                                                        CLUTTER_CURRENT_TIME,
                                                        abs_x, abs_y);
 
-  meta_dbus_remote_desktop_session_complete_notify_pointer_motion_absolute (skeleton,
-                                                                            invocation);
+  meta_dbus_remote_desktop_session_complete_notify_pointer_motion_absolute (
+    skeleton,
+    invocation);
 
   return TRUE;
 }
@@ -699,10 +709,11 @@ handle_notify_touch_motion (MetaDBusRemoteDesktopSession *skeleton,
 
   meta_screen_cast_stream_transform_position (stream, x, y, &abs_x, &abs_y);
 
-  clutter_virtual_input_device_notify_touch_motion (session->virtual_touchscreen,
-                                                    CLUTTER_CURRENT_TIME,
-                                                    slot,
-                                                    abs_x, abs_y);
+  clutter_virtual_input_device_notify_touch_motion (
+    session->virtual_touchscreen,
+    CLUTTER_CURRENT_TIME,
+    slot,
+    abs_x, abs_y);
 
   meta_dbus_remote_desktop_session_complete_notify_touch_motion (skeleton,
                                                                  invocation);
@@ -712,8 +723,8 @@ handle_notify_touch_motion (MetaDBusRemoteDesktopSession *skeleton,
 
 static gboolean
 handle_notify_touch_up (MetaDBusRemoteDesktopSession *skeleton,
-                          GDBusMethodInvocation        *invocation,
-                          unsigned int                  slot)
+                        GDBusMethodInvocation        *invocation,
+                        unsigned int                  slot)
 {
   MetaRemoteDesktopSession *session = META_REMOTE_DESKTOP_SESSION (skeleton);
 
@@ -726,8 +737,8 @@ handle_notify_touch_up (MetaDBusRemoteDesktopSession *skeleton,
     }
 
   clutter_virtual_input_device_notify_touch_up (session->virtual_touchscreen,
-                                                       CLUTTER_CURRENT_TIME,
-                                                       slot);
+                                                CLUTTER_CURRENT_TIME,
+                                                slot);
 
   meta_dbus_remote_desktop_session_complete_notify_touch_up (skeleton,
                                                              invocation);
@@ -744,9 +755,12 @@ meta_remote_desktop_session_init_iface (MetaDBusRemoteDesktopSessionIface *iface
   iface->handle_notify_keyboard_keysym = handle_notify_keyboard_keysym;
   iface->handle_notify_pointer_button = handle_notify_pointer_button;
   iface->handle_notify_pointer_axis = handle_notify_pointer_axis;
-  iface->handle_notify_pointer_axis_discrete = handle_notify_pointer_axis_discrete;
-  iface->handle_notify_pointer_motion_relative = handle_notify_pointer_motion_relative;
-  iface->handle_notify_pointer_motion_absolute = handle_notify_pointer_motion_absolute;
+  iface->handle_notify_pointer_axis_discrete =
+    handle_notify_pointer_axis_discrete;
+  iface->handle_notify_pointer_motion_relative =
+    handle_notify_pointer_motion_relative;
+  iface->handle_notify_pointer_motion_absolute =
+    handle_notify_pointer_motion_absolute;
   iface->handle_notify_touch_down = handle_notify_touch_down;
   iface->handle_notify_touch_motion = handle_notify_touch_motion;
   iface->handle_notify_touch_up = handle_notify_touch_up;
@@ -783,7 +797,7 @@ static void
 meta_remote_desktop_session_init (MetaRemoteDesktopSession *session)
 {
   MetaDBusRemoteDesktopSession *skeleton =
-    META_DBUS_REMOTE_DESKTOP_SESSION  (session);
+    META_DBUS_REMOTE_DESKTOP_SESSION (session);
   GRand *rand;
   static unsigned int global_session_number = 0;
 
@@ -791,7 +805,8 @@ meta_remote_desktop_session_init (MetaRemoteDesktopSession *session)
   session->session_id = meta_generate_random_id (rand, 32);
   g_rand_free (rand);
 
-  meta_dbus_remote_desktop_session_set_session_id (skeleton, session->session_id);
+  meta_dbus_remote_desktop_session_set_session_id (skeleton,
+                                                   session->session_id);
 
   session->object_path =
     g_strdup_printf (META_REMOTE_DESKTOP_SESSION_DBUS_PATH "/u%u",
@@ -801,7 +816,6 @@ meta_remote_desktop_session_init (MetaRemoteDesktopSession *session)
 static void
 meta_remote_desktop_session_class_init (MetaRemoteDesktopSessionClass *klass)
 {
-
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
   object_class->finalize = meta_remote_desktop_session_finalize;
@@ -836,7 +850,8 @@ meta_remote_desktop_session_handle_init (MetaRemoteDesktopSessionHandle *handle)
 }
 
 static void
-meta_remote_desktop_session_handle_class_init (MetaRemoteDesktopSessionHandleClass *klass)
+meta_remote_desktop_session_handle_class_init (
+  MetaRemoteDesktopSessionHandleClass *klass)
 {
   MetaRemoteAccessHandleClass *remote_access_handle_class =
     META_REMOTE_ACCESS_HANDLE_CLASS (klass);
diff --git a/src/backends/meta-renderer-view.c b/src/backends/meta-renderer-view.c
index 19ab9efc8..4f3fef89c 100644
--- a/src/backends/meta-renderer-view.c
+++ b/src/backends/meta-renderer-view.c
@@ -46,7 +46,7 @@ G_DEFINE_TYPE (MetaRendererView, meta_renderer_view,
                CLUTTER_TYPE_STAGE_VIEW_COGL)
 
 MetaLogicalMonitor *
-meta_renderer_view_get_logical_monitor (MetaRendererView *view)
+meta_renderer_view_get_logical_monitor (MetaRendererView * view)
 {
   return view->logical_monitor;
 }
@@ -113,14 +113,15 @@ meta_renderer_view_setup_offscreen_blit_pipeline (ClutterStageView *view,
 }
 
 static void
-meta_renderer_view_set_transform (MetaRendererView     *view,
-                                  MetaMonitorTransform  transform)
+meta_renderer_view_set_transform (MetaRendererView    *view,
+                                  MetaMonitorTransform transform)
 {
   if (view->transform == transform)
     return;
 
   view->transform = transform;
-  clutter_stage_view_invalidate_offscreen_blit_pipeline (CLUTTER_STAGE_VIEW (view));
+  clutter_stage_view_invalidate_offscreen_blit_pipeline (CLUTTER_STAGE_VIEW (
+                                                           view));
 }
 
 static void
diff --git a/src/backends/meta-renderer.c b/src/backends/meta-renderer.c
index 191897e64..c1b033ad4 100644
--- a/src/backends/meta-renderer.c
+++ b/src/backends/meta-renderer.c
@@ -38,7 +38,7 @@ typedef struct _MetaRendererPrivate
 G_DEFINE_TYPE_WITH_PRIVATE (MetaRenderer, meta_renderer, G_TYPE_OBJECT)
 
 CoglRenderer *
-meta_renderer_create_cogl_renderer (MetaRenderer *renderer)
+meta_renderer_create_cogl_renderer (MetaRenderer * renderer)
 {
   return META_RENDERER_GET_CLASS (renderer)->create_cogl_renderer (renderer);
 }
diff --git a/src/backends/meta-screen-cast-monitor-stream-src.c 
b/src/backends/meta-screen-cast-monitor-stream-src.c
index 1118daadd..8957f005a 100644
--- a/src/backends/meta-screen-cast-monitor-stream-src.c
+++ b/src/backends/meta-screen-cast-monitor-stream-src.c
@@ -43,7 +43,7 @@ G_DEFINE_TYPE (MetaScreenCastMonitorStreamSrc,
                META_TYPE_SCREEN_CAST_STREAM_SRC)
 
 static ClutterStage *
-get_stage (MetaScreenCastMonitorStreamSrc *monitor_src)
+get_stage (MetaScreenCastMonitorStreamSrc * monitor_src)
 {
   MetaScreenCastStreamSrc *src;
   MetaScreenCastStream *stream;
@@ -146,8 +146,9 @@ meta_screen_cast_monitor_stream_src_record_frame (MetaScreenCastStreamSrc *src,
 }
 
 MetaScreenCastMonitorStreamSrc *
-meta_screen_cast_monitor_stream_src_new (MetaScreenCastMonitorStream  *monitor_stream,
-                                         GError                      **error)
+meta_screen_cast_monitor_stream_src_new (
+  MetaScreenCastMonitorStream *monitor_stream,
+  GError                     **error)
 {
   return g_initable_new (META_TYPE_SCREEN_CAST_MONITOR_STREAM_SRC, NULL, error,
                          "stream", monitor_stream,
@@ -155,12 +156,14 @@ meta_screen_cast_monitor_stream_src_new (MetaScreenCastMonitorStream  *monitor_s
 }
 
 static void
-meta_screen_cast_monitor_stream_src_init (MetaScreenCastMonitorStreamSrc *monitor_src)
+meta_screen_cast_monitor_stream_src_init (
+  MetaScreenCastMonitorStreamSrc *monitor_src)
 {
 }
 
 static void
-meta_screen_cast_monitor_stream_src_class_init (MetaScreenCastMonitorStreamSrcClass *klass)
+meta_screen_cast_monitor_stream_src_class_init (
+  MetaScreenCastMonitorStreamSrcClass *klass)
 {
   MetaScreenCastStreamSrcClass *src_class =
     META_SCREEN_CAST_STREAM_SRC_CLASS (klass);
diff --git a/src/backends/meta-screen-cast-monitor-stream.c b/src/backends/meta-screen-cast-monitor-stream.c
index df43f977c..3fa86ddbf 100644
--- a/src/backends/meta-screen-cast-monitor-stream.c
+++ b/src/backends/meta-screen-cast-monitor-stream.c
@@ -93,23 +93,25 @@ on_monitors_changed (MetaMonitorManager          *monitor_manager,
 }
 
 ClutterStage *
-meta_screen_cast_monitor_stream_get_stage (MetaScreenCastMonitorStream *monitor_stream)
+meta_screen_cast_monitor_stream_get_stage (
+  MetaScreenCastMonitorStream *monitor_stream)
 {
   return monitor_stream->stage;
 }
 
 MetaMonitor *
-meta_screen_cast_monitor_stream_get_monitor (MetaScreenCastMonitorStream *monitor_stream)
+meta_screen_cast_monitor_stream_get_monitor (
+  MetaScreenCastMonitorStream *monitor_stream)
 {
   return monitor_stream->monitor;
 }
 
 MetaScreenCastMonitorStream *
-meta_screen_cast_monitor_stream_new (GDBusConnection     *connection,
-                                     MetaMonitorManager  *monitor_manager,
-                                     MetaMonitor         *monitor,
-                                     ClutterStage        *stage,
-                                     GError             **error)
+meta_screen_cast_monitor_stream_new (GDBusConnection    *connection,
+                                     MetaMonitorManager *monitor_manager,
+                                     MetaMonitor        *monitor,
+                                     ClutterStage       *stage,
+                                     GError            **error)
 {
   MetaScreenCastMonitorStream *monitor_stream;
 
@@ -138,8 +140,8 @@ meta_screen_cast_monitor_stream_new (GDBusConnection     *connection,
 }
 
 static MetaScreenCastStreamSrc *
-meta_screen_cast_monitor_stream_create_src (MetaScreenCastStream  *stream,
-                                            GError               **error)
+meta_screen_cast_monitor_stream_create_src (MetaScreenCastStream *stream,
+                                            GError              **error)
 {
   MetaScreenCastMonitorStream *monitor_stream =
     META_SCREEN_CAST_MONITOR_STREAM (stream);
@@ -177,11 +179,12 @@ meta_screen_cast_monitor_stream_set_parameters (MetaScreenCastStream *stream,
 }
 
 static void
-meta_screen_cast_monitor_stream_transform_position (MetaScreenCastStream *stream,
-                                                    double                stream_x,
-                                                    double                stream_y,
-                                                    double               *x,
-                                                    double               *y)
+meta_screen_cast_monitor_stream_transform_position (
+  MetaScreenCastStream *stream,
+  double                stream_x,
+  double                stream_y,
+  double               *x,
+  double               *y)
 {
   MetaScreenCastMonitorStream *monitor_stream =
     META_SCREEN_CAST_MONITOR_STREAM (stream);
@@ -208,7 +211,8 @@ meta_screen_cast_monitor_stream_set_property (GObject      *object,
     {
     case PROP_MONITOR:
       g_set_object (&monitor_stream->monitor, g_value_get_object (value));
-      logical_monitor = meta_monitor_get_logical_monitor (monitor_stream->monitor);
+      logical_monitor = meta_monitor_get_logical_monitor (
+        monitor_stream->monitor);
       g_set_object (&monitor_stream->logical_monitor, logical_monitor);
       break;
     default:
@@ -244,16 +248,19 @@ meta_screen_cast_monitor_stream_finalize (GObject *object)
   g_clear_object (&monitor_stream->monitor);
   g_clear_object (&monitor_stream->logical_monitor);
 
-  G_OBJECT_CLASS (meta_screen_cast_monitor_stream_parent_class)->finalize (object);
+  G_OBJECT_CLASS (meta_screen_cast_monitor_stream_parent_class)->finalize (
+    object);
 }
 
 static void
-meta_screen_cast_monitor_stream_init (MetaScreenCastMonitorStream *monitor_stream)
+meta_screen_cast_monitor_stream_init (
+  MetaScreenCastMonitorStream *monitor_stream)
 {
 }
 
 static void
-meta_screen_cast_monitor_stream_class_init (MetaScreenCastMonitorStreamClass *klass)
+meta_screen_cast_monitor_stream_class_init (
+  MetaScreenCastMonitorStreamClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
   MetaScreenCastStreamClass *stream_class =
@@ -265,7 +272,8 @@ meta_screen_cast_monitor_stream_class_init (MetaScreenCastMonitorStreamClass *kl
 
   stream_class->create_src = meta_screen_cast_monitor_stream_create_src;
   stream_class->set_parameters = meta_screen_cast_monitor_stream_set_parameters;
-  stream_class->transform_position = meta_screen_cast_monitor_stream_transform_position;
+  stream_class->transform_position =
+    meta_screen_cast_monitor_stream_transform_position;
 
   g_object_class_install_property (object_class,
                                    PROP_MONITOR,
diff --git a/src/backends/meta-screen-cast-session.c b/src/backends/meta-screen-cast-session.c
index e1b6393e8..89ea4e18a 100644
--- a/src/backends/meta-screen-cast-session.c
+++ b/src/backends/meta-screen-cast-session.c
@@ -30,7 +30,8 @@
 #include "backends/meta-screen-cast-stream.h"
 #include "backends/meta-remote-access-controller-private.h"
 
-#define META_SCREEN_CAST_SESSION_DBUS_PATH "/org/gnome/Mutter/ScreenCast/Session"
+#define META_SCREEN_CAST_SESSION_DBUS_PATH \
+  "/org/gnome/Mutter/ScreenCast/Session"
 
 struct _MetaScreenCastSession
 {
@@ -55,8 +56,9 @@ meta_dbus_session_init_iface (MetaDbusSessionInterface *iface);
 G_DEFINE_TYPE_WITH_CODE (MetaScreenCastSession,
                          meta_screen_cast_session,
                          META_DBUS_TYPE_SCREEN_CAST_SESSION_SKELETON,
-                         G_IMPLEMENT_INTERFACE (META_DBUS_TYPE_SCREEN_CAST_SESSION,
-                                                meta_screen_cast_session_init_iface)
+                         G_IMPLEMENT_INTERFACE (
+                           META_DBUS_TYPE_SCREEN_CAST_SESSION,
+                           meta_screen_cast_session_init_iface)
                          G_IMPLEMENT_INTERFACE (META_TYPE_DBUS_SESSION,
                                                 meta_dbus_session_init_iface))
 
@@ -72,7 +74,7 @@ G_DEFINE_TYPE (MetaScreenCastSessionHandle,
                META_TYPE_REMOTE_ACCESS_HANDLE)
 
 static MetaScreenCastSessionHandle *
-meta_screen_cast_session_handle_new (MetaScreenCastSession *session);
+meta_screen_cast_session_handle_new (MetaScreenCastSession * session);
 
 static void
 init_remote_access_handle (MetaScreenCastSession *session)
@@ -83,15 +85,16 @@ init_remote_access_handle (MetaScreenCastSession *session)
 
   session->handle = meta_screen_cast_session_handle_new (session);
 
-  remote_access_controller = meta_backend_get_remote_access_controller (backend);
+  remote_access_controller =
+    meta_backend_get_remote_access_controller (backend);
   remote_access_handle = META_REMOTE_ACCESS_HANDLE (session->handle);
   meta_remote_access_controller_notify_new_handle (remote_access_controller,
                                                    remote_access_handle);
 }
 
 gboolean
-meta_screen_cast_session_start (MetaScreenCastSession  *session,
-                                GError                **error)
+meta_screen_cast_session_start (MetaScreenCastSession *session,
+                                GError               **error)
 {
   GList *l;
 
@@ -370,10 +373,10 @@ meta_dbus_session_init_iface (MetaDbusSessionInterface *iface)
 }
 
 MetaScreenCastSession *
-meta_screen_cast_session_new (MetaScreenCast             *screen_cast,
-                              MetaScreenCastSessionType   session_type,
-                              const char                 *peer_name,
-                              GError                    **error)
+meta_screen_cast_session_new (MetaScreenCast           *screen_cast,
+                              MetaScreenCastSessionType session_type,
+                              const char               *peer_name,
+                              GError                  **error)
 {
   GDBusInterfaceSkeleton *interface_skeleton;
   MetaScreenCastSession *session;
@@ -452,7 +455,8 @@ meta_screen_cast_session_handle_init (MetaScreenCastSessionHandle *handle)
 }
 
 static void
-meta_screen_cast_session_handle_class_init (MetaScreenCastSessionHandleClass *klass)
+meta_screen_cast_session_handle_class_init (
+  MetaScreenCastSessionHandleClass *klass)
 {
   MetaRemoteAccessHandleClass *remote_access_handle_class =
     META_REMOTE_ACCESS_HANDLE_CLASS (klass);
diff --git a/src/backends/meta-screen-cast-stream-src.c b/src/backends/meta-screen-cast-stream-src.c
index 2d7a68e2a..506d5d115 100644
--- a/src/backends/meta-screen-cast-stream-src.c
+++ b/src/backends/meta-screen-cast-stream-src.c
@@ -38,7 +38,8 @@
 #include "meta/boxes.h"
 
 #define PRIVATE_OWNER_FROM_FIELD(TypeName, field_ptr, field_name) \
-  (TypeName *)((guint8 *)(field_ptr) - G_PRIVATE_OFFSET (TypeName, field_name))
+  (TypeName *) ((guint8 *) (field_ptr) - \
+                G_PRIVATE_OFFSET (TypeName, field_name))
 
 enum
 {
@@ -163,7 +164,8 @@ meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src)
     }
   else if (spa_buffer->datas[0].type == priv->pipewire_type->data.MemFd)
     {
-      map = mmap (NULL, spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset,
+      map = mmap (NULL,
+                  spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset,
                   PROT_READ | PROT_WRITE, MAP_SHARED,
                   spa_buffer->datas[0].fd, 0);
       if (map == MAP_FAILED)
@@ -230,10 +232,10 @@ meta_screen_cast_stream_src_notify_closed (MetaScreenCastStreamSrc *src)
 }
 
 static void
-on_stream_state_changed (void                 *data,
-                         enum pw_stream_state  old,
-                         enum pw_stream_state  state,
-                         const char           *error_message)
+on_stream_state_changed (void                *data,
+                         enum pw_stream_state old,
+                         enum pw_stream_state state,
+                         const char          *error_message)
 {
   MetaScreenCastStreamSrc *src = data;
   MetaScreenCastStreamSrcPrivate *priv =
@@ -307,15 +309,16 @@ on_stream_format_changed (void                 *data,
                            params, G_N_ELEMENTS (params));
 }
 
-static const struct pw_stream_events stream_events = {
+static const struct pw_stream_events stream_events =
+{
   PW_VERSION_STREAM_EVENTS,
   .state_changed = on_stream_state_changed,
   .format_changed = on_stream_format_changed,
 };
 
 static struct pw_stream *
-create_pipewire_stream (MetaScreenCastStreamSrc  *src,
-                        GError                  **error)
+create_pipewire_stream (MetaScreenCastStreamSrc *src,
+                        GError                 **error)
 {
   MetaScreenCastStreamSrcPrivate *priv =
     meta_screen_cast_stream_src_get_instance_private (src);
@@ -360,8 +363,8 @@ create_pipewire_stream (MetaScreenCastStreamSrc  *src,
     ":", spa_type->format_video.size, "R", &SPA_RECTANGLE (width, height),
     ":", spa_type->format_video.framerate, "F", &SPA_FRACTION (0, 1),
     ":", spa_type->format_video.max_framerate, "Fru", &max_framerate,
-                                                      PROP_RANGE (&min_framerate,
-                                                                  &max_framerate));
+    PROP_RANGE (&min_framerate,
+                &max_framerate));
 
   pw_stream_add_listener (pipewire_stream,
                           &priv->pipewire_stream_listener,
@@ -385,10 +388,10 @@ create_pipewire_stream (MetaScreenCastStreamSrc  *src,
 }
 
 static void
-on_state_changed (void                 *data,
-                  enum pw_remote_state  old,
-                  enum pw_remote_state  state,
-                  const char           *error_message)
+on_state_changed (void                *data,
+                  enum pw_remote_state old,
+                  enum pw_remote_state state,
+                  const char          *error_message)
 {
   MetaScreenCastStreamSrc *src = data;
   MetaScreenCastStreamSrcPrivate *priv =
@@ -430,9 +433,9 @@ pipewire_loop_source_prepare (GSource *base,
 }
 
 static gboolean
-pipewire_loop_source_dispatch (GSource     *source,
-                               GSourceFunc  callback,
-                               gpointer     user_data)
+pipewire_loop_source_dispatch (GSource    *source,
+                               GSourceFunc callback,
+                               gpointer    user_data)
 {
   MetaPipeWireSource *pipewire_source = (MetaPipeWireSource *) source;
   int result;
@@ -496,15 +499,16 @@ create_pipewire_source (void)
   return pipewire_source;
 }
 
-static const struct pw_remote_events remote_events = {
+static const struct pw_remote_events remote_events =
+{
   PW_VERSION_REMOTE_EVENTS,
   .state_changed = on_state_changed,
 };
 
 static gboolean
-meta_screen_cast_stream_src_initable_init (GInitable     *initable,
-                                           GCancellable  *cancellable,
-                                           GError       **error)
+meta_screen_cast_stream_src_initable_init (GInitable    *initable,
+                                           GCancellable *cancellable,
+                                           GError      **error)
 {
   MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (initable);
   MetaScreenCastStreamSrcPrivate *priv =
@@ -600,7 +604,7 @@ meta_screen_cast_stream_src_set_property (GObject      *object,
     {
     case PROP_STREAM:
       priv->stream = g_value_get_object (value);
-      break;;
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
     }
diff --git a/src/backends/meta-screen-cast-stream.c b/src/backends/meta-screen-cast-stream.c
index 97ee4bfcf..496fcc3c1 100644
--- a/src/backends/meta-screen-cast-stream.c
+++ b/src/backends/meta-screen-cast-stream.c
@@ -61,8 +61,8 @@ G_DEFINE_TYPE_WITH_CODE (MetaScreenCastStream,
                          G_ADD_PRIVATE (MetaScreenCastStream))
 
 static MetaScreenCastStreamSrc *
-meta_screen_cast_stream_create_src (MetaScreenCastStream  *stream,
-                                    GError               **error)
+meta_screen_cast_stream_create_src (MetaScreenCastStream * stream,
+                                    GError * *error)
 {
   return META_SCREEN_CAST_STREAM_GET_CLASS (stream)->create_src (stream,
                                                                  error);
@@ -98,8 +98,8 @@ on_stream_src_ready (MetaScreenCastStreamSrc *src,
 }
 
 gboolean
-meta_screen_cast_stream_start (MetaScreenCastStream  *stream,
-                               GError               **error)
+meta_screen_cast_stream_start (MetaScreenCastStream *stream,
+                               GError              **error)
 {
   MetaScreenCastStreamPrivate *priv =
     meta_screen_cast_stream_get_instance_private (stream);
@@ -206,9 +206,9 @@ meta_screen_cast_stream_finalize (GObject *object)
 }
 
 static gboolean
-meta_screen_cast_stream_initable_init (GInitable     *initable,
-                                       GCancellable  *cancellable,
-                                       GError       **error)
+meta_screen_cast_stream_initable_init (GInitable    *initable,
+                                       GCancellable *cancellable,
+                                       GError      **error)
 {
   MetaScreenCastStream *stream = META_SCREEN_CAST_STREAM (initable);
   MetaDBusScreenCastStream *skeleton = META_DBUS_SCREEN_CAST_STREAM (stream);
diff --git a/src/backends/meta-screen-cast.c b/src/backends/meta-screen-cast.c
index bebef5b4e..411638e8b 100644
--- a/src/backends/meta-screen-cast.c
+++ b/src/backends/meta-screen-cast.c
@@ -54,7 +54,7 @@ G_DEFINE_TYPE_WITH_CODE (MetaScreenCast, meta_screen_cast,
                                                 meta_screen_cast_init_iface))
 
 GDBusConnection *
-meta_screen_cast_get_connection (MetaScreenCast *screen_cast)
+meta_screen_cast_get_connection (MetaScreenCast * screen_cast)
 {
   GDBusInterfaceSkeleton *interface_skeleton =
     G_DBUS_INTERFACE_SKELETON (screen_cast);
@@ -63,9 +63,9 @@ meta_screen_cast_get_connection (MetaScreenCast *screen_cast)
 }
 
 static gboolean
-register_remote_desktop_screen_cast_session (MetaScreenCastSession  *session,
-                                             const char             *remote_desktop_session_id,
-                                             GError                **error)
+register_remote_desktop_screen_cast_session (MetaScreenCastSession *session,
+                                             const char            *remote_desktop_session_id,
+                                             GError               **error)
 {
   MetaBackend *backend = meta_get_backend ();
   MetaRemoteDesktop *remote_desktop = meta_backend_get_remote_desktop (backend);
diff --git a/src/backends/meta-settings.c b/src/backends/meta-settings.c
index 34d49b3ed..696b91f01 100644
--- a/src/backends/meta-settings.c
+++ b/src/backends/meta-settings.c
@@ -381,7 +381,6 @@ wayland_settings_changed (GSettings    *wayland_settings,
                           gchar        *key,
                           MetaSettings *settings)
 {
-
   if (g_str_equal (key, "xwayland-allow-grabs"))
     {
       update_xwayland_allow_grabs (settings);
@@ -393,16 +392,16 @@ wayland_settings_changed (GSettings    *wayland_settings,
 }
 
 void
-meta_settings_get_xwayland_grab_patterns (MetaSettings  *settings,
-                                          GPtrArray    **whitelist_patterns,
-                                          GPtrArray    **blacklist_patterns)
+meta_settings_get_xwayland_grab_patterns (MetaSettings *settings,
+                                          GPtrArray   **whitelist_patterns,
+                                          GPtrArray   **blacklist_patterns)
 {
   *whitelist_patterns = settings->xwayland_grab_whitelist_patterns;
   *blacklist_patterns = settings->xwayland_grab_blacklist_patterns;
 }
 
 gboolean
- meta_settings_are_xwayland_grabs_allowed (MetaSettings *settings)
+meta_settings_are_xwayland_grabs_allowed (MetaSettings *settings)
 {
   return (settings->xwayland_allow_grabs);
 }
diff --git a/src/backends/meta-stage.c b/src/backends/meta-stage.c
index 9b1dadab7..058df5fee 100644
--- a/src/backends/meta-stage.c
+++ b/src/backends/meta-stage.c
@@ -30,7 +30,8 @@
 #include "meta/meta-monitor-manager.h"
 #include "meta/util.h"
 
-struct _MetaOverlay {
+struct _MetaOverlay
+{
   gboolean enabled;
 
   CoglPipeline *pipeline;
@@ -55,7 +56,8 @@ static MetaOverlay *
 meta_overlay_new (void)
 {
   MetaOverlay *overlay;
-  CoglContext *ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
+  CoglContext *ctx = clutter_backend_get_cogl_context (
+    clutter_get_default_backend ());
 
   overlay = g_slice_new0 (MetaOverlay);
   overlay->pipeline = cogl_pipeline_new (ctx);
diff --git a/src/backends/native/dbus-utils.c b/src/backends/native/dbus-utils.c
index 79fafe881..eb0845bcf 100644
--- a/src/backends/native/dbus-utils.c
+++ b/src/backends/native/dbus-utils.c
@@ -82,7 +82,7 @@ escape_dbus_component (const gchar *name)
               g_string_append_len (op, first_ok, ptr - first_ok);
             }
           /* escape the unsafe character */
-          g_string_append_printf (op, "_%02x", (unsigned char)(*ptr));
+          g_string_append_printf (op, "_%02x", (unsigned char) (*ptr));
           /* restart after it */
           first_ok = ptr + 1;
         }
diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c
index b8ea93da9..77652574e 100644
--- a/src/backends/native/meta-backend-native.c
+++ b/src/backends/native/meta-backend-native.c
@@ -64,7 +64,8 @@ static GInitableIface *initable_parent_iface;
 static void
 initable_iface_init (GInitableIface *initable_iface);
 
-G_DEFINE_TYPE_WITH_CODE (MetaBackendNative, meta_backend_native, META_TYPE_BACKEND,
+G_DEFINE_TYPE_WITH_CODE (MetaBackendNative, meta_backend_native,
+                         META_TYPE_BACKEND,
                          G_ADD_PRIVATE (MetaBackendNative)
                          G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
                                                 initable_iface_init))
@@ -73,7 +74,8 @@ static void
 meta_backend_native_finalize (GObject *object)
 {
   MetaBackendNative *native = META_BACKEND_NATIVE (object);
-  MetaBackendNativePrivate *priv = meta_backend_native_get_instance_private (native);
+  MetaBackendNativePrivate *priv = meta_backend_native_get_instance_private (
+    native);
 
   meta_launcher_free (priv->launcher);
 
@@ -216,24 +218,40 @@ relative_motion_across_outputs (MetaMonitorManager *monitor_manager,
       MetaVector2 intersection;
 
       motion = (MetaLine2) {
-          .a = { x, y },
-            .b = { x + (dx * cur->scale), y + (dy * cur->scale) }
+        .a = { x, y },
+        .b = { x + (dx * cur->scale), y + (dy * cur->scale) }
       };
       left = (MetaLine2) {
-            { cur->rect.x, cur->rect.y },
-              { cur->rect.x, cur->rect.y + cur->rect.height }
+        {
+          cur->rect.x, cur->rect.y
+        },
+        {
+          cur->rect.x, cur->rect.y + cur->rect.height
+        }
       };
       right = (MetaLine2) {
-            { cur->rect.x + cur->rect.width, cur->rect.y },
-              { cur->rect.x + cur->rect.width, cur->rect.y + cur->rect.height }
+        {
+          cur->rect.x + cur->rect.width, cur->rect.y
+        },
+        {
+          cur->rect.x + cur->rect.width, cur->rect.y + cur->rect.height
+        }
       };
       top = (MetaLine2) {
-            { cur->rect.x, cur->rect.y },
-              { cur->rect.x + cur->rect.width, cur->rect.y }
+        {
+          cur->rect.x, cur->rect.y
+        },
+        {
+          cur->rect.x + cur->rect.width, cur->rect.y
+        }
       };
       bottom = (MetaLine2) {
-            { cur->rect.x, cur->rect.y + cur->rect.height },
-              { cur->rect.x + cur->rect.width, cur->rect.y + cur->rect.height }
+        {
+          cur->rect.x, cur->rect.y + cur->rect.height
+        },
+        {
+          cur->rect.x + cur->rect.width, cur->rect.y + cur->rect.height
+        }
       };
 
       if (direction != META_DISPLAY_RIGHT &&
@@ -284,17 +302,20 @@ relative_motion_filter (ClutterInputDevice *device,
   if (meta_is_stage_views_scaled ())
     return;
 
-  logical_monitor = meta_monitor_manager_get_logical_monitor_at (monitor_manager,
-                                                                 x, y);
+  logical_monitor = meta_monitor_manager_get_logical_monitor_at (
+    monitor_manager,
+    x, y);
   if (!logical_monitor)
     return;
 
   new_dx = (*dx) * logical_monitor->scale;
   new_dy = (*dy) * logical_monitor->scale;
 
-  dest_logical_monitor = meta_monitor_manager_get_logical_monitor_at (monitor_manager,
-                                                                      x + new_dx,
-                                                                      y + new_dy);
+  dest_logical_monitor = meta_monitor_manager_get_logical_monitor_at (
+    monitor_manager,
+    x + new_dx,
+    y +
+    new_dy);
   if (dest_logical_monitor &&
       dest_logical_monitor != logical_monitor)
     {
@@ -324,10 +345,12 @@ meta_backend_native_post_init (MetaBackend *backend)
 
   META_BACKEND_CLASS (meta_backend_native_parent_class)->post_init (backend);
 
-  clutter_evdev_set_pointer_constrain_callback (manager, pointer_constrain_callback,
+  clutter_evdev_set_pointer_constrain_callback (manager,
+                                                pointer_constrain_callback,
                                                 NULL, NULL);
   clutter_evdev_set_relative_motion_filter (manager, relative_motion_filter,
-                                            meta_backend_get_monitor_manager (backend));
+                                            meta_backend_get_monitor_manager (
+                                              backend));
 }
 
 static MetaMonitorManager *
@@ -374,7 +397,8 @@ meta_backend_native_warp_pointer (MetaBackend *backend,
                                   int          y)
 {
   ClutterDeviceManager *manager = clutter_device_manager_get_default ();
-  ClutterInputDevice *device = clutter_device_manager_get_core_device (manager, CLUTTER_POINTER_DEVICE);
+  ClutterInputDevice *device = clutter_device_manager_get_core_device (manager,
+                                                                       CLUTTER_POINTER_DEVICE);
   MetaCursorTracker *cursor_tracker = meta_backend_get_cursor_tracker (backend);
 
   /* XXX */
@@ -417,7 +441,8 @@ meta_backend_native_set_keymap (MetaBackend *backend,
   names.options = options;
 
   context = xkb_context_new (XKB_CONTEXT_NO_FLAGS);
-  keymap = xkb_keymap_new_from_names (context, &names, XKB_KEYMAP_COMPILE_NO_FLAGS);
+  keymap = xkb_keymap_new_from_names (context, &names,
+                                      XKB_KEYMAP_COMPILE_NO_FLAGS);
   xkb_context_unref (context);
 
   clutter_evdev_set_keyboard_map (manager, keymap);
@@ -466,12 +491,12 @@ meta_backend_native_set_numlock (MetaBackend *backend,
 }
 
 static gboolean
-meta_backend_native_get_relative_motion_deltas (MetaBackend *backend,
-                                                const        ClutterEvent *event,
-                                                double       *dx,
-                                                double       *dy,
-                                                double       *dx_unaccel,
-                                                double       *dy_unaccel)
+meta_backend_native_get_relative_motion_deltas (MetaBackend        *backend,
+                                                const ClutterEvent *event,
+                                                double             *dx,
+                                                double             *dy,
+                                                double             *dx_unaccel,
+                                                double             *dy_unaccel)
 {
   return clutter_evdev_event_get_relative_motion (event,
                                                   dx, dy,
@@ -493,9 +518,9 @@ meta_backend_native_update_screen_size (MetaBackend *backend,
 }
 
 static gboolean
-meta_backend_native_initable_init (GInitable     *initable,
-                                   GCancellable  *cancellable,
-                                   GError       **error)
+meta_backend_native_initable_init (GInitable    *initable,
+                                   GCancellable *cancellable,
+                                   GError      **error)
 {
   if (!meta_is_stage_views_enabled ())
     {
@@ -523,24 +548,31 @@ meta_backend_native_class_init (MetaBackendNativeClass *klass)
 
   object_class->finalize = meta_backend_native_finalize;
 
-  backend_class->create_clutter_backend = meta_backend_native_create_clutter_backend;
+  backend_class->create_clutter_backend =
+    meta_backend_native_create_clutter_backend;
 
   backend_class->post_init = meta_backend_native_post_init;
 
-  backend_class->create_monitor_manager = meta_backend_native_create_monitor_manager;
-  backend_class->create_cursor_renderer = meta_backend_native_create_cursor_renderer;
+  backend_class->create_monitor_manager =
+    meta_backend_native_create_monitor_manager;
+  backend_class->create_cursor_renderer =
+    meta_backend_native_create_cursor_renderer;
   backend_class->create_renderer = meta_backend_native_create_renderer;
-  backend_class->create_input_settings = meta_backend_native_create_input_settings;
+  backend_class->create_input_settings =
+    meta_backend_native_create_input_settings;
 
   backend_class->warp_pointer = meta_backend_native_warp_pointer;
 
-  backend_class->get_current_logical_monitor = meta_backend_native_get_current_logical_monitor;
+  backend_class->get_current_logical_monitor =
+    meta_backend_native_get_current_logical_monitor;
 
   backend_class->set_keymap = meta_backend_native_set_keymap;
   backend_class->get_keymap = meta_backend_native_get_keymap;
-  backend_class->get_keymap_layout_group = meta_backend_native_get_keymap_layout_group;
+  backend_class->get_keymap_layout_group =
+    meta_backend_native_get_keymap_layout_group;
   backend_class->lock_layout_group = meta_backend_native_lock_layout_group;
-  backend_class->get_relative_motion_deltas = meta_backend_native_get_relative_motion_deltas;
+  backend_class->get_relative_motion_deltas =
+    meta_backend_native_get_relative_motion_deltas;
   backend_class->update_screen_size = meta_backend_native_update_screen_size;
   backend_class->set_numlock = meta_backend_native_set_numlock;
 }
@@ -548,7 +580,8 @@ meta_backend_native_class_init (MetaBackendNativeClass *klass)
 static void
 meta_backend_native_init (MetaBackendNative *native)
 {
-  MetaBackendNativePrivate *priv = meta_backend_native_get_instance_private (native);
+  MetaBackendNativePrivate *priv = meta_backend_native_get_instance_private (
+    native);
   GError *error = NULL;
 
   priv->launcher = meta_launcher_new (&error);
@@ -607,7 +640,8 @@ meta_activate_session (void)
     return TRUE;
 
   MetaBackendNative *native = META_BACKEND_NATIVE (backend);
-  MetaBackendNativePrivate *priv = meta_backend_native_get_instance_private (native);
+  MetaBackendNativePrivate *priv = meta_backend_native_get_instance_private (
+    native);
 
   if (!meta_launcher_activate_session (priv->launcher, &error))
     {
diff --git a/src/backends/native/meta-barrier-native.c b/src/backends/native/meta-barrier-native.c
index d335cbc17..2ead67b4e 100644
--- a/src/backends/native/meta-barrier-native.c
+++ b/src/backends/native/meta-barrier-native.c
@@ -46,7 +46,8 @@ struct _MetaBarrierManagerNative
   GHashTable *barriers;
 };
 
-typedef enum {
+typedef enum
+{
   /* The barrier is active and responsive to pointer motion. */
   META_BARRIER_STATE_ACTIVE,
 
@@ -67,14 +68,14 @@ typedef enum {
 
 struct _MetaBarrierImplNativePrivate
 {
-  MetaBarrier              *barrier;
+  MetaBarrier *barrier;
   MetaBarrierManagerNative *manager;
 
-  gboolean                  is_active;
-  MetaBarrierState          state;
-  int                       trigger_serial;
-  guint32                   last_event_time;
-  MetaBarrierDirection      blocked_dir;
+  gboolean is_active;
+  MetaBarrierState state;
+  int trigger_serial;
+  guint32 last_event_time;
+  MetaBarrierDirection blocked_dir;
 };
 
 G_DEFINE_TYPE_WITH_PRIVATE (MetaBarrierImplNative, meta_barrier_impl_native,
@@ -213,12 +214,15 @@ maybe_release_barriers (MetaBarrierManagerNative *manager,
                         float                     x,
                         float                     y)
 {
-  MetaLine2 motion = {
-    .a = {
+  MetaLine2 motion =
+  {
+    .a =
+    {
       .x = prev_x,
       .y = prev_y,
     },
-    .b = {
+    .b =
+    {
       .x = x,
       .y = y,
     },
@@ -233,14 +237,14 @@ typedef struct _MetaClosestBarrierData
 {
   struct
   {
-    MetaLine2                   motion;
-    MetaBarrierDirection        directions;
+    MetaLine2 motion;
+    MetaBarrierDirection directions;
   } in;
 
   struct
   {
-    float                       closest_distance_2;
-    MetaBarrierImplNative      *barrier_impl;
+    float closest_distance_2;
+    MetaBarrierImplNative *barrier_impl;
   } out;
 } MetaClosestBarrierData;
 
@@ -282,7 +286,7 @@ update_closest_barrier (gpointer key,
    * barrier. */
   dx = intersection.x - data->in.motion.a.x;
   dy = intersection.y - data->in.motion.a.y;
-  distance_2 = dx*dx + dy*dy;
+  distance_2 = dx * dx + dy * dy;
   if (data->out.barrier_impl == NULL ||
       distance_2 < data->out.closest_distance_2)
     {
@@ -303,13 +307,17 @@ get_closest_barrier (MetaBarrierManagerNative *manager,
   MetaClosestBarrierData closest_barrier_data;
 
   closest_barrier_data = (MetaClosestBarrierData) {
-    .in = {
-      .motion = {
-        .a = {
+    .in =
+    {
+      .motion =
+      {
+        .a =
+        {
           .x = prev_x,
           .y = prev_y,
         },
-        .b = {
+        .b =
+        {
           .x = x,
           .y = y,
         },
@@ -335,13 +343,13 @@ get_closest_barrier (MetaBarrierManagerNative *manager,
 
 typedef struct _MetaBarrierEventData
 {
-  guint32             time;
-  float               prev_x;
-  float               prev_y;
-  float               x;
-  float               y;
-  float               dx;
-  float               dy;
+  guint32 time;
+  float prev_x;
+  float prev_y;
+  float x;
+  float y;
+  float dx;
+  float dy;
 } MetaBarrierEventData;
 
 static void
@@ -372,7 +380,7 @@ emit_barrier_event (MetaBarrierImplNative *self,
     case META_BARRIER_STATE_LEFT:
       priv->state = META_BARRIER_STATE_ACTIVE;
 
-      /* Intentional fall-through. */
+    /* Intentional fall-through. */
     case META_BARRIER_STATE_HELD:
       event->dt = time - priv->last_event_time;
 
@@ -411,7 +419,8 @@ maybe_emit_barrier_event (gpointer key, gpointer value, gpointer user_data)
     meta_barrier_impl_native_get_instance_private (self);
   MetaBarrierEventData *data = user_data;
 
-  switch (priv->state) {
+  switch (priv->state)
+    {
     case META_BARRIER_STATE_ACTIVE:
       break;
     case META_BARRIER_STATE_HIT:
@@ -433,9 +442,9 @@ maybe_emit_barrier_event (gpointer key, gpointer value, gpointer user_data)
 /* Clamp (x, y) to the barrier and remove clamped direction from motion_dir. */
 static void
 clamp_to_barrier (MetaBarrierImplNative *self,
-                  MetaBarrierDirection *motion_dir,
-                  float *x,
-                  float *y)
+                  MetaBarrierDirection  *motion_dir,
+                  float                 *x,
+                  float                 *y)
 {
   MetaBarrierImplNativePrivate *priv =
     meta_barrier_impl_native_get_instance_private (self);
diff --git a/src/backends/native/meta-clutter-backend-native.c 
b/src/backends/native/meta-clutter-backend-native.c
index be86eb50e..bfd972200 100644
--- a/src/backends/native/meta-clutter-backend-native.c
+++ b/src/backends/native/meta-clutter-backend-native.c
@@ -46,7 +46,7 @@ G_DEFINE_TYPE (MetaClutterBackendNative, meta_clutter_backend_native,
                CLUTTER_TYPE_BACKEND_EGL_NATIVE)
 
 MetaStageNative *
-meta_clutter_backend_native_get_stage_native (ClutterBackend *backend)
+meta_clutter_backend_native_get_stage_native (ClutterBackend * backend)
 {
   MetaClutterBackendNative *clutter_backend_native =
     META_CLUTTER_BACKEND_NATIVE (backend);
@@ -55,8 +55,8 @@ meta_clutter_backend_native_get_stage_native (ClutterBackend *backend)
 }
 
 static CoglRenderer *
-meta_clutter_backend_native_get_renderer (ClutterBackend  *clutter_backend,
-                                          GError         **error)
+meta_clutter_backend_native_get_renderer (ClutterBackend *clutter_backend,
+                                          GError        **error)
 {
   MetaBackend *backend = meta_get_backend ();
   MetaRenderer *renderer = meta_backend_get_renderer (backend);
@@ -65,9 +65,9 @@ meta_clutter_backend_native_get_renderer (ClutterBackend  *clutter_backend,
 }
 
 static ClutterStageWindow *
-meta_clutter_backend_native_create_stage (ClutterBackend  *backend,
-                                          ClutterStage    *wrapper,
-                                          GError         **error)
+meta_clutter_backend_native_create_stage (ClutterBackend *backend,
+                                          ClutterStage   *wrapper,
+                                          GError        **error)
 {
   MetaClutterBackendNative *clutter_backend_native =
     META_CLUTTER_BACKEND_NATIVE (backend);
@@ -82,7 +82,7 @@ meta_clutter_backend_native_create_stage (ClutterBackend  *backend,
 }
 
 static void
-meta_clutter_backend_native_bell_notify (ClutterBackend  *backend)
+meta_clutter_backend_native_bell_notify (ClutterBackend *backend)
 {
   MetaDisplay *display = meta_get_display ();
 
@@ -90,7 +90,8 @@ meta_clutter_backend_native_bell_notify (ClutterBackend  *backend)
 }
 
 static void
-meta_clutter_backend_native_init (MetaClutterBackendNative *clutter_backend_nativen)
+meta_clutter_backend_native_init (
+  MetaClutterBackendNative *clutter_backend_nativen)
 {
 }
 
@@ -99,7 +100,9 @@ meta_clutter_backend_native_class_init (MetaClutterBackendNativeClass *klass)
 {
   ClutterBackendClass *clutter_backend_class = CLUTTER_BACKEND_CLASS (klass);
 
-  clutter_backend_class->get_renderer = meta_clutter_backend_native_get_renderer;
-  clutter_backend_class->create_stage = meta_clutter_backend_native_create_stage;
+  clutter_backend_class->get_renderer =
+    meta_clutter_backend_native_get_renderer;
+  clutter_backend_class->create_stage =
+    meta_clutter_backend_native_create_stage;
   clutter_backend_class->bell_notify = meta_clutter_backend_native_bell_notify;
 }
diff --git a/src/backends/native/meta-crtc-kms.c b/src/backends/native/meta-crtc-kms.c
index 523ea6ccc..2148e6e7d 100644
--- a/src/backends/native/meta-crtc-kms.c
+++ b/src/backends/native/meta-crtc-kms.c
@@ -48,8 +48,8 @@ typedef struct _MetaCrtcKms
 } MetaCrtcKms;
 
 gboolean
-meta_crtc_kms_is_transform_handled (MetaCrtc             *crtc,
-                                    MetaMonitorTransform  transform)
+meta_crtc_kms_is_transform_handled (MetaCrtc            *crtc,
+                                    MetaMonitorTransform transform)
 {
   MetaCrtcKms *crtc_kms = crtc->driver_private;
 
@@ -132,7 +132,6 @@ meta_crtc_kms_set_underscan (MetaCrtc *crtc,
                                     DRM_MODE_OBJECT_CRTC,
                                     crtc_kms->underscan_vborder_prop_id, value);
         }
-
     }
   else
     {
@@ -143,10 +142,10 @@ meta_crtc_kms_set_underscan (MetaCrtc *crtc,
 }
 
 static int
-find_property_index (MetaGpu                    *gpu,
-                     drmModeObjectPropertiesPtr  props,
-                     const char                 *prop_name,
-                     drmModePropertyPtr         *out_prop)
+find_property_index (MetaGpu                   *gpu,
+                     drmModeObjectPropertiesPtr props,
+                     const char                *prop_name,
+                     drmModePropertyPtr        *out_prop)
 {
   MetaGpuKms *gpu_kms = META_GPU_KMS (gpu);
   int kms_fd;
@@ -429,9 +428,9 @@ meta_crtc_destroy_notify (MetaCrtc *crtc)
 }
 
 MetaCrtc *
-meta_create_kms_crtc (MetaGpuKms   *gpu_kms,
-                      drmModeCrtc  *drm_crtc,
-                      unsigned int  crtc_index)
+meta_create_kms_crtc (MetaGpuKms  *gpu_kms,
+                      drmModeCrtc *drm_crtc,
+                      unsigned int crtc_index)
 {
   MetaGpu *gpu = META_GPU (gpu_kms);
   MetaCrtc *crtc;
@@ -448,7 +447,7 @@ meta_create_kms_crtc (MetaGpuKms   *gpu_kms,
   crtc->is_dirty = FALSE;
   crtc->transform = META_MONITOR_TRANSFORM_NORMAL;
   crtc->all_transforms = meta_is_stage_views_enabled () ?
-    ALL_TRANSFORMS_MASK : META_MONITOR_TRANSFORM_NORMAL;
+                         ALL_TRANSFORMS_MASK : META_MONITOR_TRANSFORM_NORMAL;
 
   if (drm_crtc->mode_valid)
     {
diff --git a/src/backends/native/meta-cursor-renderer-native.c 
b/src/backends/native/meta-cursor-renderer-native.c
index cb39bbed3..4790571d7 100644
--- a/src/backends/native/meta-cursor-renderer-native.c
+++ b/src/backends/native/meta-cursor-renderer-native.c
@@ -116,7 +116,9 @@ typedef struct _MetaCursorNativePrivate
 
 static GQuark quark_cursor_renderer_native_gpu_data = 0;
 
-G_DEFINE_TYPE_WITH_PRIVATE (MetaCursorRendererNative, meta_cursor_renderer_native, 
META_TYPE_CURSOR_RENDERER);
+G_DEFINE_TYPE_WITH_PRIVATE (MetaCursorRendererNative,
+                            meta_cursor_renderer_native,
+                            META_TYPE_CURSOR_RENDERER);
 
 static void
 realize_cursor_sprite (MetaCursorRenderer *renderer,
@@ -172,7 +174,8 @@ meta_cursor_renderer_native_finalize (GObject *object)
 }
 
 static guint
-get_pending_cursor_sprite_gbm_bo_index (MetaCursorNativeGpuState *cursor_gpu_state)
+get_pending_cursor_sprite_gbm_bo_index (
+  MetaCursorNativeGpuState *cursor_gpu_state)
 {
   return (cursor_gpu_state->active_bo + 1) % HW_CURSOR_BUFFER_COUNT;
 }
@@ -333,11 +336,13 @@ update_monitor_crtc_cursor (MetaMonitor         *monitor,
     }
 
   scaled_crtc_rect = (ClutterRect) {
-    .origin = {
+    .origin =
+    {
       .x = crtc_x / scale,
       .y = crtc_y / scale
     },
-    .size = {
+    .size =
+    {
       .width = crtc_width / scale,
       .height = crtc_height / scale
     },
@@ -395,7 +400,9 @@ update_hw_cursor (MetaCursorRendererNative *native,
   if (cursor_sprite)
     rect = meta_cursor_renderer_calculate_rect (renderer, cursor_sprite);
   else
-    rect = (ClutterRect) { 0 };
+    rect = (ClutterRect) {
+      0
+    };
 
   logical_monitors =
     meta_monitor_manager_get_logical_monitors (monitor_manager);
@@ -410,7 +417,8 @@ update_hw_cursor (MetaCursorRendererNative *native,
         .in_cursor_renderer_native = native,
         .in_logical_monitor = logical_monitor,
         .in_local_cursor_rect = (ClutterRect) {
-          .origin = {
+          .origin =
+          {
             .x = rect.origin.x - logical_monitor->rect.x,
             .y = rect.origin.y - logical_monitor->rect.y
           },
@@ -512,7 +520,8 @@ cursor_over_transformed_logical_monitor (MetaCursorRenderer *renderer,
 
           transform = meta_logical_monitor_get_transform (logical_monitor);
           /* Get transform corrected for LCD panel-orientation. */
-          transform = meta_monitor_logical_to_crtc_transform (monitor, transform);
+          transform =
+            meta_monitor_logical_to_crtc_transform (monitor, transform);
           if (transform != META_MONITOR_TRANSFORM_NORMAL)
             return TRUE;
         }
@@ -544,7 +553,7 @@ can_draw_cursor_unscaled (MetaCursorRenderer *renderer,
   gboolean has_visible_crtc_sprite = FALSE;
 
   if (!meta_is_stage_views_scaled ())
-   return meta_cursor_sprite_get_texture_scale (cursor_sprite) == 1.0;
+    return meta_cursor_sprite_get_texture_scale (cursor_sprite) == 1.0;
 
   logical_monitors =
     meta_monitor_manager_get_logical_monitors (monitor_manager);
@@ -856,7 +865,7 @@ load_cursor_sprite_gbm_buffer_for_gpu (MetaCursorRendererNative *native,
   if (width > cursor_width || height > cursor_height)
     {
       meta_warning ("Invalid theme cursor size (must be at most %ux%u)\n",
-                    (unsigned int)cursor_width, (unsigned int)cursor_height);
+                    (unsigned int) cursor_width, (unsigned int) cursor_height);
       return;
     }
 
@@ -876,7 +885,7 @@ load_cursor_sprite_gbm_buffer_for_gpu (MetaCursorRendererNative *native,
           return;
         }
 
-      memset (buf, 0, sizeof(buf));
+      memset (buf, 0, sizeof (buf));
       for (i = 0; i < height; i++)
         memcpy (buf + i * 4 * cursor_width, pixels + i * rowstride, width * 4);
       if (gbm_bo_write (bo, buf, cursor_width * cursor_height * 4) != 0)
@@ -1015,7 +1024,8 @@ realize_cursor_sprite_from_wl_buffer_for_gpu (MetaCursorRenderer      *renderer,
 
       if (width != cursor_width || height != cursor_height)
         {
-          meta_warning ("Invalid cursor size (must be 64x64), falling back to software (GL) cursors\n");
+          meta_warning (
+            "Invalid cursor size (must be 64x64), falling back to software (GL) cursors\n");
           return;
         }
 
diff --git a/src/backends/native/meta-gpu-kms.c b/src/backends/native/meta-gpu-kms.c
index 57582f699..b4e05f12f 100644
--- a/src/backends/native/meta-gpu-kms.c
+++ b/src/backends/native/meta-gpu-kms.c
@@ -85,9 +85,9 @@ kms_event_check (GSource *source)
 }
 
 static gboolean
-kms_event_dispatch (GSource     *source,
-                    GSourceFunc  callback,
-                    gpointer     user_data)
+kms_event_dispatch (GSource    *source,
+                    GSourceFunc callback,
+                    gpointer    user_data)
 {
   MetaKmsSource *kms_source = (MetaKmsSource *) source;
 
@@ -96,17 +96,18 @@ kms_event_dispatch (GSource     *source,
   return G_SOURCE_CONTINUE;
 }
 
-static GSourceFuncs kms_event_funcs = {
+static GSourceFuncs kms_event_funcs =
+{
   NULL,
   kms_event_check,
   kms_event_dispatch
 };
 
 static void
-get_crtc_drm_connectors (MetaGpu       *gpu,
-                         MetaCrtc      *crtc,
-                         uint32_t     **connectors,
-                         unsigned int  *n_connectors)
+get_crtc_drm_connectors (MetaGpu      *gpu,
+                         MetaCrtc     *crtc,
+                         uint32_t    **connectors,
+                         unsigned int *n_connectors)
 {
   GArray *connectors_array = g_array_new (FALSE, FALSE, sizeof (uint32_t));
   GList *l;
@@ -169,7 +170,8 @@ static void
 invoke_flip_closure (GClosure   *flip_closure,
                      MetaGpuKms *gpu_kms)
 {
-  GValue params[] = {
+  GValue params[] =
+  {
     G_VALUE_INIT,
     G_VALUE_INIT
   };
@@ -232,7 +234,8 @@ meta_gpu_kms_wrap_flip_closure (MetaGpuKms *gpu_kms,
 }
 
 void
-meta_gpu_kms_flip_closure_container_free (MetaGpuKmsFlipClosureContainer *closure_container)
+meta_gpu_kms_flip_closure_container_free (
+  MetaGpuKmsFlipClosureContainer *closure_container)
 {
   g_free (closure_container);
 }
@@ -301,11 +304,11 @@ meta_gpu_kms_flip_crtc (MetaGpuKms *gpu_kms,
 }
 
 static void
-page_flip_handler (int           fd,
-                   unsigned int  frame,
-                   unsigned int  sec,
-                   unsigned int  usec,
-                   void         *user_data)
+page_flip_handler (int          fd,
+                   unsigned int frame,
+                   unsigned int sec,
+                   unsigned int usec,
+                   void        *user_data)
 {
   MetaGpuKmsFlipClosureContainer *closure_container = user_data;
   GClosure *flip_closure = closure_container->flip_closure;
@@ -601,7 +604,8 @@ init_modes (MetaGpuKms *gpu_kms,
   /*
    * Gather all modes on all connected connectors.
    */
-  modes_table = g_hash_table_new (drm_mode_hash, (GEqualFunc) meta_drm_mode_equal);
+  modes_table = g_hash_table_new (drm_mode_hash,
+                                  (GEqualFunc) meta_drm_mode_equal);
   for (i = 0; i < gpu_kms->n_connectors; i++)
     {
       drmModeConnector *drm_connector;
@@ -733,9 +737,9 @@ init_outputs (MetaGpuKms       *gpu_kms,
 }
 
 static gboolean
-meta_kms_resources_init (MetaKmsResources  *resources,
-                         int                fd,
-                         GError           **error)
+meta_kms_resources_init (MetaKmsResources *resources,
+                         int               fd,
+                         GError          **error)
 
 {
   drmModeRes *drm_resources;
@@ -775,8 +779,8 @@ meta_kms_resources_release (MetaKmsResources *resources)
 }
 
 static gboolean
-meta_gpu_kms_read_current (MetaGpu  *gpu,
-                           GError  **error)
+meta_gpu_kms_read_current (MetaGpu *gpu,
+                           GError **error)
 {
   MetaGpuKms *gpu_kms = META_GPU_KMS (gpu);
   MetaMonitorManager *monitor_manager =
@@ -788,8 +792,9 @@ meta_gpu_kms_read_current (MetaGpu  *gpu,
     {
       if (!gpu_kms->resources_init_failed_before)
         {
-          g_warning ("meta_kms_resources_init failed: %s, assuming we have no outputs",
-                     local_error->message);
+          g_warning (
+            "meta_kms_resources_init failed: %s, assuming we have no outputs",
+            local_error->message);
           gpu_kms->resources_init_failed_before = TRUE;
         }
       return TRUE;
@@ -801,9 +806,9 @@ meta_gpu_kms_read_current (MetaGpu  *gpu,
   monitor_manager->power_save_mode = META_POWER_SAVE_ON;
 
   /* Note: we must not free the public structures (output, crtc, monitor
-     mode and monitor info) here, they must be kept alive until the API
-     users are done with them after we emit monitors-changed, and thus
-     are freed by the platform-independent layer. */
+   *  mode and monitor info) here, they must be kept alive until the API
+   *  users are done with them after we emit monitors-changed, and thus
+   *  are freed by the platform-independent layer. */
   free_resources (gpu_kms);
 
   init_connectors (gpu_kms, resources.resources);
@@ -823,9 +828,9 @@ meta_gpu_kms_can_have_outputs (MetaGpuKms *gpu_kms)
 }
 
 MetaGpuKms *
-meta_gpu_kms_new (MetaMonitorManagerKms  *monitor_manager_kms,
-                  const char             *kms_file_path,
-                  GError                **error)
+meta_gpu_kms_new (MetaMonitorManagerKms *monitor_manager_kms,
+                  const char            *kms_file_path,
+                  GError               **error)
 {
   MetaMonitorManager *monitor_manager =
     META_MONITOR_MANAGER (monitor_manager_kms);
diff --git a/src/backends/native/meta-input-settings-native.c 
b/src/backends/native/meta-input-settings-native.c
index 0e00c0202..a0c515907 100644
--- a/src/backends/native/meta-input-settings-native.c
+++ b/src/backends/native/meta-input-settings-native.c
@@ -31,12 +31,13 @@
 #include "backends/native/meta-input-settings-native.h"
 #include "clutter/evdev/clutter-evdev.h"
 
-G_DEFINE_TYPE (MetaInputSettingsNative, meta_input_settings_native, META_TYPE_INPUT_SETTINGS)
+G_DEFINE_TYPE (MetaInputSettingsNative, meta_input_settings_native,
+               META_TYPE_INPUT_SETTINGS)
 
 static void
-meta_input_settings_native_set_send_events (MetaInputSettings        *settings,
-                                            ClutterInputDevice       *device,
-                                            GDesktopDeviceSendEvents  mode)
+meta_input_settings_native_set_send_events (MetaInputSettings       *settings,
+                                            ClutterInputDevice      *device,
+                                            GDesktopDeviceSendEvents mode)
 {
   enum libinput_config_send_events_mode libinput_mode;
   struct libinput_device *libinput_device;
@@ -122,9 +123,10 @@ meta_input_settings_native_set_tap_enabled (MetaInputSettings  *settings,
 }
 
 static void
-meta_input_settings_native_set_tap_and_drag_enabled (MetaInputSettings  *settings,
-                                                     ClutterInputDevice *device,
-                                                     gboolean            enabled)
+meta_input_settings_native_set_tap_and_drag_enabled (
+  MetaInputSettings  *settings,
+  ClutterInputDevice *device,
+  gboolean            enabled)
 {
   struct libinput_device *libinput_device;
 
@@ -140,9 +142,10 @@ meta_input_settings_native_set_tap_and_drag_enabled (MetaInputSettings  *setting
 }
 
 static void
-meta_input_settings_native_set_disable_while_typing (MetaInputSettings  *settings,
-                                                     ClutterInputDevice *device,
-                                                     gboolean            enabled)
+meta_input_settings_native_set_disable_while_typing (
+  MetaInputSettings  *settings,
+  ClutterInputDevice *device,
+  gboolean            enabled)
 {
   struct libinput_device *libinput_device;
 
@@ -175,8 +178,8 @@ meta_input_settings_native_set_invert_scroll (MetaInputSettings  *settings,
 }
 
 static gboolean
-device_set_scroll_method (struct libinput_device             *libinput_device,
-                          enum libinput_config_scroll_method  method)
+device_set_scroll_method (struct libinput_device            *libinput_device,
+                          enum libinput_config_scroll_method method)
 {
   enum libinput_config_status status =
     libinput_device_config_scroll_set_method (libinput_device, method);
@@ -184,8 +187,8 @@ device_set_scroll_method (struct libinput_device             *libinput_device,
 }
 
 static gboolean
-device_set_click_method (struct libinput_device            *libinput_device,
-                         enum libinput_config_click_method  method)
+device_set_click_method (struct libinput_device           *libinput_device,
+                         enum libinput_config_click_method method)
 {
   enum libinput_config_status status =
     libinput_device_config_click_set_method (libinput_device, method);
@@ -193,16 +196,18 @@ device_set_click_method (struct libinput_device            *libinput_device,
 }
 
 static void
-meta_input_settings_native_set_edge_scroll (MetaInputSettings            *settings,
-                                            ClutterInputDevice           *device,
-                                            gboolean                      edge_scrolling_enabled)
+meta_input_settings_native_set_edge_scroll (MetaInputSettings  *settings,
+                                            ClutterInputDevice *device,
+                                            gboolean            edge_scrolling_enabled)
 {
   struct libinput_device *libinput_device;
   enum libinput_config_scroll_method current, method;
 
   libinput_device = clutter_evdev_input_device_get_libinput_device (device);
 
-  method = edge_scrolling_enabled ? LIBINPUT_CONFIG_SCROLL_EDGE : LIBINPUT_CONFIG_SCROLL_NO_SCROLL;
+  method =
+    edge_scrolling_enabled ? LIBINPUT_CONFIG_SCROLL_EDGE :
+    LIBINPUT_CONFIG_SCROLL_NO_SCROLL;
   current = libinput_device_config_scroll_get_method (libinput_device);
   current &= ~LIBINPUT_CONFIG_SCROLL_EDGE;
 
@@ -210,16 +215,18 @@ meta_input_settings_native_set_edge_scroll (MetaInputSettings            *settin
 }
 
 static void
-meta_input_settings_native_set_two_finger_scroll (MetaInputSettings            *settings,
-                                                  ClutterInputDevice           *device,
-                                                  gboolean                      two_finger_scroll_enabled)
+meta_input_settings_native_set_two_finger_scroll (MetaInputSettings  *settings,
+                                                  ClutterInputDevice *device,
+                                                  gboolean            two_finger_scroll_enabled)
 {
   struct libinput_device *libinput_device;
   enum libinput_config_scroll_method current, method;
 
   libinput_device = clutter_evdev_input_device_get_libinput_device (device);
 
-  method = two_finger_scroll_enabled ? LIBINPUT_CONFIG_SCROLL_2FG : LIBINPUT_CONFIG_SCROLL_NO_SCROLL;
+  method =
+    two_finger_scroll_enabled ? LIBINPUT_CONFIG_SCROLL_2FG :
+    LIBINPUT_CONFIG_SCROLL_NO_SCROLL;
   current = libinput_device_config_scroll_get_method (libinput_device);
   current &= ~LIBINPUT_CONFIG_SCROLL_2FG;
 
@@ -236,7 +243,8 @@ meta_input_settings_native_has_two_finger_scroll (MetaInputSettings  *settings,
   if (!libinput_device)
     return FALSE;
 
-  return libinput_device_config_scroll_get_methods (libinput_device) & LIBINPUT_CONFIG_SCROLL_2FG;
+  return libinput_device_config_scroll_get_methods (libinput_device) &
+         LIBINPUT_CONFIG_SCROLL_2FG;
 }
 
 static void
@@ -275,9 +283,10 @@ meta_input_settings_native_set_scroll_button (MetaInputSettings  *settings,
 }
 
 static void
-meta_input_settings_native_set_click_method (MetaInputSettings           *settings,
-                                             ClutterInputDevice          *device,
-                                             GDesktopTouchpadClickMethod  mode)
+meta_input_settings_native_set_click_method (
+  MetaInputSettings          *settings,
+  ClutterInputDevice         *device,
+  GDesktopTouchpadClickMethod mode)
 {
   enum libinput_config_click_method click_method = 0;
   struct libinput_device *libinput_device;
@@ -289,7 +298,8 @@ meta_input_settings_native_set_click_method (MetaInputSettings           *settin
   switch (mode)
     {
     case G_DESKTOP_TOUCHPAD_CLICK_METHOD_DEFAULT:
-      click_method = libinput_device_config_click_get_default_method (libinput_device);
+      click_method = libinput_device_config_click_get_default_method (
+        libinput_device);
       break;
     case G_DESKTOP_TOUCHPAD_CLICK_METHOD_NONE:
       click_method = LIBINPUT_CONFIG_CLICK_METHOD_NONE;
@@ -303,7 +313,7 @@ meta_input_settings_native_set_click_method (MetaInputSettings           *settin
     default:
       g_assert_not_reached ();
       return;
-  }
+    }
 
   device_set_click_method (libinput_device, click_method);
 }
@@ -405,9 +415,10 @@ meta_input_settings_native_is_trackball_device (MetaInputSettings  *settings,
 }
 
 static void
-meta_input_settings_native_set_mouse_accel_profile (MetaInputSettings          *settings,
-                                                    ClutterInputDevice         *device,
-                                                    GDesktopPointerAccelProfile profile)
+meta_input_settings_native_set_mouse_accel_profile (
+  MetaInputSettings          *settings,
+  ClutterInputDevice         *device,
+  GDesktopPointerAccelProfile profile)
 {
   if (!is_mouse_device (device))
     return;
@@ -416,9 +427,10 @@ meta_input_settings_native_set_mouse_accel_profile (MetaInputSettings          *
 }
 
 static void
-meta_input_settings_native_set_trackball_accel_profile (MetaInputSettings          *settings,
-                                                        ClutterInputDevice         *device,
-                                                        GDesktopPointerAccelProfile profile)
+meta_input_settings_native_set_trackball_accel_profile (
+  MetaInputSettings          *settings,
+  ClutterInputDevice         *device,
+  GDesktopPointerAccelProfile profile)
 {
   if (!meta_input_settings_native_is_trackball_device (settings, device))
     return;
@@ -427,9 +439,9 @@ meta_input_settings_native_set_trackball_accel_profile (MetaInputSettings
 }
 
 static void
-meta_input_settings_native_set_tablet_mapping (MetaInputSettings     *settings,
-                                               ClutterInputDevice    *device,
-                                               GDesktopTabletMapping  mapping)
+meta_input_settings_native_set_tablet_mapping (MetaInputSettings    *settings,
+                                               ClutterInputDevice   *device,
+                                               GDesktopTabletMapping mapping)
 {
   ClutterInputDeviceMapping dev_mapping;
 
@@ -467,9 +479,9 @@ meta_input_settings_native_set_tablet_keep_aspect (MetaInputSettings  *settings,
 
           backend = meta_get_backend ();
           monitor_manager = meta_backend_get_monitor_manager (backend);
-         meta_monitor_manager_get_screen_size (monitor_manager,
-                                               &width,
-                                               &height);
+          meta_monitor_manager_get_screen_size (monitor_manager,
+                                                &width,
+                                                &height);
         }
 
       aspect_ratio = (double) width / height;
@@ -497,8 +509,11 @@ meta_input_settings_native_set_tablet_area (MetaInputSettings  *settings,
   offset_x = -padding_left * scale_x;
   offset_y = -padding_top * scale_y;
 
-  gfloat matrix[6] = { scale_x, 0., offset_x,
-                       0., scale_y, offset_y };
+  gfloat matrix[6] =
+  {
+    scale_x, 0., offset_x,
+    0., scale_y, offset_y
+  };
 
   libinput_device = clutter_evdev_input_device_get_libinput_device (device);
   if (!libinput_device ||
@@ -509,10 +524,11 @@ meta_input_settings_native_set_tablet_area (MetaInputSettings  *settings,
 }
 
 static void
-meta_input_settings_native_set_stylus_pressure (MetaInputSettings      *settings,
-                                                ClutterInputDevice     *device,
-                                                ClutterInputDeviceTool *tool,
-                                                const gint              curve[4])
+meta_input_settings_native_set_stylus_pressure (
+  MetaInputSettings      *settings,
+  ClutterInputDevice     *device,
+  ClutterInputDeviceTool *tool,
+  const gint              curve[4])
 {
   gdouble pressure_curve[4];
 
@@ -544,16 +560,18 @@ action_to_evcode (GDesktopStylusButtonAction action)
 }
 
 static void
-meta_input_settings_native_set_stylus_button_map (MetaInputSettings          *settings,
-                                                  ClutterInputDevice         *device,
-                                                  ClutterInputDeviceTool     *tool,
-                                                  GDesktopStylusButtonAction  primary,
-                                                  GDesktopStylusButtonAction  secondary,
-                                                  GDesktopStylusButtonAction  tertiary)
+meta_input_settings_native_set_stylus_button_map (
+  MetaInputSettings         *settings,
+  ClutterInputDevice        *device,
+  ClutterInputDeviceTool    *tool,
+  GDesktopStylusButtonAction primary,
+  GDesktopStylusButtonAction secondary,
+  GDesktopStylusButtonAction tertiary)
 {
   clutter_evdev_input_device_tool_set_button_code (tool, CLUTTER_BUTTON_MIDDLE,
                                                    action_to_evcode (primary));
-  clutter_evdev_input_device_tool_set_button_code (tool, CLUTTER_BUTTON_SECONDARY,
+  clutter_evdev_input_device_tool_set_button_code (tool,
+                                                   CLUTTER_BUTTON_SECONDARY,
                                                    action_to_evcode (secondary));
   clutter_evdev_input_device_tool_set_button_code (tool, 8, /* Back */
                                                    action_to_evcode (tertiary));
@@ -562,34 +580,55 @@ meta_input_settings_native_set_stylus_button_map (MetaInputSettings          *se
 static void
 meta_input_settings_native_class_init (MetaInputSettingsNativeClass *klass)
 {
-  MetaInputSettingsClass *input_settings_class = META_INPUT_SETTINGS_CLASS (klass);
+  MetaInputSettingsClass *input_settings_class = META_INPUT_SETTINGS_CLASS (
+    klass);
 
-  input_settings_class->set_send_events = meta_input_settings_native_set_send_events;
+  input_settings_class->set_send_events =
+    meta_input_settings_native_set_send_events;
   input_settings_class->set_matrix = meta_input_settings_native_set_matrix;
   input_settings_class->set_speed = meta_input_settings_native_set_speed;
-  input_settings_class->set_left_handed = meta_input_settings_native_set_left_handed;
-  input_settings_class->set_tap_enabled = meta_input_settings_native_set_tap_enabled;
-  input_settings_class->set_tap_and_drag_enabled = meta_input_settings_native_set_tap_and_drag_enabled;
-  input_settings_class->set_invert_scroll = meta_input_settings_native_set_invert_scroll;
-  input_settings_class->set_edge_scroll = meta_input_settings_native_set_edge_scroll;
-  input_settings_class->set_two_finger_scroll = meta_input_settings_native_set_two_finger_scroll;
-  input_settings_class->set_scroll_button = meta_input_settings_native_set_scroll_button;
-  input_settings_class->set_click_method = meta_input_settings_native_set_click_method;
-  input_settings_class->set_keyboard_repeat = meta_input_settings_native_set_keyboard_repeat;
-  input_settings_class->set_disable_while_typing = meta_input_settings_native_set_disable_while_typing;
-
-  input_settings_class->set_tablet_mapping = meta_input_settings_native_set_tablet_mapping;
-  input_settings_class->set_tablet_keep_aspect = meta_input_settings_native_set_tablet_keep_aspect;
-  input_settings_class->set_tablet_area = meta_input_settings_native_set_tablet_area;
-
-  input_settings_class->set_mouse_accel_profile = meta_input_settings_native_set_mouse_accel_profile;
-  input_settings_class->set_trackball_accel_profile = meta_input_settings_native_set_trackball_accel_profile;
-
-  input_settings_class->set_stylus_pressure = meta_input_settings_native_set_stylus_pressure;
-  input_settings_class->set_stylus_button_map = meta_input_settings_native_set_stylus_button_map;
-
-  input_settings_class->has_two_finger_scroll = meta_input_settings_native_has_two_finger_scroll;
-  input_settings_class->is_trackball_device = meta_input_settings_native_is_trackball_device;
+  input_settings_class->set_left_handed =
+    meta_input_settings_native_set_left_handed;
+  input_settings_class->set_tap_enabled =
+    meta_input_settings_native_set_tap_enabled;
+  input_settings_class->set_tap_and_drag_enabled =
+    meta_input_settings_native_set_tap_and_drag_enabled;
+  input_settings_class->set_invert_scroll =
+    meta_input_settings_native_set_invert_scroll;
+  input_settings_class->set_edge_scroll =
+    meta_input_settings_native_set_edge_scroll;
+  input_settings_class->set_two_finger_scroll =
+    meta_input_settings_native_set_two_finger_scroll;
+  input_settings_class->set_scroll_button =
+    meta_input_settings_native_set_scroll_button;
+  input_settings_class->set_click_method =
+    meta_input_settings_native_set_click_method;
+  input_settings_class->set_keyboard_repeat =
+    meta_input_settings_native_set_keyboard_repeat;
+  input_settings_class->set_disable_while_typing =
+    meta_input_settings_native_set_disable_while_typing;
+
+  input_settings_class->set_tablet_mapping =
+    meta_input_settings_native_set_tablet_mapping;
+  input_settings_class->set_tablet_keep_aspect =
+    meta_input_settings_native_set_tablet_keep_aspect;
+  input_settings_class->set_tablet_area =
+    meta_input_settings_native_set_tablet_area;
+
+  input_settings_class->set_mouse_accel_profile =
+    meta_input_settings_native_set_mouse_accel_profile;
+  input_settings_class->set_trackball_accel_profile =
+    meta_input_settings_native_set_trackball_accel_profile;
+
+  input_settings_class->set_stylus_pressure =
+    meta_input_settings_native_set_stylus_pressure;
+  input_settings_class->set_stylus_button_map =
+    meta_input_settings_native_set_stylus_button_map;
+
+  input_settings_class->has_two_finger_scroll =
+    meta_input_settings_native_has_two_finger_scroll;
+  input_settings_class->is_trackball_device =
+    meta_input_settings_native_is_trackball_device;
 }
 
 static void
diff --git a/src/backends/native/meta-launcher.c b/src/backends/native/meta-launcher.c
index a43c1cc3d..5212dd748 100644
--- a/src/backends/native/meta-launcher.c
+++ b/src/backends/native/meta-launcher.c
@@ -60,10 +60,13 @@ meta_launcher_get_seat_id (MetaLauncher *launcher)
 }
 
 static gboolean
-find_systemd_session (gchar **session_id,
+find_systemd_session (gchar  **session_id,
                       GError **error)
 {
-  const gchar * const graphical_session_types[] = { "wayland", "x11", "mir", NULL };
+  const gchar * const graphical_session_types[] =
+  {
+    "wayland", "x11", "mir", NULL
+  };
   const gchar * const active_states[] = { "active", "online", NULL };
   g_autofree gchar *class = NULL;
   g_autofree gchar *local_session_id = NULL;
@@ -116,43 +119,43 @@ find_systemd_session (gchar **session_id,
               return FALSE;
             }
 
-        if (n_sessions == 0)
-          {
-            g_set_error (error,
-                         G_IO_ERROR,
-                         G_IO_ERROR_NOT_FOUND,
-                         "User %d has no sessions",
-                         getuid ());
-            return FALSE;
-          }
-
-        for (int i = 0; i < n_sessions; ++i)
-          {
-            saved_errno = sd_session_get_class (sessions[i], &class);
-            if (saved_errno < 0)
-              {
-                g_warning ("Couldn't get class for session '%d': %s",
-                           i,
-                           g_strerror (-saved_errno));
-                continue;
-              }
-
-            if (g_strcmp0 (class, "greeter") == 0)
-              {
-                local_session_id = g_strdup (sessions[i]);
-                break;
-              }
-          }
-
-        if (!local_session_id)
-          {
-            g_set_error (error,
-                         G_IO_ERROR,
-                         G_IO_ERROR_NOT_FOUND,
-                         "Couldn't find a session or a greeter session for user %d",
-                         getuid ());
-            return FALSE;
-          }
+          if (n_sessions == 0)
+            {
+              g_set_error (error,
+                           G_IO_ERROR,
+                           G_IO_ERROR_NOT_FOUND,
+                           "User %d has no sessions",
+                           getuid ());
+              return FALSE;
+            }
+
+          for (int i = 0; i < n_sessions; ++i)
+            {
+              saved_errno = sd_session_get_class (sessions[i], &class);
+              if (saved_errno < 0)
+                {
+                  g_warning ("Couldn't get class for session '%d': %s",
+                             i,
+                             g_strerror (-saved_errno));
+                  continue;
+                }
+
+              if (g_strcmp0 (class, "greeter") == 0)
+                {
+                  local_session_id = g_strdup (sessions[i]);
+                  break;
+                }
+            }
+
+          if (!local_session_id)
+            {
+              g_set_error (error,
+                           G_IO_ERROR,
+                           G_IO_ERROR_NOT_FOUND,
+                           "Couldn't find a session or a greeter session for user %d",
+                           getuid ());
+              return FALSE;
+            }
         }
       else
         {
@@ -191,29 +194,29 @@ find_systemd_session (gchar **session_id,
       return FALSE;
     }
 
-    /* and display sessions can be 'closing' if they are logged out but
-     * some processes are lingering; we shouldn't consider these */
-    saved_errno = sd_session_get_state (local_session_id, &state);
-    if (saved_errno < 0)
-      {
-        g_set_error (error,
-                     G_IO_ERROR,
-                     G_IO_ERROR_NOT_FOUND,
-                     "Couldn't get state for session '%s': %s",
-                     local_session_id,
-                     g_strerror (-saved_errno));
-        return FALSE;
-      }
-
-    if (!g_strv_contains (active_states, state))
-      {
-         g_set_error (error,
-                         G_IO_ERROR,
-                         G_IO_ERROR_NOT_FOUND,
-                         "Session '%s' is not active",
-                         local_session_id);
-         return FALSE;
-      }
+  /* and display sessions can be 'closing' if they are logged out but
+   * some processes are lingering; we shouldn't consider these */
+  saved_errno = sd_session_get_state (local_session_id, &state);
+  if (saved_errno < 0)
+    {
+      g_set_error (error,
+                   G_IO_ERROR,
+                   G_IO_ERROR_NOT_FOUND,
+                   "Couldn't get state for session '%s': %s",
+                   local_session_id,
+                   g_strerror (-saved_errno));
+      return FALSE;
+    }
+
+  if (!g_strv_contains (active_states, state))
+    {
+      g_set_error (error,
+                   G_IO_ERROR,
+                   G_IO_ERROR_NOT_FOUND,
+                   "Session '%s' is not active",
+                   local_session_id);
+      return FALSE;
+    }
 
   *session_id = g_steal_pointer (&local_session_id);
 
@@ -231,11 +234,13 @@ get_session_proxy (GCancellable *cancellable,
 
   if (!find_systemd_session (&session_id, &local_error))
     {
-      g_propagate_prefixed_error (error, local_error, "Could not get session ID: ");
+      g_propagate_prefixed_error (error, local_error,
+                                  "Could not get session ID: ");
       return NULL;
     }
 
-  proxy_path = get_escaped_dbus_path ("/org/freedesktop/login1/session", session_id);
+  proxy_path = get_escaped_dbus_path ("/org/freedesktop/login1/session",
+                                      session_id);
 
   session_proxy = login1_session_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
                                                          G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
@@ -243,7 +248,7 @@ get_session_proxy (GCancellable *cancellable,
                                                          proxy_path,
                                                          cancellable, error);
   if (!session_proxy)
-    g_prefix_error(error, "Could not get session proxy: ");
+    g_prefix_error (error, "Could not get session proxy: ");
 
   return session_proxy;
 }
@@ -258,7 +263,7 @@ get_seat_proxy (GCancellable *cancellable,
                                                          "/org/freedesktop/login1/seat/self",
                                                          cancellable, error);
   if (!seat)
-    g_prefix_error(error, "Could not get seat proxy: ");
+    g_prefix_error (error, "Could not get seat proxy: ");
 
   return seat;
 }
@@ -377,10 +382,10 @@ out:
 }
 
 static int
-on_evdev_device_open (const char  *path,
-                      int          flags,
-                      gpointer     user_data,
-                      GError     **error)
+on_evdev_device_open (const char *path,
+                      int         flags,
+                      gpointer    user_data,
+                      GError    **error)
 {
   MetaLauncher *self = user_data;
 
@@ -433,7 +438,8 @@ sync_active (MetaLauncher *self)
 {
   MetaBackend *backend = meta_get_backend ();
   MetaBackendNative *backend_native = META_BACKEND_NATIVE (backend);
-  gboolean active = login1_session_get_active (LOGIN1_SESSION (self->session_proxy));
+  gboolean active =
+    login1_session_get_active (LOGIN1_SESSION (self->session_proxy));
 
   if (active == self->session_active)
     return;
@@ -465,7 +471,8 @@ get_seat_id (GError **error)
 
   if (!find_systemd_session (&session_id, &local_error))
     {
-      g_propagate_prefixed_error (error, local_error, "Could not get session ID: ");
+      g_propagate_prefixed_error (error, local_error,
+                                  "Could not get session ID: ");
       return NULL;
     }
 
@@ -495,7 +502,8 @@ meta_launcher_new (GError **error)
   if (!session_proxy)
     goto fail;
 
-  if (!login1_session_call_take_control_sync (session_proxy, FALSE, NULL, error))
+  if (!login1_session_call_take_control_sync (session_proxy, FALSE, NULL,
+                                              error))
     {
       g_prefix_error (error, "Could not take control: ");
       goto fail;
@@ -524,11 +532,12 @@ meta_launcher_new (GError **error)
                                       on_evdev_device_close,
                                       self);
 
-  g_signal_connect (self->session_proxy, "notify::active", G_CALLBACK (on_active_changed), self);
+  g_signal_connect (self->session_proxy, "notify::active",
+                    G_CALLBACK (on_active_changed), self);
 
   return self;
 
- fail:
+fail:
   if (have_control)
     login1_session_call_release_control_sync (session_proxy, NULL, NULL);
   return NULL;
@@ -545,8 +554,8 @@ meta_launcher_free (MetaLauncher *self)
 }
 
 gboolean
-meta_launcher_activate_session (MetaLauncher  *launcher,
-                                GError       **error)
+meta_launcher_activate_session (MetaLauncher *launcher,
+                                GError      **error)
 {
   if (!login1_session_call_activate_sync (launcher->session_proxy, NULL, error))
     return FALSE;
@@ -556,9 +565,10 @@ meta_launcher_activate_session (MetaLauncher  *launcher,
 }
 
 gboolean
-meta_launcher_activate_vt (MetaLauncher  *launcher,
-                           signed char    vt,
-                           GError       **error)
+meta_launcher_activate_vt (MetaLauncher *launcher,
+                           signed char   vt,
+                           GError      **error)
 {
-  return login1_seat_call_switch_to_sync (launcher->seat_proxy, vt, NULL, error);
+  return login1_seat_call_switch_to_sync (launcher->seat_proxy, vt, NULL,
+                                          error);
 }
diff --git a/src/backends/native/meta-monitor-manager-kms.c b/src/backends/native/meta-monitor-manager-kms.c
index 3e80373dc..fa28da7bf 100644
--- a/src/backends/native/meta-monitor-manager-kms.c
+++ b/src/backends/native/meta-monitor-manager-kms.c
@@ -82,8 +82,8 @@ G_DEFINE_TYPE_WITH_CODE (MetaMonitorManagerKms, meta_monitor_manager_kms,
                                                 initable_iface_init))
 
 static GBytes *
-meta_monitor_manager_kms_read_edid (MetaMonitorManager *manager,
-                                    MetaOutput         *output)
+meta_monitor_manager_kms_read_edid (MetaMonitorManager * manager,
+                                    MetaOutput * output)
 {
   return meta_output_kms_read_edid (output);
 }
@@ -95,22 +95,23 @@ meta_monitor_manager_kms_set_power_save_mode (MetaMonitorManager *manager,
   uint64_t state;
   GList *l;
 
-  switch (mode) {
-  case META_POWER_SAVE_ON:
-    state = DRM_MODE_DPMS_ON;
-    break;
-  case META_POWER_SAVE_STANDBY:
-    state = DRM_MODE_DPMS_STANDBY;
-    break;
-  case META_POWER_SAVE_SUSPEND:
-    state = DRM_MODE_DPMS_SUSPEND;
-    break;
-  case META_POWER_SAVE_OFF:
-    state = DRM_MODE_DPMS_OFF;
-    break;
-  default:
-    return;
-  }
+  switch (mode)
+    {
+    case META_POWER_SAVE_ON:
+      state = DRM_MODE_DPMS_ON;
+      break;
+    case META_POWER_SAVE_STANDBY:
+      state = DRM_MODE_DPMS_STANDBY;
+      break;
+    case META_POWER_SAVE_SUSPEND:
+      state = DRM_MODE_DPMS_SUSPEND;
+      break;
+    case META_POWER_SAVE_OFF:
+      state = DRM_MODE_DPMS_OFF;
+      break;
+    default:
+      return;
+    }
 
   for (l = manager->gpus; l; l = l->next)
     {
@@ -132,10 +133,10 @@ meta_monitor_manager_kms_ensure_initial_config (MetaMonitorManager *manager)
 
 static void
 apply_crtc_assignments (MetaMonitorManager *manager,
-                        MetaCrtcInfo       **crtcs,
-                        unsigned int         n_crtcs,
-                        MetaOutputInfo     **outputs,
-                        unsigned int         n_outputs)
+                        MetaCrtcInfo      **crtcs,
+                        unsigned int        n_crtcs,
+                        MetaOutputInfo    **outputs,
+                        unsigned int        n_outputs)
 {
   unsigned i;
   GList *l;
@@ -193,7 +194,7 @@ apply_crtc_assignments (MetaMonitorManager *manager,
       meta_crtc_kms_apply_transform (crtc);
     }
   /* Disable CRTCs not mentioned in the list (they have is_dirty == FALSE,
-     because they weren't seen in the first loop) */
+   *  because they weren't seen in the first loop) */
   for (l = manager->gpus; l; l = l->next)
     {
       MetaGpu *gpu = l->data;
@@ -283,10 +284,11 @@ update_screen_size (MetaMonitorManager *manager,
 }
 
 static gboolean
-meta_monitor_manager_kms_apply_monitors_config (MetaMonitorManager      *manager,
-                                                MetaMonitorsConfig      *config,
-                                                MetaMonitorsConfigMethod method,
-                                                GError                 **error)
+meta_monitor_manager_kms_apply_monitors_config (
+  MetaMonitorManager      *manager,
+  MetaMonitorsConfig      *config,
+  MetaMonitorsConfigMethod method,
+  GError                 **error)
 {
   GPtrArray *crtc_infos;
   GPtrArray *output_infos;
@@ -327,12 +329,12 @@ meta_monitor_manager_kms_apply_monitors_config (MetaMonitorManager      *manager
 }
 
 static void
-meta_monitor_manager_kms_get_crtc_gamma (MetaMonitorManager  *manager,
-                                         MetaCrtc            *crtc,
-                                         gsize               *size,
-                                         unsigned short     **red,
-                                         unsigned short     **green,
-                                         unsigned short     **blue)
+meta_monitor_manager_kms_get_crtc_gamma (MetaMonitorManager *manager,
+                                         MetaCrtc           *crtc,
+                                         gsize              *size,
+                                         unsigned short    **red,
+                                         unsigned short    **green,
+                                         unsigned short    **blue)
 {
   MetaGpu *gpu = meta_crtc_get_gpu (crtc);
   int kms_fd = meta_gpu_kms_get_fd (META_GPU_KMS (gpu));
@@ -387,7 +389,8 @@ on_uevent (GUdevClient *client,
 }
 
 static void
-meta_monitor_manager_kms_connect_uevent_handler (MetaMonitorManagerKms *manager_kms)
+meta_monitor_manager_kms_connect_uevent_handler (
+  MetaMonitorManagerKms *manager_kms)
 {
   manager_kms->uevent_handler_id = g_signal_connect (manager_kms->udev,
                                                      "uevent",
@@ -396,7 +399,8 @@ meta_monitor_manager_kms_connect_uevent_handler (MetaMonitorManagerKms *manager_
 }
 
 static void
-meta_monitor_manager_kms_disconnect_uevent_handler (MetaMonitorManagerKms *manager_kms)
+meta_monitor_manager_kms_disconnect_uevent_handler (
+  MetaMonitorManagerKms *manager_kms)
 {
   g_signal_handler_disconnect (manager_kms->udev,
                                manager_kms->uevent_handler_id);
@@ -427,19 +431,21 @@ meta_monitor_manager_kms_is_transform_handled (MetaMonitorManager  *manager,
 }
 
 static float
-meta_monitor_manager_kms_calculate_monitor_mode_scale (MetaMonitorManager *manager,
-                                                       MetaMonitor        *monitor,
-                                                       MetaMonitorMode    *monitor_mode)
+meta_monitor_manager_kms_calculate_monitor_mode_scale (
+  MetaMonitorManager *manager,
+  MetaMonitor        *monitor,
+  MetaMonitorMode    *monitor_mode)
 {
   return meta_monitor_calculate_mode_scale (monitor, monitor_mode);
 }
 
 static float *
-meta_monitor_manager_kms_calculate_supported_scales (MetaMonitorManager          *manager,
-                                                     MetaLogicalMonitorLayoutMode layout_mode,
-                                                     MetaMonitor                 *monitor,
-                                                     MetaMonitorMode             *monitor_mode,
-                                                     int                         *n_supported_scales)
+meta_monitor_manager_kms_calculate_supported_scales (
+  MetaMonitorManager          *manager,
+  MetaLogicalMonitorLayoutMode layout_mode,
+  MetaMonitor                 *monitor,
+  MetaMonitorMode             *monitor_mode,
+  int                         *n_supported_scales)
 {
   MetaMonitorScalesConstraint constraints =
     META_MONITOR_SCALES_CONSTRAINT_NONE;
@@ -742,15 +748,23 @@ meta_monitor_manager_kms_class_init (MetaMonitorManagerKmsClass *klass)
   object_class->dispose = meta_monitor_manager_kms_dispose;
 
   manager_class->read_edid = meta_monitor_manager_kms_read_edid;
-  manager_class->ensure_initial_config = meta_monitor_manager_kms_ensure_initial_config;
-  manager_class->apply_monitors_config = meta_monitor_manager_kms_apply_monitors_config;
-  manager_class->set_power_save_mode = meta_monitor_manager_kms_set_power_save_mode;
+  manager_class->ensure_initial_config =
+    meta_monitor_manager_kms_ensure_initial_config;
+  manager_class->apply_monitors_config =
+    meta_monitor_manager_kms_apply_monitors_config;
+  manager_class->set_power_save_mode =
+    meta_monitor_manager_kms_set_power_save_mode;
   manager_class->get_crtc_gamma = meta_monitor_manager_kms_get_crtc_gamma;
   manager_class->set_crtc_gamma = meta_monitor_manager_kms_set_crtc_gamma;
-  manager_class->is_transform_handled = meta_monitor_manager_kms_is_transform_handled;
-  manager_class->calculate_monitor_mode_scale = meta_monitor_manager_kms_calculate_monitor_mode_scale;
-  manager_class->calculate_supported_scales = meta_monitor_manager_kms_calculate_supported_scales;
+  manager_class->is_transform_handled =
+    meta_monitor_manager_kms_is_transform_handled;
+  manager_class->calculate_monitor_mode_scale =
+    meta_monitor_manager_kms_calculate_monitor_mode_scale;
+  manager_class->calculate_supported_scales =
+    meta_monitor_manager_kms_calculate_supported_scales;
   manager_class->get_capabilities = meta_monitor_manager_kms_get_capabilities;
-  manager_class->get_max_screen_size = meta_monitor_manager_kms_get_max_screen_size;
-  manager_class->get_default_layout_mode = meta_monitor_manager_kms_get_default_layout_mode;
+  manager_class->get_max_screen_size =
+    meta_monitor_manager_kms_get_max_screen_size;
+  manager_class->get_default_layout_mode =
+    meta_monitor_manager_kms_get_default_layout_mode;
 }
diff --git a/src/backends/native/meta-output-kms.c b/src/backends/native/meta-output-kms.c
index 2e870658c..a440b3e9a 100644
--- a/src/backends/native/meta-output-kms.c
+++ b/src/backends/native/meta-output-kms.c
@@ -182,7 +182,7 @@ output_get_tile_info (MetaGpuKms *gpu_kms,
     {
       int ret;
 
-      ret = sscanf ((char *)tile_blob->data, "%d:%d:%d:%d:%d:%d:%d:%d",
+      ret = sscanf ((char *) tile_blob->data, "%d:%d:%d:%d:%d:%d:%d:%d",
                     &output->tile_info.group_id,
                     &output->tile_info.flags,
                     &output->tile_info.max_h_tiles,
@@ -259,8 +259,8 @@ handle_panel_orientation (MetaOutput        *output,
 }
 
 static void
-find_connector_properties (MetaGpuKms    *gpu_kms,
-                           MetaOutput    *output)
+find_connector_properties (MetaGpuKms *gpu_kms,
+                           MetaOutput *output)
 {
   MetaOutputKms *output_kms = output->driver_private;
   drmModeConnector *connector = output_kms->connector;
@@ -311,7 +311,8 @@ find_connector_properties (MetaGpuKms    *gpu_kms,
 static char *
 make_output_name (drmModeConnector *connector)
 {
-  static const char * const connector_type_names[] = {
+  static const char * const connector_type_names[] =
+  {
     "None",
     "VGA",
     "DVI-I",
@@ -442,9 +443,9 @@ compare_modes (const void *one,
 }
 
 static gboolean
-init_output_modes (MetaOutput  *output,
-                   MetaGpuKms  *gpu_kms,
-                   GError     **error)
+init_output_modes (MetaOutput *output,
+                   MetaGpuKms *gpu_kms,
+                   GError    **error)
 {
   MetaOutputKms *output_kms = output->driver_private;
   unsigned int i;
@@ -488,11 +489,11 @@ init_output_modes (MetaOutput  *output,
 }
 
 MetaOutput *
-meta_create_kms_output (MetaGpuKms        *gpu_kms,
-                        drmModeConnector  *connector,
-                        MetaKmsResources  *resources,
-                        MetaOutput        *old_output,
-                        GError           **error)
+meta_create_kms_output (MetaGpuKms       *gpu_kms,
+                        drmModeConnector *connector,
+                        MetaKmsResources *resources,
+                        MetaOutput       *old_output,
+                        GError          **error)
 {
   MetaGpu *gpu = META_GPU (gpu_kms);
   MetaOutput *output;
@@ -570,17 +571,17 @@ meta_create_kms_output (MetaGpuKms        *gpu_kms,
         continue;
 
       /* We only list CRTCs as supported if they are supported by all encoders
-         for this connectors.
-
-         This is what xf86-video-modesetting does (see drmmode_output_init())
-         */
+       *  for this connectors.
+       *
+       *  This is what xf86-video-modesetting does (see drmmode_output_init())
+       */
       crtc_mask &= output_kms->encoders[i]->possible_crtcs;
 
       if (output_kms->encoders[i]->encoder_id == connector->encoder_id)
         output_kms->current_encoder = output_kms->encoders[i];
     }
 
-  crtcs = g_array_new (FALSE, FALSE, sizeof (MetaCrtc*));
+  crtcs = g_array_new (FALSE, FALSE, sizeof (MetaCrtc *));
 
   for (l = meta_gpu_get_crtcs (gpu), i = 0; l; l = l->next, i++)
     {
@@ -593,7 +594,7 @@ meta_create_kms_output (MetaGpuKms        *gpu_kms,
     }
 
   output->n_possible_crtcs = crtcs->len;
-  output->possible_crtcs = (void*)g_array_free (crtcs, FALSE);
+  output->possible_crtcs = (void *) g_array_free (crtcs, FALSE);
 
   if (output_kms->current_encoder && output_kms->current_encoder->crtc_id != 0)
     {
@@ -654,14 +655,16 @@ meta_create_kms_output (MetaGpuKms        *gpu_kms,
   output_get_tile_info (gpu_kms, output);
 
   /* FIXME: backlight is a very driver specific thing unfortunately,
-     every DDX does its own thing, and the dumb KMS API does not include it.
-
-     For example, xf86-video-intel has a list of paths to probe in /sys/class/backlight
-     (one for each major HW maker, and then some).
-     We can't do the same because we're not root.
-     It might be best to leave backlight out of the story and rely on the setuid
-     helper in gnome-settings-daemon.
-     */
+   *  every DDX does its own thing, and the dumb KMS API does not include it.
+   *
+   *  For example, xf86-video-intel has a list of paths to probe in
+   * /sys/class/backlight
+   *  (one for each major HW maker, and then some).
+   *  We can't do the same because we're not root.
+   *  It might be best to leave backlight out of the story and rely on the
+   * setuid
+   *  helper in gnome-settings-daemon.
+   */
   output->backlight_min = 0;
   output->backlight_max = 0;
   output->backlight = -1;
diff --git a/src/backends/native/meta-renderer-native-gles3.c 
b/src/backends/native/meta-renderer-native-gles3.c
index 71a440832..109e26ceb 100644
--- a/src/backends/native/meta-renderer-native-gles3.c
+++ b/src/backends/native/meta-renderer-native-gles3.c
@@ -46,18 +46,18 @@
 #endif
 
 static EGLImageKHR
-create_egl_image (MetaEgl       *egl,
-                  EGLDisplay     egl_display,
-                  EGLContext     egl_context,
-                  unsigned int   width,
-                  unsigned int   height,
-                  uint32_t       n_planes,
-                  uint32_t      *strides,
-                  uint32_t      *offsets,
-                  uint64_t      *modifiers,
-                  uint32_t       format,
-                  int            fd,
-                  GError       **error)
+create_egl_image (MetaEgl     *egl,
+                  EGLDisplay   egl_display,
+                  EGLContext   egl_context,
+                  unsigned int width,
+                  unsigned int height,
+                  uint32_t     n_planes,
+                  uint32_t    *strides,
+                  uint32_t    *offsets,
+                  uint64_t    *modifiers,
+                  uint32_t     format,
+                  int          fd,
+                  GError     **error)
 {
   EGLint attribs[37];
   int atti = 0;
@@ -141,10 +141,10 @@ create_egl_image (MetaEgl       *egl,
 }
 
 static void
-paint_egl_image (MetaGles3   *gles3,
-                 EGLImageKHR  egl_image,
-                 int          width,
-                 int          height)
+paint_egl_image (MetaGles3  *gles3,
+                 EGLImageKHR egl_image,
+                 int         width,
+                 int         height)
 {
   GLuint texture;
   GLuint framebuffer;
@@ -169,8 +169,9 @@ paint_egl_image (MetaGles3   *gles3,
   GLBAS (gles3, glTexParameteri, (GL_TEXTURE_2D, GL_TEXTURE_WRAP_R_OES,
                                   GL_CLAMP_TO_EDGE));
 
-  GLBAS (gles3, glFramebufferTexture2D, (GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
-                                         GL_TEXTURE_2D, texture, 0));
+  GLBAS (gles3, glFramebufferTexture2D,
+         (GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+          GL_TEXTURE_2D, texture, 0));
 
   GLBAS (gles3, glBindFramebuffer, (GL_READ_FRAMEBUFFER, framebuffer));
   GLBAS (gles3, glBlitFramebuffer, (0, height, width, 0,
@@ -180,13 +181,13 @@ paint_egl_image (MetaGles3   *gles3,
 }
 
 gboolean
-meta_renderer_native_gles3_blit_shared_bo (MetaEgl        *egl,
-                                           MetaGles3      *gles3,
-                                           EGLDisplay      egl_display,
-                                           EGLContext      egl_context,
-                                           EGLSurface      egl_surface,
-                                           struct gbm_bo  *shared_bo,
-                                           GError        **error)
+meta_renderer_native_gles3_blit_shared_bo (MetaEgl       *egl,
+                                           MetaGles3     *gles3,
+                                           EGLDisplay     egl_display,
+                                           EGLContext     egl_context,
+                                           EGLSurface     egl_surface,
+                                           struct gbm_bo *shared_bo,
+                                           GError       **error)
 {
   int shared_bo_fd;
   unsigned int width;
diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
index ad4f289c9..832c5f6da 100644
--- a/src/backends/native/meta-renderer-native.c
+++ b/src/backends/native/meta-renderer-native.c
@@ -90,12 +90,14 @@ typedef struct _MetaRendererNativeGpuData
 {
   MetaRendererNative *renderer_native;
 
-  struct {
+  struct
+  {
     struct gbm_device *device;
   } gbm;
 
 #ifdef HAVE_EGL_DEVICE
-  struct {
+  struct
+  {
     EGLDeviceEXT device;
 
     gboolean no_egl_output_drm_flip_event;
@@ -109,7 +111,8 @@ typedef struct _MetaRendererNativeGpuData
   /*
    * Fields used for blitting iGPU framebuffer content onto dGPU framebuffers.
    */
-  struct {
+  struct
+  {
     MetaSharedFramebufferCopyMode copy_mode;
 
     /* For GPU blit mode */
@@ -136,7 +139,8 @@ typedef struct _MetaOnscreenNativeSecondaryGpuState
 
   EGLSurface egl_surface;
 
-  struct {
+  struct
+  {
     struct gbm_surface *surface;
     uint32_t current_fb_id;
     uint32_t next_fb_id;
@@ -144,7 +148,8 @@ typedef struct _MetaOnscreenNativeSecondaryGpuState
     struct gbm_bo *next_bo;
   } gbm;
 
-  struct {
+  struct
+  {
     MetaDumbBuffer *dumb_fb;
     MetaDumbBuffer dumb_fbs[2];
   } cpu;
@@ -160,7 +165,8 @@ typedef struct _MetaOnscreenNative
 
   GHashTable *secondary_gpu_states;
 
-  struct {
+  struct
+  {
     struct gbm_surface *surface;
     uint32_t current_fb_id;
     uint32_t next_fb_id;
@@ -169,7 +175,8 @@ typedef struct _MetaOnscreenNative
   } gbm;
 
 #ifdef HAVE_EGL_DEVICE
-  struct {
+  struct
+  {
     EGLStreamKHR stream;
 
     MetaDumbBuffer dumb_fb;
@@ -465,7 +472,8 @@ get_supported_egl_modifiers (CoglOnscreen *onscreen,
                                  num_modifiers);
   ret = meta_egl_query_dma_buf_modifiers (egl, renderer_gpu_data->egl_display,
                                           format, num_modifiers,
-                                          (EGLuint64KHR *) modifiers->data, NULL,
+                                          (EGLuint64KHR *) modifiers->data,
+                                          NULL,
                                           &num_modifiers, &error);
 
   if (!ret)
@@ -556,11 +564,12 @@ get_supported_modifiers (CoglOnscreen *onscreen,
 }
 
 static gboolean
-init_secondary_gpu_state_gpu_copy_mode (MetaRendererNative         *renderer_native,
-                                        CoglOnscreen               *onscreen,
-                                        MetaRendererNativeGpuData  *renderer_gpu_data,
-                                        MetaGpuKms                 *gpu_kms,
-                                        GError                    **error)
+init_secondary_gpu_state_gpu_copy_mode (
+  MetaRendererNative        *renderer_native,
+  CoglOnscreen              *onscreen,
+  MetaRendererNativeGpuData *renderer_gpu_data,
+  MetaGpuKms                *gpu_kms,
+  GError                   **error)
 {
   CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
   CoglOnscreenEGL *onscreen_egl = onscreen->winsys;
@@ -614,7 +623,8 @@ init_secondary_gpu_state_gpu_copy_mode (MetaRendererNative         *renderer_nat
 }
 
 static void
-secondary_gpu_state_free (MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state)
+secondary_gpu_state_free (
+  MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state)
 {
   MetaBackend *backend = meta_get_backend ();
   MetaEgl *egl = meta_backend_get_egl (backend);
@@ -648,11 +658,12 @@ secondary_gpu_state_free (MetaOnscreenNativeSecondaryGpuState *secondary_gpu_sta
 }
 
 static gboolean
-init_secondary_gpu_state_cpu_copy_mode (MetaRendererNative         *renderer_native,
-                                        CoglOnscreen               *onscreen,
-                                        MetaRendererNativeGpuData  *renderer_gpu_data,
-                                        MetaGpuKms                 *gpu_kms,
-                                        GError                    **error)
+init_secondary_gpu_state_cpu_copy_mode (
+  MetaRendererNative        *renderer_native,
+  CoglOnscreen              *onscreen,
+  MetaRendererNativeGpuData *renderer_gpu_data,
+  MetaGpuKms                *gpu_kms,
+  GError                   **error)
 {
   CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
   CoglOnscreenEGL *onscreen_egl = onscreen->winsys;
@@ -691,10 +702,10 @@ init_secondary_gpu_state_cpu_copy_mode (MetaRendererNative         *renderer_nat
 }
 
 static gboolean
-init_secondary_gpu_state (MetaRendererNative  *renderer_native,
-                          CoglOnscreen        *onscreen,
-                          MetaGpuKms          *gpu_kms,
-                          GError             **error)
+init_secondary_gpu_state (MetaRendererNative *renderer_native,
+                          CoglOnscreen       *onscreen,
+                          MetaGpuKms         *gpu_kms,
+                          GError            **error)
 {
   MetaRendererNativeGpuData *renderer_gpu_data;
 
@@ -746,7 +757,8 @@ flush_pending_swap_notify (CoglFramebuffer *framebuffer)
           CoglFrameInfo *info;
 
           while ((info = g_queue_peek_head (&onscreen->pending_frame_infos)) &&
-                 info->global_frame_counter <= onscreen_native->pending_swap_notify_frame_count)
+                 info->global_frame_counter <=
+                 onscreen_native->pending_swap_notify_frame_count)
             {
               _cogl_onscreen_notify_frame_sync (onscreen, info);
               _cogl_onscreen_notify_complete (onscreen, info);
@@ -846,7 +858,7 @@ free_current_bo (CoglOnscreen *onscreen)
 static void
 meta_onscreen_native_queue_swap_notify (CoglOnscreen *onscreen)
 {
-  CoglOnscreenEGL *onscreen_egl =  onscreen->winsys;
+  CoglOnscreenEGL *onscreen_egl = onscreen->winsys;
   MetaOnscreenNative *onscreen_native = onscreen_egl->platform;
   MetaRendererNative *renderer_native = onscreen_native->renderer_native;
 
@@ -913,9 +925,10 @@ fail:
 }
 
 static int
-meta_renderer_native_add_egl_config_attributes (CoglDisplay           *cogl_display,
-                                                CoglFramebufferConfig *config,
-                                                EGLint                *attributes)
+meta_renderer_native_add_egl_config_attributes (
+  CoglDisplay           *cogl_display,
+  CoglFramebufferConfig *config,
+  EGLint                *attributes)
 {
   CoglRendererEGL *cogl_renderer_egl = cogl_display->renderer->winsys;
   MetaRendererNativeGpuData *renderer_gpu_data = cogl_renderer_egl->platform;
@@ -939,12 +952,12 @@ meta_renderer_native_add_egl_config_attributes (CoglDisplay           *cogl_disp
 }
 
 static gboolean
-choose_egl_config_from_gbm_format (MetaEgl       *egl,
-                                   EGLDisplay     egl_display,
-                                   const EGLint  *attributes,
-                                   uint32_t       gbm_format,
-                                   EGLConfig     *out_config,
-                                   GError       **error)
+choose_egl_config_from_gbm_format (MetaEgl      *egl,
+                                   EGLDisplay    egl_display,
+                                   const EGLint *attributes,
+                                   uint32_t      gbm_format,
+                                   EGLConfig    *out_config,
+                                   GError      **error)
 {
   EGLConfig *egl_configs;
   EGLint n_configs;
@@ -986,10 +999,10 @@ choose_egl_config_from_gbm_format (MetaEgl       *egl,
 }
 
 static gboolean
-meta_renderer_native_choose_egl_config (CoglDisplay  *cogl_display,
-                                        EGLint       *attributes,
-                                        EGLConfig    *out_config,
-                                        GError      **error)
+meta_renderer_native_choose_egl_config (CoglDisplay *cogl_display,
+                                        EGLint      *attributes,
+                                        EGLConfig   *out_config,
+                                        GError     **error)
 {
   CoglRenderer *cogl_renderer = cogl_display->renderer;
   CoglRendererEGL *cogl_renderer_egl = cogl_renderer->winsys;
@@ -1051,7 +1064,8 @@ create_dummy_pbuffer_surface (EGLDisplay egl_display,
   MetaBackend *backend = meta_get_backend ();
   MetaEgl *egl = meta_backend_get_egl (backend);
   EGLConfig pbuffer_config;
-  static const EGLint pbuffer_config_attribs[] = {
+  static const EGLint pbuffer_config_attribs[] =
+  {
     EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
     EGL_RED_SIZE, 1,
     EGL_GREEN_SIZE, 1,
@@ -1060,7 +1074,8 @@ create_dummy_pbuffer_surface (EGLDisplay egl_display,
     EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
     EGL_NONE
   };
-  static const EGLint pbuffer_attribs[] = {
+  static const EGLint pbuffer_attribs[] =
+  {
     EGL_WIDTH, 16,
     EGL_HEIGHT, 16,
     EGL_NONE
@@ -1098,8 +1113,8 @@ meta_renderer_native_egl_context_created (CoglDisplay *cogl_display,
                                       cogl_display_egl->egl_context))
     {
       _cogl_set_error (error, COGL_WINSYS_ERROR,
-                   COGL_WINSYS_ERROR_CREATE_CONTEXT,
-                   "Failed to make context current");
+                       COGL_WINSYS_ERROR_CREATE_CONTEXT,
+                       "Failed to make context current");
       return FALSE;
     }
 
@@ -1140,7 +1155,7 @@ swap_secondary_drm_fb (MetaGpuKms                          *gpu_kms,
 static void
 meta_onscreen_native_swap_drm_fb (CoglOnscreen *onscreen)
 {
-  CoglOnscreenEGL *onscreen_egl =  onscreen->winsys;
+  CoglOnscreenEGL *onscreen_egl = onscreen->winsys;
   MetaOnscreenNative *onscreen_native = onscreen_egl->platform;
 
   free_current_bo (onscreen);
@@ -1165,7 +1180,7 @@ on_crtc_flipped (GClosure         *closure,
   CoglFramebuffer *framebuffer =
     clutter_stage_view_get_onscreen (stage_view);
   CoglOnscreen *onscreen = COGL_ONSCREEN (framebuffer);
-  CoglOnscreenEGL *onscreen_egl =  onscreen->winsys;
+  CoglOnscreenEGL *onscreen_egl = onscreen->winsys;
   MetaOnscreenNative *onscreen_native = onscreen_egl->platform;
   MetaRendererNative *renderer_native = onscreen_native->renderer_native;
   MetaGpuKms *render_gpu = onscreen_native->render_gpu;
@@ -1237,7 +1252,7 @@ flip_closure_destroyed (MetaRendererView *view)
   CoglFramebuffer *framebuffer =
     clutter_stage_view_get_onscreen (stage_view);
   CoglOnscreen *onscreen = COGL_ONSCREEN (framebuffer);
-  CoglOnscreenEGL *onscreen_egl =  onscreen->winsys;
+  CoglOnscreenEGL *onscreen_egl = onscreen->winsys;
   MetaOnscreenNative *onscreen_native = onscreen_egl->platform;
   MetaRendererNative *renderer_native = onscreen_native->renderer_native;
   MetaGpuKms *render_gpu = onscreen_native->render_gpu;
@@ -1467,7 +1482,8 @@ meta_onscreen_native_set_crtc_modes (CoglOnscreen *onscreen)
   logical_monitor = meta_renderer_view_get_logical_monitor (view);
   if (logical_monitor)
     {
-      SetCrtcFbData data = {
+      SetCrtcFbData data =
+      {
         .render_gpu = render_gpu,
         .onscreen = onscreen,
         .fb_id = fb_id
@@ -1550,7 +1566,8 @@ meta_onscreen_native_flip_crtcs (CoglOnscreen *onscreen)
   logical_monitor = meta_renderer_view_get_logical_monitor (view);
   if (logical_monitor)
     {
-      FlipCrtcData data = {
+      FlipCrtcData data =
+      {
         .onscreen = onscreen,
         .flip_closure = flip_closure,
       };
@@ -1749,8 +1766,10 @@ copy_shared_framebuffer_gpu (CoglOnscreen                        *onscreen,
   if (!meta_renderer_native_gles3_blit_shared_bo (egl,
                                                   renderer_native->gles3,
                                                   renderer_gpu_data->egl_display,
-                                                  renderer_gpu_data->secondary.egl_context,
-                                                  secondary_gpu_state->egl_surface,
+                                                  renderer_gpu_data->secondary.
+                                                  egl_context,
+                                                  secondary_gpu_state->
+                                                  egl_surface,
                                                   onscreen_native->gbm.next_bo,
                                                   &error))
     {
@@ -1946,7 +1965,8 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen,
       onscreen_native->pending_set_crtc = FALSE;
     }
 
-  onscreen_native->pending_queue_swap_notify_frame_count = renderer_native->frame_counter;
+  onscreen_native->pending_queue_swap_notify_frame_count =
+    renderer_native->frame_counter;
   meta_onscreen_native_flip_crtcs (onscreen);
 
   /*
@@ -2013,8 +2033,9 @@ should_surface_be_sharable (CoglOnscreen *onscreen)
       MetaMonitor *monitor = l->data;
       MetaGpuKms *gpu_kms = META_GPU_KMS (meta_monitor_get_gpu (monitor));
 
-      if (renderer_gpu_data != meta_renderer_native_get_gpu_data (renderer_native,
-                                                                  gpu_kms))
+      if (renderer_gpu_data !=
+          meta_renderer_native_get_gpu_data (renderer_native,
+                                             gpu_kms))
         return TRUE;
     }
 
@@ -2135,12 +2156,14 @@ meta_renderer_native_create_surface_egl_device (CoglOnscreen       *onscreen,
   EGLint num_layers;
   EGLOutputLayerEXT output_layer;
   EGLAttrib output_attribs[3];
-  EGLint stream_attribs[] = {
+  EGLint stream_attribs[] =
+  {
     EGL_STREAM_FIFO_LENGTH_KHR, 1,
     EGL_CONSUMER_AUTO_ACQUIRE_EXT, EGL_FALSE,
     EGL_NONE
   };
-  EGLint stream_producer_attribs[] = {
+  EGLint stream_producer_attribs[] =
+  {
     EGL_WIDTH, width,
     EGL_HEIGHT, height,
     EGL_NONE
@@ -2210,12 +2233,12 @@ meta_renderer_native_create_surface_egl_device (CoglOnscreen       *onscreen,
 #endif /* HAVE_EGL_DEVICE */
 
 static gboolean
-init_dumb_fb (MetaDumbBuffer  *dumb_fb,
-              MetaGpuKms      *gpu_kms,
-              int              width,
-              int              height,
-              uint32_t         format,
-              GError         **error)
+init_dumb_fb (MetaDumbBuffer *dumb_fb,
+              MetaGpuKms     *gpu_kms,
+              int             width,
+              int             height,
+              uint32_t        format,
+              GError        **error)
 {
   struct drm_mode_create_dumb create_arg;
   struct drm_mode_destroy_dumb destroy_arg;
@@ -2529,7 +2552,8 @@ meta_renderer_native_release_onscreen (CoglOnscreen *onscreen)
 }
 
 static const CoglWinsysEGLVtable
-_cogl_winsys_egl_vtable = {
+  _cogl_winsys_egl_vtable =
+{
   .add_config_attributes = meta_renderer_native_add_egl_config_attributes,
   .choose_config = meta_renderer_native_choose_egl_config,
   .display_setup = meta_renderer_native_setup_egl_display,
@@ -2589,14 +2613,14 @@ meta_renderer_native_queue_modes_reset (MetaRendererNative *renderer_native)
 }
 
 static CoglOnscreen *
-meta_renderer_native_create_onscreen (MetaRendererNative   *renderer_native,
-                                      MetaGpuKms           *render_gpu,
-                                      MetaLogicalMonitor   *logical_monitor,
-                                      CoglContext          *context,
-                                      MetaMonitorTransform  transform,
-                                      gint                  view_width,
-                                      gint                  view_height,
-                                      GError              **error)
+meta_renderer_native_create_onscreen (MetaRendererNative  *renderer_native,
+                                      MetaGpuKms          *render_gpu,
+                                      MetaLogicalMonitor  *logical_monitor,
+                                      CoglContext         *context,
+                                      MetaMonitorTransform transform,
+                                      gint                 view_width,
+                                      gint                 view_height,
+                                      GError             **error)
 {
   CoglOnscreen *onscreen;
   CoglOnscreenEGL *onscreen_egl;
@@ -2657,12 +2681,12 @@ meta_renderer_native_create_onscreen (MetaRendererNative   *renderer_native,
 }
 
 static CoglOffscreen *
-meta_renderer_native_create_offscreen (MetaRendererNative    *renderer,
-                                       CoglContext           *context,
-                                       MetaMonitorTransform   transform,
-                                       gint                   view_width,
-                                       gint                   view_height,
-                                       GError               **error)
+meta_renderer_native_create_offscreen (MetaRendererNative  *renderer,
+                                       CoglContext         *context,
+                                       MetaMonitorTransform transform,
+                                       gint                 view_width,
+                                       gint                 view_height,
+                                       GError             **error)
 {
   CoglOffscreen *fb;
   CoglTexture2D *tex;
@@ -2696,7 +2720,7 @@ get_native_cogl_winsys_vtable (CoglRenderer *cogl_renderer)
   if (!vtable_inited)
     {
       /* The this winsys is a subclass of the EGL winsys so we
-         start by copying its vtable */
+       *  start by copying its vtable */
 
       parent_vtable = _cogl_winsys_egl_get_vtable ();
       vtable = *parent_vtable;
@@ -2963,7 +2987,8 @@ create_secondary_egl_config (MetaEgl               *egl,
                              EGLConfig             *egl_config,
                              GError               **error)
 {
-  EGLint attributes[] = {
+  EGLint attributes[] =
+  {
     EGL_RED_SIZE, 1,
     EGL_GREEN_SIZE, 1,
     EGL_BLUE_SIZE, 1,
@@ -3002,7 +3027,8 @@ create_secondary_egl_context (MetaEgl   *egl,
                               EGLConfig  egl_config,
                               GError   **error)
 {
-  EGLint attributes[] = {
+  EGLint attributes[] =
+  {
     EGL_CONTEXT_CLIENT_VERSION, 3,
     EGL_NONE
   };
@@ -3041,7 +3067,8 @@ init_secondary_gpu_data_gpu (MetaRendererNativeGpuData *renderer_gpu_data,
                                     &egl_config, error))
     return FALSE;
 
-  egl_context = create_secondary_egl_context (egl, egl_display, egl_config, error);
+  egl_context = create_secondary_egl_context (egl, egl_display, egl_config,
+                                              error);
   if (egl_context == EGL_NO_CONTEXT)
     return FALSE;
 
@@ -3075,7 +3102,8 @@ init_secondary_gpu_data_gpu (MetaRendererNativeGpuData *renderer_gpu_data,
 
   renderer_gpu_data->secondary.egl_context = egl_context;
   renderer_gpu_data->secondary.egl_config = egl_config;
-  renderer_gpu_data->secondary.copy_mode = META_SHARED_FRAMEBUFFER_COPY_MODE_GPU;
+  renderer_gpu_data->secondary.copy_mode =
+    META_SHARED_FRAMEBUFFER_COPY_MODE_GPU;
 
   return TRUE;
 }
@@ -3083,7 +3111,8 @@ init_secondary_gpu_data_gpu (MetaRendererNativeGpuData *renderer_gpu_data,
 static void
 init_secondary_gpu_data_cpu (MetaRendererNativeGpuData *renderer_gpu_data)
 {
-  renderer_gpu_data->secondary.copy_mode = META_SHARED_FRAMEBUFFER_COPY_MODE_CPU;
+  renderer_gpu_data->secondary.copy_mode =
+    META_SHARED_FRAMEBUFFER_COPY_MODE_CPU;
 }
 
 static void
@@ -3094,17 +3123,18 @@ init_secondary_gpu_data (MetaRendererNativeGpuData *renderer_gpu_data)
   if (init_secondary_gpu_data_gpu (renderer_gpu_data, &error))
     return;
 
-  g_warning ("Failed to initialize accelerated iGPU/dGPU framebuffer sharing: %s",
-             error->message);
+  g_warning (
+    "Failed to initialize accelerated iGPU/dGPU framebuffer sharing: %s",
+    error->message);
   g_error_free (error);
 
   init_secondary_gpu_data_cpu (renderer_gpu_data);
 }
 
 static MetaRendererNativeGpuData *
-create_renderer_gpu_data_gbm (MetaRendererNative  *renderer_native,
-                              MetaGpuKms          *gpu_kms,
-                              GError             **error)
+create_renderer_gpu_data_gbm (MetaRendererNative *renderer_native,
+                              MetaGpuKms         *gpu_kms,
+                              GError            **error)
 {
   MetaMonitorManagerKms *monitor_manager_kms;
   MetaEgl *egl = meta_renderer_native_get_egl (renderer_native);
@@ -3187,9 +3217,9 @@ get_drm_device_file (MetaEgl     *egl,
 }
 
 static EGLDeviceEXT
-find_egl_device (MetaRendererNative  *renderer_native,
-                 MetaGpuKms          *gpu_kms,
-                 GError             **error)
+find_egl_device (MetaRendererNative *renderer_native,
+                 MetaGpuKms         *gpu_kms,
+                 GError            **error)
 {
   MetaEgl *egl = meta_renderer_native_get_egl (renderer_native);
   char **missing_extensions;
@@ -3262,14 +3292,15 @@ find_egl_device (MetaRendererNative  *renderer_native,
 }
 
 static EGLDisplay
-get_egl_device_display (MetaRendererNative  *renderer_native,
-                        MetaGpuKms          *gpu_kms,
-                        EGLDeviceEXT         egl_device,
-                        GError             **error)
+get_egl_device_display (MetaRendererNative *renderer_native,
+                        MetaGpuKms         *gpu_kms,
+                        EGLDeviceEXT        egl_device,
+                        GError            **error)
 {
   MetaEgl *egl = meta_renderer_native_get_egl (renderer_native);
   int kms_fd = meta_gpu_kms_get_fd (gpu_kms);
-  EGLint platform_attribs[] = {
+  EGLint platform_attribs[] =
+  {
     EGL_DRM_MASTER_FD_EXT, kms_fd,
     EGL_NONE
   };
@@ -3281,9 +3312,9 @@ get_egl_device_display (MetaRendererNative  *renderer_native,
 }
 
 static MetaRendererNativeGpuData *
-create_renderer_gpu_data_egl_device (MetaRendererNative  *renderer_native,
-                                     MetaGpuKms          *gpu_kms,
-                                     GError             **error)
+create_renderer_gpu_data_egl_device (MetaRendererNative *renderer_native,
+                                     MetaGpuKms         *gpu_kms,
+                                     GError            **error)
 {
   MetaMonitorManagerKms *monitor_manager_kms =
     renderer_native->monitor_manager_kms;
@@ -3294,7 +3325,7 @@ create_renderer_gpu_data_egl_device (MetaRendererNative  *renderer_native,
   EGLDisplay egl_display;
   MetaRendererNativeGpuData *renderer_gpu_data;
 
-  if (!meta_is_stage_views_enabled())
+  if (!meta_is_stage_views_enabled ())
     {
       g_set_error (error, G_IO_ERROR,
                    G_IO_ERROR_FAILED,
@@ -3358,9 +3389,10 @@ create_renderer_gpu_data_egl_device (MetaRendererNative  *renderer_native,
 #endif /* HAVE_EGL_DEVICE */
 
 static MetaRendererNativeGpuData *
-meta_renderer_native_create_renderer_gpu_data (MetaRendererNative  *renderer_native,
-                                               MetaGpuKms          *gpu_kms,
-                                               GError             **error)
+meta_renderer_native_create_renderer_gpu_data (
+  MetaRendererNative *renderer_native,
+  MetaGpuKms         *gpu_kms,
+  GError            **error)
 {
   MetaRendererNativeGpuData *renderer_gpu_data;
   GError *gbm_error = NULL;
@@ -3403,7 +3435,7 @@ meta_renderer_native_create_renderer_gpu_data (MetaRendererNative  *renderer_nat
 #ifdef HAVE_EGL_DEVICE
                , egl_device_error->message
 #endif
-  );
+               );
 
   g_error_free (gbm_error);
 #ifdef HAVE_EGL_DEVICE
@@ -3414,9 +3446,9 @@ meta_renderer_native_create_renderer_gpu_data (MetaRendererNative  *renderer_nat
 }
 
 static gboolean
-meta_renderer_native_initable_init (GInitable     *initable,
-                                    GCancellable  *cancellable,
-                                    GError       **error)
+meta_renderer_native_initable_init (GInitable    *initable,
+                                    GCancellable *cancellable,
+                                    GError      **error)
 {
   MetaRendererNative *renderer_native = META_RENDERER_NATIVE (initable);
   MetaMonitorManagerKms *monitor_manager_kms =
@@ -3500,7 +3532,8 @@ meta_renderer_native_class_init (MetaRendererNativeClass *klass)
   object_class->finalize = meta_renderer_native_finalize;
   object_class->constructed = meta_renderer_native_constructed;
 
-  renderer_class->create_cogl_renderer = meta_renderer_native_create_cogl_renderer;
+  renderer_class->create_cogl_renderer =
+    meta_renderer_native_create_cogl_renderer;
   renderer_class->create_view = meta_renderer_native_create_view;
 
   obj_props[PROP_MONITOR_MANAGER] =
diff --git a/src/backends/native/meta-stage-native.c b/src/backends/native/meta-stage-native.c
index 2463781dc..94e6b79d0 100644
--- a/src/backends/native/meta-stage-native.c
+++ b/src/backends/native/meta-stage-native.c
@@ -32,7 +32,7 @@
 #include "meta/meta-monitor-manager.h"
 #include "meta/util.h"
 
-static GQuark quark_view_frame_closure  = 0;
+static GQuark quark_view_frame_closure = 0;
 
 struct _MetaStageNative
 {
diff --git a/src/backends/x11/cm/meta-backend-x11-cm.c b/src/backends/x11/cm/meta-backend-x11-cm.c
index 1e377220b..374608cf9 100644
--- a/src/backends/x11/cm/meta-backend-x11-cm.c
+++ b/src/backends/x11/cm/meta-backend-x11-cm.c
@@ -53,7 +53,10 @@ take_touch_grab (MetaBackend *backend)
   MetaBackendX11 *x11 = META_BACKEND_X11 (backend);
   Display *xdisplay = meta_backend_x11_get_xdisplay (x11);
   unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
-  XIEventMask mask = { META_VIRTUAL_CORE_POINTER_ID, sizeof (mask_bits), mask_bits };
+  XIEventMask mask =
+  {
+    META_VIRTUAL_CORE_POINTER_ID, sizeof (mask_bits), mask_bits
+  };
   XIGrabModifiers mods = { XIAnyModifier, 0 };
 
   XISetMask (mask.mask, XI_TouchBegin);
@@ -154,12 +157,12 @@ meta_backend_x11_cm_select_stage_events (MetaBackend *backend)
 }
 
 static void
-get_xkbrf_var_defs (Display           *xdisplay,
-                    const char        *layouts,
-                    const char        *variants,
-                    const char        *options,
-                    char             **rules_p,
-                    XkbRF_VarDefsRec  *var_defs)
+get_xkbrf_var_defs (Display          *xdisplay,
+                    const char       *layouts,
+                    const char       *variants,
+                    const char       *options,
+                    char            **rules_p,
+                    XkbRF_VarDefsRec *var_defs)
 {
   char *rules = NULL;
 
@@ -182,7 +185,7 @@ get_xkbrf_var_defs (Display           *xdisplay,
   var_defs->options = strdup (options);
 
   /* Sometimes, the property is a file path, and sometimes it's
-     not. Normalize it so it's always a file path. */
+   *  not. Normalize it so it's always a file path. */
   if (rules[0] == '/')
     *rules_p = g_strdup (rules);
   else
@@ -270,7 +273,8 @@ apply_keymap (MetaBackendX11 *x11)
       XkbComponentNamesRec xkb_comp_names = { 0 };
 
       XkbRF_GetComponents (xkb_rules, &xkb_var_defs, &xkb_comp_names);
-      upload_xkb_description (xdisplay, rules_file_path, &xkb_var_defs, &xkb_comp_names);
+      upload_xkb_description (xdisplay, rules_file_path, &xkb_var_defs,
+                              &xkb_comp_names);
 
       free_xkb_component_names (&xkb_comp_names);
       XkbRF_Free (xkb_rules, True);
@@ -399,16 +403,21 @@ meta_backend_x11_cm_class_init (MetaBackendX11CmClass *klass)
 
   backend_class->post_init = meta_backend_x11_cm_post_init;
   backend_class->create_renderer = meta_backend_x11_cm_create_renderer;
-  backend_class->create_monitor_manager = meta_backend_x11_cm_create_monitor_manager;
-  backend_class->create_cursor_renderer = meta_backend_x11_cm_create_cursor_renderer;
-  backend_class->create_input_settings = meta_backend_x11_cm_create_input_settings;
+  backend_class->create_monitor_manager =
+    meta_backend_x11_cm_create_monitor_manager;
+  backend_class->create_cursor_renderer =
+    meta_backend_x11_cm_create_cursor_renderer;
+  backend_class->create_input_settings =
+    meta_backend_x11_cm_create_input_settings;
   backend_class->update_screen_size = meta_backend_x11_cm_update_screen_size;
   backend_class->select_stage_events = meta_backend_x11_cm_select_stage_events;
   backend_class->lock_layout_group = meta_backend_x11_cm_lock_layout_group;
   backend_class->set_keymap = meta_backend_x11_cm_set_keymap;
 
-  backend_x11_class->handle_host_xevent = meta_backend_x11_cm_handle_host_xevent;
-  backend_x11_class->translate_device_event = meta_backend_x11_cm_translate_device_event;
-  backend_x11_class->translate_crossing_event = meta_backend_x11_cm_translate_crossing_event;
+  backend_x11_class->handle_host_xevent =
+    meta_backend_x11_cm_handle_host_xevent;
+  backend_x11_class->translate_device_event =
+    meta_backend_x11_cm_translate_device_event;
+  backend_x11_class->translate_crossing_event =
+    meta_backend_x11_cm_translate_crossing_event;
 }
-
diff --git a/src/backends/x11/cm/meta-cursor-sprite-xfixes.c b/src/backends/x11/cm/meta-cursor-sprite-xfixes.c
index 0c524668e..be98c5b6e 100644
--- a/src/backends/x11/cm/meta-cursor-sprite-xfixes.c
+++ b/src/backends/x11/cm/meta-cursor-sprite-xfixes.c
@@ -102,8 +102,8 @@ meta_cursor_sprite_xfixes_set_property (GObject      *object,
 }
 
 MetaCursorSpriteXfixes *
-meta_cursor_sprite_xfixes_new (MetaDisplay  *display,
-                               GError      **error)
+meta_cursor_sprite_xfixes_new (MetaDisplay *display,
+                               GError     **error)
 {
   return g_initable_new (META_TYPE_CURSOR_SPRITE_XFIXES,
                          NULL, error,
@@ -112,9 +112,9 @@ meta_cursor_sprite_xfixes_new (MetaDisplay  *display,
 }
 
 static gboolean
-meta_cursor_sprite_xfixes_initable_init (GInitable     *initable,
-                                         GCancellable  *cancellable,
-                                         GError       **error)
+meta_cursor_sprite_xfixes_initable_init (GInitable    *initable,
+                                         GCancellable *cancellable,
+                                         GError      **error)
 {
   MetaCursorSpriteXfixes *sprite_xfixes =
     META_CURSOR_SPRITE_XFIXES (initable);
@@ -172,12 +172,12 @@ meta_cursor_sprite_xfixes_initable_init (GInitable     *initable,
   clutter_backend = clutter_get_default_backend ();
   cogl_context = clutter_backend_get_cogl_context (clutter_backend);
   texture = cogl_texture_2d_new_from_data (cogl_context,
-                                          cursor_image->width,
-                                          cursor_image->height,
-                                          CLUTTER_CAIRO_FORMAT_ARGB32,
-                                          cursor_image->width * 4, /* stride */
-                                          cursor_data,
-                                          error);
+                                           cursor_image->width,
+                                           cursor_image->height,
+                                           CLUTTER_CAIRO_FORMAT_ARGB32,
+                                           cursor_image->width * 4, /* stride */
+                                           cursor_data,
+                                           error);
 
   if (free_cursor_data)
     g_free (cursor_data);
diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c
index 99cc6180c..425aee3f0 100644
--- a/src/backends/x11/meta-backend-x11.c
+++ b/src/backends/x11/meta-backend-x11.c
@@ -329,7 +329,8 @@ handle_host_xevent (MetaBackend *backend,
         if (meta_plugin_manager_xevent_filter (compositor->plugin_mgr, event))
           bypass_clutter = TRUE;
 
-        if (meta_dnd_handle_xdnd_event (backend, compositor, priv->xdisplay, event))
+        if (meta_dnd_handle_xdnd_event (backend, compositor, priv->xdisplay,
+                                        event))
           bypass_clutter = TRUE;
       }
   }
@@ -383,7 +384,8 @@ handle_host_xevent (MetaBackend *backend,
   XFreeEventData (priv->xdisplay, &event->xcookie);
 }
 
-typedef struct {
+typedef struct
+{
   GSource base;
   GPollFD event_poll_fd;
   MetaBackend *backend;
@@ -415,9 +417,9 @@ x_event_source_check (GSource *source)
 }
 
 static gboolean
-x_event_source_dispatch (GSource     *source,
-                         GSourceFunc  callback,
-                         gpointer     user_data)
+x_event_source_dispatch (GSource    *source,
+                         GSourceFunc callback,
+                         gpointer    user_data)
 {
   XEventSource *x_source = (XEventSource *) source;
   MetaBackend *backend = x_source->backend;
@@ -436,7 +438,8 @@ x_event_source_dispatch (GSource     *source,
   return TRUE;
 }
 
-static GSourceFuncs x_event_funcs = {
+static GSourceFuncs x_event_funcs =
+{
   x_event_source_prepare,
   x_event_source_check,
   x_event_source_dispatch,
@@ -482,7 +485,8 @@ meta_backend_x11_post_init (MetaBackend *backend)
 
   priv->source = x_event_source_new (backend);
 
-  if (!XSyncQueryExtension (priv->xdisplay, &priv->xsync_event_base, &priv->xsync_error_base) ||
+  if (!XSyncQueryExtension (priv->xdisplay, &priv->xsync_event_base,
+                            &priv->xsync_error_base) ||
       !XSyncInitialize (priv->xdisplay, &major, &minor))
     meta_fatal ("Could not initialize XSync");
 
@@ -498,7 +502,8 @@ meta_backend_x11_post_init (MetaBackend *backend)
                        &priv->xinput_error_base,
                        &priv->xinput_event_base))
     {
-      major = 2; minor = 3;
+      major = 2;
+      minor = 3;
       if (XIQueryVersion (priv->xdisplay, &major, &minor) == Success)
         {
           int version = (major * 10) + minor;
@@ -508,7 +513,8 @@ meta_backend_x11_post_init (MetaBackend *backend)
     }
 
   if (!has_xi)
-    meta_fatal ("X server doesn't have the XInput extension, version 2.2 or newer\n");
+    meta_fatal (
+      "X server doesn't have the XInput extension, version 2.2 or newer\n");
 
   if (!xkb_x11_setup_xkb_extension (priv->xcb,
                                     XKB_X11_MIN_MAJOR_XKB_VERSION,
@@ -517,8 +523,9 @@ meta_backend_x11_post_init (MetaBackend *backend)
                                     NULL, NULL,
                                     &priv->xkb_event_base,
                                     &priv->xkb_error_base))
-    meta_fatal ("X server doesn't have the XKB extension, version %d.%d or newer\n",
-                XKB_X11_MIN_MAJOR_XKB_VERSION, XKB_X11_MIN_MINOR_XKB_VERSION);
+    meta_fatal (
+      "X server doesn't have the XKB extension, version %d.%d or newer\n",
+      XKB_X11_MIN_MAJOR_XKB_VERSION, XKB_X11_MIN_MINOR_XKB_VERSION);
 
   META_BACKEND_CLASS (meta_backend_x11_parent_class)->post_init (backend);
 
@@ -634,10 +641,12 @@ meta_backend_x11_get_keymap (MetaBackend *backend)
       struct xkb_context *context = xkb_context_new (XKB_CONTEXT_NO_FLAGS);
       priv->keymap = xkb_x11_keymap_new_from_device (context,
                                                      priv->xcb,
-                                                     xkb_x11_get_core_keyboard_device_id (priv->xcb),
+                                                     xkb_x11_get_core_keyboard_device_id (
+                                                       priv->xcb),
                                                      XKB_KEYMAP_COMPILE_NO_FLAGS);
       if (priv->keymap == NULL)
-        priv->keymap = xkb_keymap_new_from_names (context, NULL, XKB_KEYMAP_COMPILE_NO_FLAGS);
+        priv->keymap = xkb_keymap_new_from_names (context, NULL,
+                                                  XKB_KEYMAP_COMPILE_NO_FLAGS);
 
       xkb_context_unref (context);
     }
@@ -663,7 +672,7 @@ meta_backend_x11_set_numlock (MetaBackend *backend,
 
 void
 meta_backend_x11_handle_event (MetaBackendX11 *x11,
-                               XEvent      *xevent)
+                               XEvent         *xevent)
 {
   MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
 
@@ -762,14 +771,17 @@ meta_backend_x11_class_init (MetaBackendX11Class *klass)
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
   object_class->finalize = meta_backend_x11_finalize;
-  backend_class->create_clutter_backend = meta_backend_x11_create_clutter_backend;
+  backend_class->create_clutter_backend =
+    meta_backend_x11_create_clutter_backend;
   backend_class->post_init = meta_backend_x11_post_init;
   backend_class->grab_device = meta_backend_x11_grab_device;
   backend_class->ungrab_device = meta_backend_x11_ungrab_device;
   backend_class->warp_pointer = meta_backend_x11_warp_pointer;
-  backend_class->get_current_logical_monitor = meta_backend_x11_get_current_logical_monitor;
+  backend_class->get_current_logical_monitor =
+    meta_backend_x11_get_current_logical_monitor;
   backend_class->get_keymap = meta_backend_x11_get_keymap;
-  backend_class->get_keymap_layout_group = meta_backend_x11_get_keymap_layout_group;
+  backend_class->get_keymap_layout_group =
+    meta_backend_x11_get_keymap_layout_group;
   backend_class->set_numlock = meta_backend_x11_set_numlock;
 }
 
@@ -780,7 +792,7 @@ meta_backend_x11_init (MetaBackendX11 *x11)
    * in Cogl - see meta_renderer_x11_create_cogl_renderer(). We call it here
    * to hopefully call it before any other use of XLib.
    */
-  XInitThreads();
+  XInitThreads ();
 
   /* We do X11 event retrieval ourselves */
   clutter_x11_disable_event_retrieval ();
diff --git a/src/backends/x11/meta-clutter-backend-x11.c b/src/backends/x11/meta-clutter-backend-x11.c
index 56485ba9f..ba282b9da 100644
--- a/src/backends/x11/meta-clutter-backend-x11.c
+++ b/src/backends/x11/meta-clutter-backend-x11.c
@@ -44,8 +44,8 @@ G_DEFINE_TYPE (MetaClutterBackendX11, meta_clutter_backend_x11,
                CLUTTER_TYPE_BACKEND_X11)
 
 static CoglRenderer *
-meta_clutter_backend_x11_get_renderer (ClutterBackend  *clutter_backend,
-                                       GError         **error)
+meta_clutter_backend_x11_get_renderer (ClutterBackend * clutter_backend,
+                                       GError * *error)
 {
   MetaBackend *backend = meta_get_backend ();
   MetaRenderer *renderer = meta_backend_get_renderer (backend);
@@ -54,9 +54,9 @@ meta_clutter_backend_x11_get_renderer (ClutterBackend  *clutter_backend,
 }
 
 static ClutterStageWindow *
-meta_clutter_backend_x11_create_stage (ClutterBackend  *backend,
-                                       ClutterStage    *wrapper,
-                                       GError         **error)
+meta_clutter_backend_x11_create_stage (ClutterBackend *backend,
+                                       ClutterStage   *wrapper,
+                                       GError        **error)
 {
   ClutterEventTranslator *translator;
   ClutterStageWindow *stage;
@@ -65,12 +65,12 @@ meta_clutter_backend_x11_create_stage (ClutterBackend  *backend,
   if (meta_is_wayland_compositor ())
     stage_type = META_TYPE_STAGE_X11_NESTED;
   else
-    stage_type  = CLUTTER_TYPE_STAGE_X11;
+    stage_type = CLUTTER_TYPE_STAGE_X11;
 
   stage = g_object_new (stage_type,
-                       "backend", backend,
-                       "wrapper", wrapper,
-                       NULL);
+                        "backend", backend,
+                        "wrapper", wrapper,
+                        NULL);
 
   /* the X11 stage does event translation */
   translator = CLUTTER_EVENT_TRANSLATOR (stage);
@@ -80,7 +80,7 @@ meta_clutter_backend_x11_create_stage (ClutterBackend  *backend,
 }
 
 static void
-meta_clutter_backend_x11_bell_notify (ClutterBackend  *backend)
+meta_clutter_backend_x11_bell_notify (ClutterBackend *backend)
 {
   MetaDisplay *display = meta_get_display ();
 
diff --git a/src/backends/x11/meta-crtc-xrandr.c b/src/backends/x11/meta-crtc-xrandr.c
index d201b8581..b14856bdb 100644
--- a/src/backends/x11/meta-crtc-xrandr.c
+++ b/src/backends/x11/meta-crtc-xrandr.c
@@ -103,7 +103,8 @@ meta_crtc_xrandr_set_config (MetaCrtc            *crtc,
 static MetaMonitorTransform
 meta_monitor_transform_from_xrandr (Rotation rotation)
 {
-  static const MetaMonitorTransform y_reflected_map[4] = {
+  static const MetaMonitorTransform y_reflected_map[4] =
+  {
     META_MONITOR_TRANSFORM_FLIPPED_180,
     META_MONITOR_TRANSFORM_FLIPPED_90,
     META_MONITOR_TRANSFORM_FLIPPED,
@@ -136,7 +137,8 @@ meta_monitor_transform_from_xrandr (Rotation rotation)
     return ret;
 }
 
-#define ALL_ROTATIONS (RR_Rotate_0 | RR_Rotate_90 | RR_Rotate_180 | RR_Rotate_270)
+#define ALL_ROTATIONS (RR_Rotate_0 | RR_Rotate_90 | RR_Rotate_180 | \
+                       RR_Rotate_270)
 
 static MetaMonitorTransform
 meta_monitor_transform_from_xrandr_all (Rotation rotation)
diff --git a/src/backends/x11/meta-cursor-renderer-x11.c b/src/backends/x11/meta-cursor-renderer-x11.c
index 1f198c130..465ee6baf 100644
--- a/src/backends/x11/meta-cursor-renderer-x11.c
+++ b/src/backends/x11/meta-cursor-renderer-x11.c
@@ -38,14 +38,16 @@ struct _MetaCursorRendererX11Private
 };
 typedef struct _MetaCursorRendererX11Private MetaCursorRendererX11Private;
 
-G_DEFINE_TYPE_WITH_PRIVATE (MetaCursorRendererX11, meta_cursor_renderer_x11, META_TYPE_CURSOR_RENDERER);
+G_DEFINE_TYPE_WITH_PRIVATE (MetaCursorRendererX11, meta_cursor_renderer_x11,
+                            META_TYPE_CURSOR_RENDERER);
 
 static gboolean
 meta_cursor_renderer_x11_update_cursor (MetaCursorRenderer *renderer,
                                         MetaCursorSprite   *cursor_sprite)
 {
   MetaCursorRendererX11 *x11 = META_CURSOR_RENDERER_X11 (renderer);
-  MetaCursorRendererX11Private *priv = meta_cursor_renderer_x11_get_instance_private (x11);
+  MetaCursorRendererX11Private *priv =
+    meta_cursor_renderer_x11_get_instance_private (x11);
 
   MetaBackendX11 *backend = META_BACKEND_X11 (meta_get_backend ());
   Window xwindow = meta_backend_x11_get_xwindow (backend);
@@ -107,7 +109,8 @@ meta_cursor_renderer_x11_class_init (MetaCursorRendererX11Class *klass)
 static void
 meta_cursor_renderer_x11_init (MetaCursorRendererX11 *x11)
 {
-  MetaCursorRendererX11Private *priv = meta_cursor_renderer_x11_get_instance_private (x11);
+  MetaCursorRendererX11Private *priv =
+    meta_cursor_renderer_x11_get_instance_private (x11);
 
   /* XFixes has no way to retrieve the current cursor visibility. */
   priv->server_cursor_visible = TRUE;
diff --git a/src/backends/x11/meta-gpu-xrandr.c b/src/backends/x11/meta-gpu-xrandr.c
index 14b46d530..9dcdddf63 100644
--- a/src/backends/x11/meta-gpu-xrandr.c
+++ b/src/backends/x11/meta-gpu-xrandr.c
@@ -49,7 +49,7 @@ struct _MetaGpuXrandr
 G_DEFINE_TYPE (MetaGpuXrandr, meta_gpu_xrandr, META_TYPE_GPU)
 
 XRRScreenResources *
-meta_gpu_xrandr_get_resources (MetaGpuXrandr *gpu_xrandr)
+meta_gpu_xrandr_get_resources (MetaGpuXrandr * gpu_xrandr)
 {
   return gpu_xrandr->resources;
 }
@@ -82,8 +82,8 @@ get_xmode_name (XRRModeInfo *xmode)
 }
 
 static gboolean
-meta_gpu_xrandr_read_current (MetaGpu  *gpu,
-                              GError  **error)
+meta_gpu_xrandr_read_current (MetaGpu *gpu,
+                              GError **error)
 {
   MetaGpuXrandr *gpu_xrandr = META_GPU_XRANDR (gpu);
   MetaMonitorManager *monitor_manager = meta_gpu_get_monitor_manager (gpu);
@@ -163,7 +163,7 @@ meta_gpu_xrandr_read_current (MetaGpu  *gpu,
   modes = NULL;
   crtcs = NULL;
 
-  for (i = 0; i < (unsigned)resources->nmode; i++)
+  for (i = 0; i < (unsigned) resources->nmode; i++)
     {
       XRRModeInfo *xmode = &resources->modes[i];
       MetaCrtcMode *mode;
@@ -174,7 +174,7 @@ meta_gpu_xrandr_read_current (MetaGpu  *gpu,
       mode->width = xmode->width;
       mode->height = xmode->height;
       mode->refresh_rate = (xmode->dotClock /
-                            ((float)xmode->hTotal * xmode->vTotal));
+                            ((float) xmode->hTotal * xmode->vTotal));
       mode->flags = xmode->modeFlags;
       mode->name = get_xmode_name (xmode);
 
@@ -182,7 +182,7 @@ meta_gpu_xrandr_read_current (MetaGpu  *gpu,
     }
   meta_gpu_take_modes (gpu, modes);
 
-  for (i = 0; i < (unsigned)resources->ncrtc; i++)
+  for (i = 0; i < (unsigned) resources->ncrtc; i++)
     {
       XRRCrtcInfo *xrandr_crtc;
       RRCrtc crtc_id;
@@ -203,7 +203,7 @@ meta_gpu_xrandr_read_current (MetaGpu  *gpu,
   primary_output = XRRGetOutputPrimary (xdisplay,
                                         DefaultRootWindow (xdisplay));
 
-  for (i = 0; i < (unsigned)resources->noutput; i++)
+  for (i = 0; i < (unsigned) resources->noutput; i++)
     {
       RROutput output_id;
       XRROutputInfo *xrandr_output;
diff --git a/src/backends/x11/meta-input-settings-x11.c b/src/backends/x11/meta-input-settings-x11.c
index 2968ac859..1f69c152e 100644
--- a/src/backends/x11/meta-input-settings-x11.c
+++ b/src/backends/x11/meta-input-settings-x11.c
@@ -50,7 +50,8 @@ typedef struct _MetaInputSettingsX11Private
 G_DEFINE_TYPE_WITH_PRIVATE (MetaInputSettingsX11, meta_input_settings_x11,
                             META_TYPE_INPUT_SETTINGS)
 
-enum {
+enum
+{
   SCROLL_METHOD_FIELD_2FG,
   SCROLL_METHOD_FIELD_EDGE,
   SCROLL_METHOD_FIELD_BUTTON,
@@ -62,7 +63,8 @@ device_free_xdevice (gpointer user_data)
 {
   MetaDisplay *display = meta_get_display ();
   MetaBackend *backend = meta_get_backend ();
-  Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
+  Display *xdisplay =
+    meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
   XDevice *xdev = user_data;
 
   meta_x11_error_trap_push (display->x11_display);
@@ -75,7 +77,8 @@ device_ensure_xdevice (ClutterInputDevice *device)
 {
   MetaDisplay *display = meta_get_display ();
   MetaBackend *backend = meta_get_backend ();
-  Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
+  Display *xdisplay =
+    meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
   int device_id = clutter_input_device_get_device_id (device);
   XDevice *xdev = NULL;
 
@@ -105,7 +108,8 @@ get_property (ClutterInputDevice *device,
               gulong              nitems)
 {
   MetaBackend *backend = meta_get_backend ();
-  Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
+  Display *xdisplay =
+    meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
   gulong nitems_ret, bytes_after_ret;
   int rc, device_id, format_ret;
   Atom property_atom, type_ret;
@@ -120,11 +124,14 @@ get_property (ClutterInputDevice *device,
   rc = XIGetProperty (xdisplay, device_id, property_atom,
                       0, 10, False, type, &type_ret, &format_ret,
                       &nitems_ret, &bytes_after_ret, &data_ret);
-  if (rc == Success && type_ret == type && format_ret == format && nitems_ret >= nitems)
+  if (rc == Success && type_ret == type && format_ret == format &&
+      nitems_ret >= nitems)
     {
       if (nitems_ret > nitems)
-        g_warning ("Property '%s' for device '%s' returned %lu items, expected %lu",
-                   property, clutter_input_device_get_device_name (device), nitems_ret, nitems);
+        g_warning (
+          "Property '%s' for device '%s' returned %lu items, expected %lu",
+          property, clutter_input_device_get_device_name (
+            device), nitems_ret, nitems);
       return data_ret;
     }
 
@@ -141,7 +148,8 @@ change_property (ClutterInputDevice *device,
                  gulong              nitems)
 {
   MetaBackend *backend = meta_get_backend ();
-  Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
+  Display *xdisplay =
+    meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
   int device_id;
   Atom property_atom;
   guchar *data_ret;
@@ -162,9 +170,9 @@ change_property (ClutterInputDevice *device,
 }
 
 static void
-meta_input_settings_x11_set_send_events (MetaInputSettings        *settings,
-                                         ClutterInputDevice       *device,
-                                         GDesktopDeviceSendEvents  mode)
+meta_input_settings_x11_set_send_events (MetaInputSettings       *settings,
+                                         ClutterInputDevice      *device,
+                                         GDesktopDeviceSendEvents mode)
 {
   guchar values[2] = { 0 }; /* disabled, disabled-on-external-mouse */
   guchar *available;
@@ -202,10 +210,14 @@ meta_input_settings_x11_set_matrix (MetaInputSettings  *settings,
                                     gfloat              matrix[6])
 {
   MetaBackend *backend = meta_get_backend ();
-  Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
-  gfloat full_matrix[9] = { matrix[0], matrix[1], matrix[2],
-                            matrix[3], matrix[4], matrix[5],
-                            0, 0, 1 };
+  Display *xdisplay =
+    meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
+  gfloat full_matrix[9] =
+  {
+    matrix[0], matrix[1], matrix[2],
+    matrix[3], matrix[4], matrix[5],
+    0, 0, 1
+  };
 
   change_property (device, "Coordinate Transformation Matrix",
                    XInternAtom (xdisplay, "FLOAT", False),
@@ -218,7 +230,8 @@ meta_input_settings_x11_set_speed (MetaInputSettings  *settings,
                                    gdouble             speed)
 {
   MetaBackend *backend = meta_get_backend ();
-  Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
+  Display *xdisplay =
+    meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
   gfloat value = speed;
 
   change_property (device, "libinput Accel Speed",
@@ -297,11 +310,12 @@ meta_input_settings_x11_set_invert_scroll (MetaInputSettings  *settings,
 }
 
 static void
-meta_input_settings_x11_set_edge_scroll (MetaInputSettings            *settings,
-                                         ClutterInputDevice           *device,
-                                         gboolean                      edge_scroll_enabled)
+meta_input_settings_x11_set_edge_scroll (MetaInputSettings  *settings,
+                                         ClutterInputDevice *device,
+                                         gboolean            edge_scroll_enabled)
 {
-  guchar values[SCROLL_METHOD_NUM_FIELDS] = { 0 }; /* 2fg, edge, button. The last value is unused */
+  guchar values[SCROLL_METHOD_NUM_FIELDS] = { 0 }; /* 2fg, edge, button. The
+                                                    * last value is unused */
   guchar *current = NULL;
   guchar *available = NULL;
 
@@ -320,17 +334,18 @@ meta_input_settings_x11_set_edge_scroll (MetaInputSettings            *settings,
   values[SCROLL_METHOD_FIELD_EDGE] = !!edge_scroll_enabled;
   change_property (device, "libinput Scroll Method Enabled",
                    XA_INTEGER, 8, &values, SCROLL_METHOD_NUM_FIELDS);
- out:
+out:
   meta_XFree (current);
   meta_XFree (available);
 }
 
 static void
-meta_input_settings_x11_set_two_finger_scroll (MetaInputSettings            *settings,
-                                               ClutterInputDevice           *device,
-                                               gboolean                      two_finger_scroll_enabled)
+meta_input_settings_x11_set_two_finger_scroll (MetaInputSettings  *settings,
+                                               ClutterInputDevice *device,
+                                               gboolean            two_finger_scroll_enabled)
 {
-  guchar values[SCROLL_METHOD_NUM_FIELDS] = { 0 }; /* 2fg, edge, button. The last value is unused */
+  guchar values[SCROLL_METHOD_NUM_FIELDS] = { 0 }; /* 2fg, edge, button. The
+                                                    * last value is unused */
   guchar *current = NULL;
   guchar *available = NULL;
 
@@ -349,7 +364,7 @@ meta_input_settings_x11_set_two_finger_scroll (MetaInputSettings            *set
   values[SCROLL_METHOD_FIELD_2FG] = !!two_finger_scroll_enabled;
   change_property (device, "libinput Scroll Method Enabled",
                    XA_INTEGER, 8, &values, SCROLL_METHOD_NUM_FIELDS);
- out:
+out:
   meta_XFree (current);
   meta_XFree (available);
 }
@@ -380,9 +395,9 @@ meta_input_settings_x11_set_scroll_button (MetaInputSettings  *settings,
 }
 
 static void
-meta_input_settings_x11_set_click_method (MetaInputSettings           *settings,
-                                          ClutterInputDevice          *device,
-                                          GDesktopTouchpadClickMethod  mode)
+meta_input_settings_x11_set_click_method (MetaInputSettings          *settings,
+                                          ClutterInputDevice         *device,
+                                          GDesktopTouchpadClickMethod mode)
 {
   guchar values[2] = { 0 }; /* buttonareas, clickfinger */
   guchar *defaults, *available;
@@ -413,7 +428,7 @@ meta_input_settings_x11_set_click_method (MetaInputSettings           *settings,
     default:
       g_assert_not_reached ();
       return;
-  }
+    }
 
   if ((values[0] && !available[0]) || (values[1] && !available[1]))
     g_warning ("Device '%s' does not support click method %d\n",
@@ -422,7 +437,7 @@ meta_input_settings_x11_set_click_method (MetaInputSettings           *settings,
     change_property (device, "libinput Click Method Enabled",
                      XA_INTEGER, 8, &values, 2);
 
-  meta_XFree(available);
+  meta_XFree (available);
 }
 
 static void
@@ -432,7 +447,8 @@ meta_input_settings_x11_set_keyboard_repeat (MetaInputSettings *settings,
                                              guint              interval)
 {
   MetaBackend *backend = meta_get_backend ();
-  Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
+  Display *xdisplay =
+    meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
 
   if (enabled)
     {
@@ -521,7 +537,7 @@ set_device_accel_profile (ClutterInputDevice         *device,
     return;
 
   available = get_property (device, "libinput Accel Profiles Available",
-                           XA_INTEGER, 8, 2);
+                            XA_INTEGER, 8, 2);
   if (!available)
     goto err_available;
 
@@ -553,9 +569,10 @@ err_available:
 }
 
 static void
-meta_input_settings_x11_set_mouse_accel_profile (MetaInputSettings          *settings,
-                                                 ClutterInputDevice         *device,
-                                                 GDesktopPointerAccelProfile profile)
+meta_input_settings_x11_set_mouse_accel_profile (
+  MetaInputSettings          *settings,
+  ClutterInputDevice         *device,
+  GDesktopPointerAccelProfile profile)
 {
   if (!is_mouse (settings, device))
     return;
@@ -564,9 +581,10 @@ meta_input_settings_x11_set_mouse_accel_profile (MetaInputSettings          *set
 }
 
 static void
-meta_input_settings_x11_set_trackball_accel_profile (MetaInputSettings          *settings,
-                                                     ClutterInputDevice         *device,
-                                                     GDesktopPointerAccelProfile profile)
+meta_input_settings_x11_set_trackball_accel_profile (
+  MetaInputSettings          *settings,
+  ClutterInputDevice         *device,
+  GDesktopPointerAccelProfile profile)
 {
   if (!meta_input_settings_x11_is_trackball_device (settings, device))
     return;
@@ -575,13 +593,14 @@ meta_input_settings_x11_set_trackball_accel_profile (MetaInputSettings
 }
 
 static void
-meta_input_settings_x11_set_tablet_mapping (MetaInputSettings     *settings,
-                                            ClutterInputDevice    *device,
-                                            GDesktopTabletMapping  mapping)
+meta_input_settings_x11_set_tablet_mapping (MetaInputSettings    *settings,
+                                            ClutterInputDevice   *device,
+                                            GDesktopTabletMapping mapping)
 {
   MetaDisplay *display = meta_get_display ();
   MetaBackend *backend = meta_get_backend ();
-  Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
+  Display *xdisplay =
+    meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
   XDevice *xdev;
 
   if (!display)
@@ -607,8 +626,8 @@ meta_input_settings_x11_set_tablet_mapping (MetaInputSettings     *settings,
       ClutterInputDeviceMapping dev_mapping;
 
       dev_mapping = (mapping == G_DESKTOP_TABLET_MAPPING_ABSOLUTE) ?
-        CLUTTER_INPUT_DEVICE_MAPPING_ABSOLUTE :
-        CLUTTER_INPUT_DEVICE_MAPPING_RELATIVE;
+                    CLUTTER_INPUT_DEVICE_MAPPING_ABSOLUTE :
+                    CLUTTER_INPUT_DEVICE_MAPPING_RELATIVE;
       clutter_input_device_set_mapping_mode (device, dev_mapping);
     }
 }
@@ -621,7 +640,8 @@ device_query_area (ClutterInputDevice *device,
                    gint               *height)
 {
   MetaBackend *backend = meta_get_backend ();
-  Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
+  Display *xdisplay =
+    meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
   gint device_id, n_devices, i;
   XIDeviceInfo *info;
   Atom abs_x, abs_y;
@@ -768,16 +788,18 @@ action_to_button (GDesktopStylusButtonAction action,
 }
 
 static void
-meta_input_settings_x11_set_stylus_button_map (MetaInputSettings          *settings,
-                                               ClutterInputDevice         *device,
-                                               ClutterInputDeviceTool     *tool,
-                                               GDesktopStylusButtonAction  primary,
-                                               GDesktopStylusButtonAction  secondary,
-                                               GDesktopStylusButtonAction  tertiary)
+meta_input_settings_x11_set_stylus_button_map (
+  MetaInputSettings         *settings,
+  ClutterInputDevice        *device,
+  ClutterInputDeviceTool    *tool,
+  GDesktopStylusButtonAction primary,
+  GDesktopStylusButtonAction secondary,
+  GDesktopStylusButtonAction tertiary)
 {
   MetaDisplay *display = meta_get_display ();
   MetaBackend *backend = meta_get_backend ();
-  Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
+  Display *xdisplay =
+    meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
   XDevice *xdev;
 
   if (!display)
@@ -788,7 +810,8 @@ meta_input_settings_x11_set_stylus_button_map (MetaInputSettings          *setti
   xdev = device_ensure_xdevice (device);
   if (xdev)
     {
-      guchar map[8] = {
+      guchar map[8] =
+      {
         CLUTTER_BUTTON_PRIMARY,
         action_to_button (primary, CLUTTER_BUTTON_MIDDLE),
         action_to_button (secondary, CLUTTER_BUTTON_SECONDARY),
@@ -825,36 +848,57 @@ static void
 meta_input_settings_x11_class_init (MetaInputSettingsX11Class *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  MetaInputSettingsClass *input_settings_class = META_INPUT_SETTINGS_CLASS (klass);
+  MetaInputSettingsClass *input_settings_class = META_INPUT_SETTINGS_CLASS (
+    klass);
 
   object_class->dispose = meta_input_settings_x11_dispose;
 
-  input_settings_class->set_send_events = meta_input_settings_x11_set_send_events;
+  input_settings_class->set_send_events =
+    meta_input_settings_x11_set_send_events;
   input_settings_class->set_matrix = meta_input_settings_x11_set_matrix;
   input_settings_class->set_speed = meta_input_settings_x11_set_speed;
-  input_settings_class->set_left_handed = meta_input_settings_x11_set_left_handed;
-  input_settings_class->set_tap_enabled = meta_input_settings_x11_set_tap_enabled;
-  input_settings_class->set_tap_and_drag_enabled = meta_input_settings_x11_set_tap_and_drag_enabled;
-  input_settings_class->set_disable_while_typing = meta_input_settings_x11_set_disable_while_typing;
-  input_settings_class->set_invert_scroll = meta_input_settings_x11_set_invert_scroll;
-  input_settings_class->set_edge_scroll = meta_input_settings_x11_set_edge_scroll;
-  input_settings_class->set_two_finger_scroll = meta_input_settings_x11_set_two_finger_scroll;
-  input_settings_class->set_scroll_button = meta_input_settings_x11_set_scroll_button;
-  input_settings_class->set_click_method = meta_input_settings_x11_set_click_method;
-  input_settings_class->set_keyboard_repeat = meta_input_settings_x11_set_keyboard_repeat;
-
-  input_settings_class->set_tablet_mapping = meta_input_settings_x11_set_tablet_mapping;
-  input_settings_class->set_tablet_keep_aspect = meta_input_settings_x11_set_tablet_keep_aspect;
-  input_settings_class->set_tablet_area = meta_input_settings_x11_set_tablet_area;
-
-  input_settings_class->set_mouse_accel_profile = meta_input_settings_x11_set_mouse_accel_profile;
-  input_settings_class->set_trackball_accel_profile = meta_input_settings_x11_set_trackball_accel_profile;
-
-  input_settings_class->set_stylus_pressure = meta_input_settings_x11_set_stylus_pressure;
-  input_settings_class->set_stylus_button_map = meta_input_settings_x11_set_stylus_button_map;
-
-  input_settings_class->has_two_finger_scroll = meta_input_settings_x11_has_two_finger_scroll;
-  input_settings_class->is_trackball_device = meta_input_settings_x11_is_trackball_device;
+  input_settings_class->set_left_handed =
+    meta_input_settings_x11_set_left_handed;
+  input_settings_class->set_tap_enabled =
+    meta_input_settings_x11_set_tap_enabled;
+  input_settings_class->set_tap_and_drag_enabled =
+    meta_input_settings_x11_set_tap_and_drag_enabled;
+  input_settings_class->set_disable_while_typing =
+    meta_input_settings_x11_set_disable_while_typing;
+  input_settings_class->set_invert_scroll =
+    meta_input_settings_x11_set_invert_scroll;
+  input_settings_class->set_edge_scroll =
+    meta_input_settings_x11_set_edge_scroll;
+  input_settings_class->set_two_finger_scroll =
+    meta_input_settings_x11_set_two_finger_scroll;
+  input_settings_class->set_scroll_button =
+    meta_input_settings_x11_set_scroll_button;
+  input_settings_class->set_click_method =
+    meta_input_settings_x11_set_click_method;
+  input_settings_class->set_keyboard_repeat =
+    meta_input_settings_x11_set_keyboard_repeat;
+
+  input_settings_class->set_tablet_mapping =
+    meta_input_settings_x11_set_tablet_mapping;
+  input_settings_class->set_tablet_keep_aspect =
+    meta_input_settings_x11_set_tablet_keep_aspect;
+  input_settings_class->set_tablet_area =
+    meta_input_settings_x11_set_tablet_area;
+
+  input_settings_class->set_mouse_accel_profile =
+    meta_input_settings_x11_set_mouse_accel_profile;
+  input_settings_class->set_trackball_accel_profile =
+    meta_input_settings_x11_set_trackball_accel_profile;
+
+  input_settings_class->set_stylus_pressure =
+    meta_input_settings_x11_set_stylus_pressure;
+  input_settings_class->set_stylus_button_map =
+    meta_input_settings_x11_set_stylus_button_map;
+
+  input_settings_class->has_two_finger_scroll =
+    meta_input_settings_x11_has_two_finger_scroll;
+  input_settings_class->is_trackball_device =
+    meta_input_settings_x11_is_trackball_device;
 }
 
 static void
diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c
index 21ee50e97..58f2e584d 100644
--- a/src/backends/x11/meta-monitor-manager-xrandr.c
+++ b/src/backends/x11/meta-monitor-manager-xrandr.c
@@ -81,7 +81,8 @@ struct _MetaMonitorManagerXrandrClass
   MetaMonitorManagerClass parent_class;
 };
 
-G_DEFINE_TYPE (MetaMonitorManagerXrandr, meta_monitor_manager_xrandr, META_TYPE_MONITOR_MANAGER);
+G_DEFINE_TYPE (MetaMonitorManagerXrandr, meta_monitor_manager_xrandr,
+               META_TYPE_MONITOR_MANAGER);
 
 typedef struct _MetaMonitorXrandrData
 {
@@ -91,13 +92,15 @@ typedef struct _MetaMonitorXrandrData
 GQuark quark_meta_monitor_xrandr_data;
 
 Display *
-meta_monitor_manager_xrandr_get_xdisplay (MetaMonitorManagerXrandr *manager_xrandr)
+meta_monitor_manager_xrandr_get_xdisplay (
+  MetaMonitorManagerXrandr *manager_xrandr)
 {
   return manager_xrandr->xdisplay;
 }
 
 gboolean
-meta_monitor_manager_xrandr_has_randr15 (MetaMonitorManagerXrandr *manager_xrandr)
+meta_monitor_manager_xrandr_has_randr15 (
+  MetaMonitorManagerXrandr *manager_xrandr)
 {
   return manager_xrandr->has_randr15;
 }
@@ -111,27 +114,29 @@ meta_monitor_manager_xrandr_read_edid (MetaMonitorManager *manager,
 
 static void
 meta_monitor_manager_xrandr_set_power_save_mode (MetaMonitorManager *manager,
-                                                MetaPowerSave       mode)
+                                                 MetaPowerSave       mode)
 {
-  MetaMonitorManagerXrandr *manager_xrandr = META_MONITOR_MANAGER_XRANDR (manager);
+  MetaMonitorManagerXrandr *manager_xrandr = META_MONITOR_MANAGER_XRANDR (
+    manager);
   CARD16 state;
 
-  switch (mode) {
-  case META_POWER_SAVE_ON:
-    state = DPMSModeOn;
-    break;
-  case META_POWER_SAVE_STANDBY:
-    state = DPMSModeStandby;
-    break;
-  case META_POWER_SAVE_SUSPEND:
-    state = DPMSModeSuspend;
-    break;
-  case META_POWER_SAVE_OFF:
-    state = DPMSModeOff;
-    break;
-  default:
-    return;
-  }
+  switch (mode)
+    {
+    case META_POWER_SAVE_ON:
+      state = DPMSModeOn;
+      break;
+    case META_POWER_SAVE_STANDBY:
+      state = DPMSModeStandby;
+      break;
+    case META_POWER_SAVE_SUSPEND:
+      state = DPMSModeSuspend;
+      break;
+    case META_POWER_SAVE_OFF:
+      state = DPMSModeOff;
+      break;
+    default:
+      return;
+    }
 
   DPMSForceLevel (manager_xrandr->xdisplay, state);
   DPMSSetTimeouts (manager_xrandr->xdisplay, 0, 0, 0);
@@ -219,7 +224,7 @@ is_crtc_assignment_changed (MetaCrtc      *crtc,
 
       for (j = 0; j < crtc_info->outputs->len; j++)
         {
-          MetaOutput *output = ((MetaOutput**) crtc_info->outputs->pdata)[j];
+          MetaOutput *output = ((MetaOutput **) crtc_info->outputs->pdata)[j];
           MetaCrtc *assigned_crtc;
 
           assigned_crtc = meta_output_get_assigned_crtc (output);
@@ -276,7 +281,7 @@ is_output_assignment_changed (MetaOutput      *output,
       for (j = 0; j < crtc_info->outputs->len; j++)
         {
           MetaOutput *crtc_info_output =
-            ((MetaOutput**) crtc_info->outputs->pdata)[j];
+            ((MetaOutput **) crtc_info->outputs->pdata)[j];
 
           if (crtc_info_output == output &&
               crtc_info->crtc == assigned_crtc)
@@ -329,7 +334,8 @@ apply_crtc_assignments (MetaMonitorManager *manager,
                         MetaOutputInfo    **outputs,
                         unsigned int        n_outputs)
 {
-  MetaMonitorManagerXrandr *manager_xrandr = META_MONITOR_MANAGER_XRANDR (manager);
+  MetaMonitorManagerXrandr *manager_xrandr = META_MONITOR_MANAGER_XRANDR (
+    manager);
   unsigned i;
   GList *l;
   int width, height, width_mm, height_mm;
@@ -337,7 +343,8 @@ apply_crtc_assignments (MetaMonitorManager *manager,
   XGrabServer (manager_xrandr->xdisplay);
 
   /* First compute the new size of the screen (framebuffer) */
-  width = 0; height = 0;
+  width = 0;
+  height = 0;
   for (i = 0; i < n_crtcs; i++)
     {
       MetaCrtcInfo *crtc_info = crtcs[i];
@@ -360,10 +367,10 @@ apply_crtc_assignments (MetaMonitorManager *manager,
     }
 
   /* Second disable all newly disabled CRTCs, or CRTCs that in the previous
-     configuration would be outside the new framebuffer (otherwise X complains
-     loudly when resizing)
-     CRTC will be enabled again after resizing the FB
-  */
+   *  configuration would be outside the new framebuffer (otherwise X complains
+   *  loudly when resizing)
+   *  CRTC will be enabled again after resizing the FB
+   */
   for (i = 0; i < n_crtcs; i++)
     {
       MetaCrtcInfo *crtc_info = crtcs[i];
@@ -428,7 +435,8 @@ apply_crtc_assignments (MetaMonitorManager *manager,
    */
   width_mm = (width / DPI_FALLBACK) * 25.4 + 0.5;
   height_mm = (height / DPI_FALLBACK) * 25.4 + 0.5;
-  XRRSetScreenSize (manager_xrandr->xdisplay, DefaultRootWindow (manager_xrandr->xdisplay),
+  XRRSetScreenSize (manager_xrandr->xdisplay,
+                    DefaultRootWindow (manager_xrandr->xdisplay),
                     width, height, width_mm, height_mm);
 
   for (i = 0; i < n_crtcs; i++)
@@ -452,7 +460,7 @@ apply_crtc_assignments (MetaMonitorManager *manager,
             {
               MetaOutput *output;
 
-              output = ((MetaOutput**)crtc_info->outputs->pdata)[j];
+              output = ((MetaOutput **) crtc_info->outputs->pdata)[j];
 
               output->is_dirty = TRUE;
               meta_output_assign_crtc (output, crtc);
@@ -471,10 +479,12 @@ apply_crtc_assignments (MetaMonitorManager *manager,
                                        rotation,
                                        output_ids, n_output_ids))
             {
-              meta_warning ("Configuring CRTC %d with mode %d (%d x %d @ %f) at position %d, %d and 
transform %u failed\n",
-                            (unsigned)(crtc->crtc_id), (unsigned)(mode->mode_id),
-                            mode->width, mode->height, (float)mode->refresh_rate,
-                            crtc_info->x, crtc_info->y, crtc_info->transform);
+              meta_warning (
+                "Configuring CRTC %d with mode %d (%d x %d @ %f) at position %d, %d and transform %u 
failed\n",
+                (unsigned) (crtc->crtc_id),
+                (unsigned) (mode->mode_id),
+                mode->width, mode->height, (float) mode->refresh_rate,
+                crtc_info->x, crtc_info->y, crtc_info->transform);
               continue;
             }
 
@@ -561,10 +571,11 @@ meta_monitor_manager_xrandr_rebuild_derived (MetaMonitorManager *manager,
 }
 
 static gboolean
-meta_monitor_manager_xrandr_apply_monitors_config (MetaMonitorManager      *manager,
-                                                   MetaMonitorsConfig      *config,
-                                                   MetaMonitorsConfigMethod method,
-                                                   GError                 **error)
+meta_monitor_manager_xrandr_apply_monitors_config (
+  MetaMonitorManager      *manager,
+  MetaMonitorsConfig      *config,
+  MetaMonitorsConfigMethod method,
+  GError                 **error)
 {
   GPtrArray *crtc_infos;
   GPtrArray *output_infos;
@@ -617,24 +628,25 @@ meta_monitor_manager_xrandr_apply_monitors_config (MetaMonitorManager      *mana
 
 static void
 meta_monitor_manager_xrandr_change_backlight (MetaMonitorManager *manager,
-                                             MetaOutput         *output,
-                                             gint                value)
+                                              MetaOutput         *output,
+                                              gint                value)
 {
   meta_output_xrandr_change_backlight (output, value);
 }
 
 static void
-meta_monitor_manager_xrandr_get_crtc_gamma (MetaMonitorManager  *manager,
-                                           MetaCrtc            *crtc,
-                                           gsize               *size,
-                                           unsigned short     **red,
-                                           unsigned short     **green,
-                                           unsigned short     **blue)
+meta_monitor_manager_xrandr_get_crtc_gamma (MetaMonitorManager *manager,
+                                            MetaCrtc           *crtc,
+                                            gsize              *size,
+                                            unsigned short    **red,
+                                            unsigned short    **green,
+                                            unsigned short    **blue)
 {
-  MetaMonitorManagerXrandr *manager_xrandr = META_MONITOR_MANAGER_XRANDR (manager);
+  MetaMonitorManagerXrandr *manager_xrandr = META_MONITOR_MANAGER_XRANDR (
+    manager);
   XRRCrtcGamma *gamma;
 
-  gamma = XRRGetCrtcGamma (manager_xrandr->xdisplay, (XID)crtc->crtc_id);
+  gamma = XRRGetCrtcGamma (manager_xrandr->xdisplay, (XID) crtc->crtc_id);
 
   *size = gamma->size;
   *red = g_memdup (gamma->red, sizeof (unsigned short) * gamma->size);
@@ -646,13 +658,14 @@ meta_monitor_manager_xrandr_get_crtc_gamma (MetaMonitorManager  *manager,
 
 static void
 meta_monitor_manager_xrandr_set_crtc_gamma (MetaMonitorManager *manager,
-                                           MetaCrtc           *crtc,
-                                           gsize               size,
-                                           unsigned short     *red,
-                                           unsigned short     *green,
-                                           unsigned short     *blue)
+                                            MetaCrtc           *crtc,
+                                            gsize               size,
+                                            unsigned short     *red,
+                                            unsigned short     *green,
+                                            unsigned short     *blue)
 {
-  MetaMonitorManagerXrandr *manager_xrandr = META_MONITOR_MANAGER_XRANDR (manager);
+  MetaMonitorManagerXrandr *manager_xrandr = META_MONITOR_MANAGER_XRANDR (
+    manager);
   XRRCrtcGamma *gamma;
 
   gamma = XRRAllocGamma (size);
@@ -660,7 +673,7 @@ meta_monitor_manager_xrandr_set_crtc_gamma (MetaMonitorManager *manager,
   memcpy (gamma->green, green, sizeof (unsigned short) * size);
   memcpy (gamma->blue, blue, sizeof (unsigned short) * size);
 
-  XRRSetCrtcGamma (manager_xrandr->xdisplay, (XID)crtc->crtc_id, gamma);
+  XRRSetCrtcGamma (manager_xrandr->xdisplay, (XID) crtc->crtc_id, gamma);
 
   XRRFreeGamma (gamma);
 }
@@ -685,8 +698,9 @@ meta_monitor_xrandr_data_from_monitor (MetaMonitor *monitor)
 }
 
 static void
-meta_monitor_manager_xrandr_increase_monitor_count (MetaMonitorManagerXrandr *manager_xrandr,
-                                                    Atom                      name_atom)
+meta_monitor_manager_xrandr_increase_monitor_count (
+  MetaMonitorManagerXrandr *manager_xrandr,
+  Atom                      name_atom)
 {
   int count;
 
@@ -701,8 +715,9 @@ meta_monitor_manager_xrandr_increase_monitor_count (MetaMonitorManagerXrandr *ma
 }
 
 static int
-meta_monitor_manager_xrandr_decrease_monitor_count (MetaMonitorManagerXrandr *manager_xrandr,
-                                                    Atom                      name_atom)
+meta_monitor_manager_xrandr_decrease_monitor_count (
+  MetaMonitorManagerXrandr *manager_xrandr,
+  Atom                      name_atom)
 {
   int count;
 
@@ -723,7 +738,8 @@ static void
 meta_monitor_manager_xrandr_tiled_monitor_added (MetaMonitorManager *manager,
                                                  MetaMonitor        *monitor)
 {
-  MetaMonitorManagerXrandr *manager_xrandr = META_MONITOR_MANAGER_XRANDR (manager);
+  MetaMonitorManagerXrandr *manager_xrandr = META_MONITOR_MANAGER_XRANDR (
+    manager);
   MetaMonitorTiled *monitor_tiled = META_MONITOR_TILED (monitor);
   const char *product;
   char *name;
@@ -778,7 +794,8 @@ static void
 meta_monitor_manager_xrandr_tiled_monitor_removed (MetaMonitorManager *manager,
                                                    MetaMonitor        *monitor)
 {
-  MetaMonitorManagerXrandr *manager_xrandr = META_MONITOR_MANAGER_XRANDR (manager);
+  MetaMonitorManagerXrandr *manager_xrandr = META_MONITOR_MANAGER_XRANDR (
+    manager);
   MetaMonitorXrandrData *monitor_xrandr_data;
   Atom monitor_name;
 
@@ -800,7 +817,8 @@ meta_monitor_manager_xrandr_tiled_monitor_removed (MetaMonitorManager *manager,
 }
 
 static void
-meta_monitor_manager_xrandr_init_monitors (MetaMonitorManagerXrandr *manager_xrandr)
+meta_monitor_manager_xrandr_init_monitors (
+  MetaMonitorManagerXrandr *manager_xrandr)
 {
   XRRMonitorInfo *m;
   int n, i;
@@ -809,7 +827,7 @@ meta_monitor_manager_xrandr_init_monitors (MetaMonitorManagerXrandr *manager_xra
     return;
 
   /* delete any tiled monitors setup, as mutter will want to recreate
-     things in its image */
+   *  things in its image */
   m = XRRGetMonitors (manager_xrandr->xdisplay,
                       DefaultRootWindow (manager_xrandr->xdisplay),
                       FALSE, &n);
@@ -837,9 +855,10 @@ meta_monitor_manager_xrandr_is_transform_handled (MetaMonitorManager  *manager,
 }
 
 static float
-meta_monitor_manager_xrandr_calculate_monitor_mode_scale (MetaMonitorManager *manager,
-                                                          MetaMonitor        *monitor,
-                                                          MetaMonitorMode    *monitor_mode)
+meta_monitor_manager_xrandr_calculate_monitor_mode_scale (
+  MetaMonitorManager *manager,
+  MetaMonitor        *monitor,
+  MetaMonitorMode    *monitor_mode)
 {
   return meta_monitor_calculate_mode_scale (monitor, monitor_mode);
 }
@@ -916,11 +935,12 @@ ensure_supported_monitor_scales (MetaMonitorManager *manager)
 }
 
 static float *
-meta_monitor_manager_xrandr_calculate_supported_scales (MetaMonitorManager          *manager,
-                                                        MetaLogicalMonitorLayoutMode layout_mode,
-                                                        MetaMonitor                 *monitor,
-                                                        MetaMonitorMode             *monitor_mode,
-                                                        int                         *n_supported_scales)
+meta_monitor_manager_xrandr_calculate_supported_scales (
+  MetaMonitorManager          *manager,
+  MetaLogicalMonitorLayoutMode layout_mode,
+  MetaMonitor                 *monitor,
+  MetaMonitorMode             *monitor_mode,
+  int                         *n_supported_scales)
 {
   MetaMonitorManagerXrandr *manager_xrandr =
     META_MONITOR_MANAGER_XRANDR (manager);
@@ -974,8 +994,8 @@ meta_monitor_manager_xrandr_constructed (GObject *object)
   meta_monitor_manager_add_gpu (manager, manager_xrandr->gpu);
 
   if (!XRRQueryExtension (manager_xrandr->xdisplay,
-                         &manager_xrandr->rr_event_base,
-                         &manager_xrandr->rr_error_base))
+                          &manager_xrandr->rr_event_base,
+                          &manager_xrandr->rr_error_base))
     {
       return;
     }
@@ -983,12 +1003,12 @@ meta_monitor_manager_xrandr_constructed (GObject *object)
     {
       int major_version, minor_version;
       /* We only use ScreenChangeNotify, but GDK uses the others,
-        and we don't want to step on its toes */
+       *  and we don't want to step on its toes */
       XRRSelectInput (manager_xrandr->xdisplay,
-                     DefaultRootWindow (manager_xrandr->xdisplay),
-                     RRScreenChangeNotifyMask
-                     | RRCrtcChangeNotifyMask
-                     | RROutputPropertyNotifyMask);
+                      DefaultRootWindow (manager_xrandr->xdisplay),
+                      RRScreenChangeNotifyMask
+                      | RRCrtcChangeNotifyMask
+                      | RROutputPropertyNotifyMask);
 
       manager_xrandr->has_randr15 = FALSE;
       XRRQueryVersion (manager_xrandr->xdisplay, &major_version,
@@ -1009,7 +1029,8 @@ meta_monitor_manager_xrandr_constructed (GObject *object)
 static void
 meta_monitor_manager_xrandr_finalize (GObject *object)
 {
-  MetaMonitorManagerXrandr *manager_xrandr = META_MONITOR_MANAGER_XRANDR (object);
+  MetaMonitorManagerXrandr *manager_xrandr =
+    META_MONITOR_MANAGER_XRANDR (object);
 
   g_clear_object (&manager_xrandr->gpu);
   g_hash_table_destroy (manager_xrandr->tiled_monitor_atoms);
@@ -1033,28 +1054,41 @@ meta_monitor_manager_xrandr_class_init (MetaMonitorManagerXrandrClass *klass)
   object_class->constructed = meta_monitor_manager_xrandr_constructed;
 
   manager_class->read_edid = meta_monitor_manager_xrandr_read_edid;
-  manager_class->ensure_initial_config = meta_monitor_manager_xrandr_ensure_initial_config;
-  manager_class->apply_monitors_config = meta_monitor_manager_xrandr_apply_monitors_config;
-  manager_class->set_power_save_mode = meta_monitor_manager_xrandr_set_power_save_mode;
-  manager_class->change_backlight = meta_monitor_manager_xrandr_change_backlight;
+  manager_class->ensure_initial_config =
+    meta_monitor_manager_xrandr_ensure_initial_config;
+  manager_class->apply_monitors_config =
+    meta_monitor_manager_xrandr_apply_monitors_config;
+  manager_class->set_power_save_mode =
+    meta_monitor_manager_xrandr_set_power_save_mode;
+  manager_class->change_backlight =
+    meta_monitor_manager_xrandr_change_backlight;
   manager_class->get_crtc_gamma = meta_monitor_manager_xrandr_get_crtc_gamma;
   manager_class->set_crtc_gamma = meta_monitor_manager_xrandr_set_crtc_gamma;
-  manager_class->tiled_monitor_added = meta_monitor_manager_xrandr_tiled_monitor_added;
-  manager_class->tiled_monitor_removed = meta_monitor_manager_xrandr_tiled_monitor_removed;
-  manager_class->is_transform_handled = meta_monitor_manager_xrandr_is_transform_handled;
-  manager_class->calculate_monitor_mode_scale = meta_monitor_manager_xrandr_calculate_monitor_mode_scale;
-  manager_class->calculate_supported_scales = meta_monitor_manager_xrandr_calculate_supported_scales;
-  manager_class->get_capabilities = meta_monitor_manager_xrandr_get_capabilities;
-  manager_class->get_max_screen_size = meta_monitor_manager_xrandr_get_max_screen_size;
-  manager_class->get_default_layout_mode = meta_monitor_manager_xrandr_get_default_layout_mode;
+  manager_class->tiled_monitor_added =
+    meta_monitor_manager_xrandr_tiled_monitor_added;
+  manager_class->tiled_monitor_removed =
+    meta_monitor_manager_xrandr_tiled_monitor_removed;
+  manager_class->is_transform_handled =
+    meta_monitor_manager_xrandr_is_transform_handled;
+  manager_class->calculate_monitor_mode_scale =
+    meta_monitor_manager_xrandr_calculate_monitor_mode_scale;
+  manager_class->calculate_supported_scales =
+    meta_monitor_manager_xrandr_calculate_supported_scales;
+  manager_class->get_capabilities =
+    meta_monitor_manager_xrandr_get_capabilities;
+  manager_class->get_max_screen_size =
+    meta_monitor_manager_xrandr_get_max_screen_size;
+  manager_class->get_default_layout_mode =
+    meta_monitor_manager_xrandr_get_default_layout_mode;
 
   quark_meta_monitor_xrandr_data =
     g_quark_from_static_string ("-meta-monitor-xrandr-data");
 }
 
 gboolean
-meta_monitor_manager_xrandr_handle_xevent (MetaMonitorManagerXrandr *manager_xrandr,
-                                          XEvent                   *event)
+meta_monitor_manager_xrandr_handle_xevent (
+  MetaMonitorManagerXrandr *manager_xrandr,
+  XEvent                   *event)
 {
   MetaMonitorManager *manager = META_MONITOR_MANAGER (manager_xrandr);
   MetaGpuXrandr *gpu_xrandr;
diff --git a/src/backends/x11/meta-output-xrandr.c b/src/backends/x11/meta-output-xrandr.c
index 515389dae..eecf7b530 100644
--- a/src/backends/x11/meta-output-xrandr.c
+++ b/src/backends/x11/meta-output-xrandr.c
@@ -143,7 +143,7 @@ static int
 normalize_backlight (MetaOutput *output,
                      int         hw_value)
 {
-  return round ((double)(hw_value - output->backlight_min) /
+  return round ((double) (hw_value - output->backlight_min) /
                 (output->backlight_max - output->backlight_min) * 100.0);
 }
 
@@ -161,12 +161,13 @@ meta_output_xrandr_change_backlight (MetaOutput *output,
   atom = XInternAtom (xdisplay, "Backlight", False);
 
   xcb_randr_change_output_property (XGetXCBConnection (xdisplay),
-                                    (XID)output->winsys_id,
+                                    (XID) output->winsys_id,
                                     atom, XCB_ATOM_INTEGER, 32,
                                     XCB_PROP_MODE_REPLACE,
                                     1, &hw_value);
 
-  /* We're not selecting for property notifies, so update the value immediately */
+  /* We're not selecting for property notifies, so update the value immediately
+   * */
   output->backlight = normalize_backlight (output, hw_value);
 }
 
@@ -184,7 +185,7 @@ output_get_integer_property (MetaOutput *output,
 
   atom = XInternAtom (xdisplay, propname, False);
   XRRGetOutputProperty (xdisplay,
-                        (XID)output->winsys_id,
+                        (XID) output->winsys_id,
                         atom,
                         0, G_MAXLONG, False, False, XA_INTEGER,
                         &actual_type, &actual_format,
@@ -193,7 +194,7 @@ output_get_integer_property (MetaOutput *output,
   exists = (actual_type == XA_INTEGER && actual_format == 32 && nitems == 1);
 
   if (exists && value != NULL)
-    *value = ((int*)buffer)[0];
+    *value = ((int *) buffer)[0];
 
   XFree (buffer);
   return exists;
@@ -212,7 +213,7 @@ output_get_property_exists (MetaOutput *output,
 
   atom = XInternAtom (xdisplay, propname, False);
   XRRGetOutputProperty (xdisplay,
-                        (XID)output->winsys_id,
+                        (XID) output->winsys_id,
                         atom,
                         0, G_MAXLONG, False, False, AnyPropertyType,
                         &actual_type, &actual_format,
@@ -236,7 +237,7 @@ output_get_boolean_property (MetaOutput *output,
 
   atom = XInternAtom (xdisplay, propname, False);
   XRRGetOutputProperty (xdisplay,
-                        (XID)output->winsys_id,
+                        (XID) output->winsys_id,
                         atom,
                         0, G_MAXLONG, False, False, XA_CARDINAL,
                         &actual_type, &actual_format,
@@ -245,7 +246,7 @@ output_get_boolean_property (MetaOutput *output,
   if (actual_type != XA_CARDINAL || actual_format != 32 || nitems < 1)
     return FALSE;
 
-  return ((int*)buffer)[0];
+  return ((int *) buffer)[0];
 }
 
 static gboolean
@@ -266,7 +267,7 @@ output_get_underscanning_xrandr (MetaOutput *output)
 
   atom = XInternAtom (xdisplay, "underscan", False);
   XRRGetOutputProperty (xdisplay,
-                        (XID)output->winsys_id,
+                        (XID) output->winsys_id,
                         atom,
                         0, G_MAXLONG, False, False, XA_ATOM,
                         &actual_type, &actual_format,
@@ -275,7 +276,7 @@ output_get_underscanning_xrandr (MetaOutput *output)
   if (actual_type != XA_ATOM || actual_format != 32 || nitems < 1)
     return FALSE;
 
-  str = XGetAtomName (xdisplay, *(Atom *)buffer);
+  str = XGetAtomName (xdisplay, *(Atom *) buffer);
   return (strcmp (str, "on") == 0);
 }
 
@@ -293,7 +294,7 @@ output_get_supports_underscanning_xrandr (MetaOutput *output)
 
   atom = XInternAtom (xdisplay, "underscan", False);
   XRRGetOutputProperty (xdisplay,
-                        (XID)output->winsys_id,
+                        (XID) output->winsys_id,
                         atom,
                         0, G_MAXLONG, False, False, XA_ATOM,
                         &actual_type, &actual_format,
@@ -336,7 +337,7 @@ output_get_backlight_xrandr (MetaOutput *output)
 
   atom = XInternAtom (xdisplay, "Backlight", False);
   XRRGetOutputProperty (xdisplay,
-                        (XID)output->winsys_id,
+                        (XID) output->winsys_id,
                         atom,
                         0, G_MAXLONG, False, False, XA_INTEGER,
                         &actual_type, &actual_format,
@@ -345,7 +346,7 @@ output_get_backlight_xrandr (MetaOutput *output)
   if (actual_type != XA_INTEGER || actual_format != 32 || nitems < 1)
     return FALSE;
 
-  value = ((int*)buffer)[0];
+  value = ((int *) buffer)[0];
   if (value > 0)
     return normalize_backlight (output, value);
   else
@@ -387,10 +388,10 @@ output_get_backlight_limits_xrandr (MetaOutput *output)
 }
 
 static guint8 *
-get_edid_property (Display  *xdisplay,
-                   RROutput  output,
-                   Atom      atom,
-                   gsize    *len)
+get_edid_property (Display *xdisplay,
+                   RROutput output,
+                   Atom     atom,
+                   gsize   *len)
 {
   unsigned char *prop;
   int actual_format;
@@ -522,7 +523,7 @@ output_get_connector_type_from_prop (MetaOutput *output)
 
   atom = XInternAtom (xdisplay, "ConnectorType", False);
   XRRGetOutputProperty (xdisplay,
-                        (XID)output->winsys_id,
+                        (XID) output->winsys_id,
                         atom,
                         0, G_MAXLONG, False, False, XA_ATOM,
                         &actual_type, &actual_format,
@@ -618,7 +619,7 @@ output_get_panel_orientation_transform (MetaOutput *output)
   g_autofree char *str = NULL;
 
   atom = XInternAtom (xdisplay, "panel orientation", False);
-  XRRGetOutputProperty (xdisplay, (XID)output->winsys_id, atom,
+  XRRGetOutputProperty (xdisplay, (XID) output->winsys_id, atom,
                         0, G_MAXLONG, False, False, XA_ATOM,
                         &actual_type, &actual_format,
                         &nitems, &bytes_after, &buffer);
@@ -626,7 +627,7 @@ output_get_panel_orientation_transform (MetaOutput *output)
   if (actual_type != XA_ATOM || actual_format != 32 || nitems < 1)
     return META_MONITOR_TRANSFORM_NORMAL;
 
-  str = XGetAtomName (xdisplay, *(Atom *)buffer);
+  str = XGetAtomName (xdisplay, *(Atom *) buffer);
   if (strcmp (str, "Upside Down") == 0)
     return META_MONITOR_TRANSFORM_180;
 
@@ -666,7 +667,7 @@ output_get_tile_info (MetaOutput *output)
 
   if (actual_type == XA_INTEGER && actual_format == 32 && nitems == 8)
     {
-      long *values = (long *)prop;
+      long *values = (long *) prop;
       output->tile_info.group_id = values[0];
       output->tile_info.flags = values[1];
       output->tile_info.max_h_tiles = values[2];
@@ -781,7 +782,7 @@ meta_create_xrandr_output (MetaGpuXrandr *gpu_xrandr,
     output_get_panel_orientation_transform (output);
 
   if (meta_monitor_transform_is_rotated (
-                                output->panel_orientation_transform))
+        output->panel_orientation_transform))
     {
       output->width_mm = xrandr_output->mm_height;
       output->height_mm = xrandr_output->mm_width;
diff --git a/src/backends/x11/meta-renderer-x11.c b/src/backends/x11/meta-renderer-x11.c
index e070d63b2..a757dbb80 100644
--- a/src/backends/x11/meta-renderer-x11.c
+++ b/src/backends/x11/meta-renderer-x11.c
@@ -43,7 +43,7 @@
 G_DEFINE_TYPE (MetaRendererX11, meta_renderer_x11, META_TYPE_RENDERER)
 
 static const CoglWinsysVtable *
-get_x11_cogl_winsys_vtable (CoglRenderer *renderer)
+get_x11_cogl_winsys_vtable (CoglRenderer * renderer)
 {
 #ifdef COGL_HAS_EGL_PLATFORM_XLIB_SUPPORT
   if (meta_is_wayland_compositor ())
diff --git a/src/backends/x11/meta-stage-x11-nested.c b/src/backends/x11/meta-stage-x11-nested.c
index 4cc58d609..9f72d61a6 100644
--- a/src/backends/x11/meta-stage-x11-nested.c
+++ b/src/backends/x11/meta-stage-x11-nested.c
@@ -229,11 +229,11 @@ draw_logical_monitor (MetaStageX11Nested    *stage_nested,
   meta_monitor_mode_foreach_crtc (monitor, current_mode,
                                   draw_crtc,
                                   &(DrawCrtcData) {
-                                    .stage_nested = stage_nested,
-                                    .texture = texture,
-                                    .view = view,
-                                    .logical_monitor = logical_monitor
-                                  },
+    .stage_nested = stage_nested,
+    .texture = texture,
+    .view = view,
+    .logical_monitor = logical_monitor
+  },
                                   NULL);
 }
 
@@ -274,7 +274,8 @@ meta_stage_x11_nested_finish_frame (ClutterStageWindow *stage_window)
       logical_monitor = meta_renderer_view_get_logical_monitor (renderer_view);
       if (logical_monitor)
         {
-          draw_logical_monitor (stage_nested, logical_monitor, texture, view, &view_layout);
+          draw_logical_monitor (stage_nested, logical_monitor, texture, view,
+                                &view_layout);
         }
       else
         {
@@ -289,7 +290,8 @@ meta_stage_x11_nested_finish_frame (ClutterStageWindow *stage_window)
             {
               logical_monitor = k->data;
 
-              draw_logical_monitor (stage_nested, logical_monitor, texture, view, &view_layout);
+              draw_logical_monitor (stage_nested, logical_monitor, texture,
+                                    view, &view_layout);
             }
         }
     }
@@ -316,7 +318,7 @@ meta_stage_x11_nested_unrealize (ClutterStageWindow *stage_window)
    * 1x1 one if we're unrealizing the current one, so Cogl doesn't
    * keep any reference to the foreign window.
    */
-  for (l = meta_renderer_get_views (renderer); l ;l = l->next)
+  for (l = meta_renderer_get_views (renderer); l; l = l->next)
     {
       ClutterStageView *view = l->data;
       CoglFramebuffer *framebuffer = clutter_stage_view_get_framebuffer (view);
diff --git a/src/backends/x11/nested/meta-backend-x11-nested.c 
b/src/backends/x11/nested/meta-backend-x11-nested.c
index 923ae7c6e..04590299d 100644
--- a/src/backends/x11/nested/meta-backend-x11-nested.c
+++ b/src/backends/x11/nested/meta-backend-x11-nested.c
@@ -32,8 +32,8 @@ G_DEFINE_TYPE (MetaBackendX11Nested, meta_backend_x11_nested,
                META_TYPE_BACKEND_X11)
 
 static MetaRenderer *
-meta_backend_x11_nested_create_renderer (MetaBackend *backend,
-                                         GError     **error)
+meta_backend_x11_nested_create_renderer (MetaBackend * backend,
+                                         GError * *error)
 {
   return g_object_new (META_TYPE_RENDERER_X11_NESTED, NULL);
 }
@@ -99,7 +99,8 @@ meta_backend_x11_nested_select_stage_events (MetaBackend *backend)
    * When we're a nested application, we want to behave like any other
    * application, so select these events like normal apps do.
    */
-  XISetMask (mask.mask, XI_TouchBegin); XISetMask (mask.mask, XI_TouchEnd);
+  XISetMask (mask.mask, XI_TouchBegin);
+  XISetMask (mask.mask, XI_TouchEnd);
   XISetMask (mask.mask, XI_TouchUpdate);
 
   XISelectEvents (xdisplay, xwin, &mask, 1);
@@ -112,9 +113,9 @@ meta_backend_x11_nested_select_stage_events (MetaBackend *backend)
    */
   XWindowAttributes xwa;
 
-  XGetWindowAttributes(xdisplay, xwin, &xwa);
-  XSelectInput(xdisplay, xwin,
-               xwa.your_event_mask | FocusChangeMask | KeymapStateMask);
+  XGetWindowAttributes (xdisplay, xwin, &xwa);
+  XSelectInput (xdisplay, xwin,
+                xwa.your_event_mask | FocusChangeMask | KeymapStateMask);
 }
 
 static void
@@ -185,14 +186,21 @@ meta_backend_x11_nested_class_init (MetaBackendX11NestedClass *klass)
   MetaBackendX11Class *backend_x11_class = META_BACKEND_X11_CLASS (klass);
 
   backend_class->create_renderer = meta_backend_x11_nested_create_renderer;
-  backend_class->create_monitor_manager = meta_backend_x11_nested_create_monitor_manager;
-  backend_class->create_cursor_renderer = meta_backend_x11_nested_create_cursor_renderer;
-  backend_class->create_input_settings = meta_backend_x11_nested_create_input_settings;
-  backend_class->update_screen_size = meta_backend_x11_nested_update_screen_size;
-  backend_class->select_stage_events = meta_backend_x11_nested_select_stage_events;
+  backend_class->create_monitor_manager =
+    meta_backend_x11_nested_create_monitor_manager;
+  backend_class->create_cursor_renderer =
+    meta_backend_x11_nested_create_cursor_renderer;
+  backend_class->create_input_settings =
+    meta_backend_x11_nested_create_input_settings;
+  backend_class->update_screen_size =
+    meta_backend_x11_nested_update_screen_size;
+  backend_class->select_stage_events =
+    meta_backend_x11_nested_select_stage_events;
   backend_class->lock_layout_group = meta_backend_x11_nested_lock_layout_group;
   backend_class->set_keymap = meta_backend_x11_nested_set_keymap;
 
-  backend_x11_class->handle_host_xevent = meta_backend_x11_nested_handle_host_xevent;
-  backend_x11_class->translate_device_event = meta_backend_x11_nested_translate_device_event;
+  backend_x11_class->handle_host_xevent =
+    meta_backend_x11_nested_handle_host_xevent;
+  backend_x11_class->translate_device_event =
+    meta_backend_x11_nested_translate_device_event;
 }
diff --git a/src/backends/x11/nested/meta-cursor-renderer-x11-nested.c 
b/src/backends/x11/nested/meta-cursor-renderer-x11-nested.c
index 0daae683c..2b0b12bdc 100644
--- a/src/backends/x11/nested/meta-cursor-renderer-x11-nested.c
+++ b/src/backends/x11/nested/meta-cursor-renderer-x11-nested.c
@@ -83,7 +83,8 @@ meta_cursor_renderer_x11_nested_init (MetaCursorRendererX11Nested *x11_nested)
 }
 
 static void
-meta_cursor_renderer_x11_nested_class_init (MetaCursorRendererX11NestedClass *klass)
+meta_cursor_renderer_x11_nested_class_init (
+  MetaCursorRendererX11NestedClass *klass)
 {
   MetaCursorRendererClass *renderer_class = META_CURSOR_RENDERER_CLASS (klass);
 
diff --git a/src/backends/x11/nested/meta-renderer-x11-nested.c 
b/src/backends/x11/nested/meta-renderer-x11-nested.c
index b29b9c69e..03b6ef5e5 100644
--- a/src/backends/x11/nested/meta-renderer-x11-nested.c
+++ b/src/backends/x11/nested/meta-renderer-x11-nested.c
@@ -103,14 +103,16 @@ create_offscreen (CoglContext *cogl_context,
 }
 
 static void
-meta_renderer_x11_nested_resize_legacy_view (MetaRendererX11Nested *renderer_x11_nested,
-                                             int                    width,
-                                             int                    height)
+meta_renderer_x11_nested_resize_legacy_view (
+  MetaRendererX11Nested *renderer_x11_nested,
+  int                    width,
+  int                    height)
 {
   MetaRenderer *renderer = META_RENDERER (renderer_x11_nested);
   MetaBackend *backend = meta_get_backend ();
   ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
-  CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend);
+  CoglContext *cogl_context =
+    clutter_backend_get_cogl_context (clutter_backend);
   MetaRendererView *legacy_view;
   cairo_rectangle_int_t view_layout;
   CoglOffscreen *fake_onscreen;
@@ -124,8 +126,8 @@ meta_renderer_x11_nested_resize_legacy_view (MetaRendererX11Nested *renderer_x11
     return;
 
   view_layout = (cairo_rectangle_int_t) {
-      .width = width,
-        .height = height
+    .width = width,
+    .height = height
   };
 
   fake_onscreen = create_offscreen (cogl_context, width, height);
@@ -137,14 +139,16 @@ meta_renderer_x11_nested_resize_legacy_view (MetaRendererX11Nested *renderer_x11
 }
 
 void
-meta_renderer_x11_nested_ensure_legacy_view (MetaRendererX11Nested *renderer_x11_nested,
-                                             int                    width,
-                                             int                    height)
+meta_renderer_x11_nested_ensure_legacy_view (
+  MetaRendererX11Nested *renderer_x11_nested,
+  int                    width,
+  int                    height)
 {
   MetaRenderer *renderer = META_RENDERER (renderer_x11_nested);
   MetaBackend *backend = meta_get_backend ();
   ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
-  CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend);
+  CoglContext *cogl_context =
+    clutter_backend_get_cogl_context (clutter_backend);
   cairo_rectangle_int_t view_layout;
   CoglOffscreen *fake_onscreen;
   MetaRendererView *legacy_view;
@@ -178,7 +182,8 @@ meta_renderer_x11_nested_create_view (MetaRenderer       *renderer,
   MetaMonitorManager *monitor_manager =
     meta_backend_get_monitor_manager (backend);
   ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
-  CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend);
+  CoglContext *cogl_context =
+    clutter_backend_get_cogl_context (clutter_backend);
   MetaMonitorTransform view_transform;
   float view_scale;
   int width, height;
@@ -234,4 +239,3 @@ meta_renderer_x11_nested_class_init (MetaRendererX11NestedClass *klass)
 
   renderer_class->create_view = meta_renderer_x11_nested_create_view;
 }
-
diff --git a/src/compositor/clutter-utils.c b/src/compositor/clutter-utils.c
index 33357c7a5..3ca878512 100644
--- a/src/compositor/clutter-utils.c
+++ b/src/compositor/clutter-utils.c
@@ -57,8 +57,11 @@ round_to_fixed (float x)
 /* Help macros to scale from OpenGL <-1,1> coordinates system to
  * window coordinates ranging [0,window-size]. Borrowed from clutter-utils.c
  */
-#define MTX_GL_SCALE_X(x,w,v1,v2) ((((((x) / (w)) + 1.0f) / 2.0f) * (v1)) + (v2))
-#define MTX_GL_SCALE_Y(y,w,v1,v2) ((v1) - (((((y) / (w)) + 1.0f) / 2.0f) * (v1)) + (v2))
+#define MTX_GL_SCALE_X(x, w, v1, \
+                       v2) ((((((x) / (w)) + 1.0f) / 2.0f) * (v1)) + (v2))
+#define MTX_GL_SCALE_Y(y, w, v1, \
+                       v2) ((v1) - (((((y) / (w)) + 1.0f) / 2.0f) * (v1)) + \
+                            (v2))
 
 /* This helper function checks if (according to our fixed point precision)
  * the vertices @verts form a box of width @widthf and height @heightf
@@ -76,12 +79,17 @@ meta_actor_vertices_are_untransformed (ClutterVertex *verts,
   int v0x, v0y, v1x, v1y, v2x, v2y, v3x, v3y;
   int x, y;
 
-  width = round_to_fixed (widthf); height = round_to_fixed (heightf);
+  width = round_to_fixed (widthf);
+  height = round_to_fixed (heightf);
 
-  v0x = round_to_fixed (verts[0].x); v0y = round_to_fixed (verts[0].y);
-  v1x = round_to_fixed (verts[1].x); v1y = round_to_fixed (verts[1].y);
-  v2x = round_to_fixed (verts[2].x); v2y = round_to_fixed (verts[2].y);
-  v3x = round_to_fixed (verts[3].x); v3y = round_to_fixed (verts[3].y);
+  v0x = round_to_fixed (verts[0].x);
+  v0y = round_to_fixed (verts[0].y);
+  v1x = round_to_fixed (verts[1].x);
+  v1y = round_to_fixed (verts[1].y);
+  v2x = round_to_fixed (verts[2].x);
+  v2y = round_to_fixed (verts[2].y);
+  v3x = round_to_fixed (verts[3].x);
+  v3y = round_to_fixed (verts[3].y);
 
   /* Using shifting for converting fixed => int, gets things right for
    * negative values. / 256. wouldn't do the same
@@ -124,7 +132,8 @@ meta_actor_is_untransformed (ClutterActor *actor,
   clutter_actor_get_size (actor, &widthf, &heightf);
   clutter_actor_get_abs_allocation_vertices (actor, verts);
 
-  return meta_actor_vertices_are_untransformed (verts, widthf, heightf, x_origin, y_origin);
+  return meta_actor_vertices_are_untransformed (verts, widthf, heightf,
+                                                x_origin, y_origin);
 }
 
 /**
@@ -146,10 +155,10 @@ meta_actor_is_untransformed (ClutterActor *actor,
  * transform.
  */
 gboolean
-meta_actor_painting_untransformed (int              paint_width,
-                                   int              paint_height,
-                                   int             *x_origin,
-                                   int             *y_origin)
+meta_actor_painting_untransformed (int  paint_width,
+                                   int  paint_height,
+                                   int *x_origin,
+                                   int *y_origin)
 {
   CoglMatrix modelview, projection, modelview_projection;
   ClutterVertex vertices[4];
@@ -181,13 +190,15 @@ meta_actor_painting_untransformed (int              paint_width,
   for (i = 0; i < 4; i++)
     {
       float w = 1;
-      cogl_matrix_transform_point (&modelview_projection, &vertices[i].x, &vertices[i].y, &vertices[i].z, 
&w);
+      cogl_matrix_transform_point (&modelview_projection, &vertices[i].x,
+                                   &vertices[i].y, &vertices[i].z, &w);
       vertices[i].x = MTX_GL_SCALE_X (vertices[i].x, w,
                                       viewport[2], viewport[0]);
       vertices[i].y = MTX_GL_SCALE_Y (vertices[i].y, w,
                                       viewport[3], viewport[1]);
     }
 
-  return meta_actor_vertices_are_untransformed (vertices, paint_width, paint_height, x_origin, y_origin);
+  return meta_actor_vertices_are_untransformed (vertices, paint_width,
+                                                paint_height, x_origin,
+                                                y_origin);
 }
-
diff --git a/src/compositor/cogl-utils.c b/src/compositor/cogl-utils.c
index aed5208fe..d9dd34f72 100644
--- a/src/compositor/cogl-utils.c
+++ b/src/compositor/cogl-utils.c
@@ -43,11 +43,11 @@ meta_create_texture_pipeline (CoglTexture *src_texture)
   CoglPipeline *pipeline;
 
   /* The only state used in the pipeline that would affect the shader
-     generation is the texture type on the layer. Therefore we create
-     a template pipeline which sets this state and all texture
-     pipelines are created as a copy of this. That way Cogl can find
-     the shader state for the pipeline more quickly by looking at the
-     pipeline ancestry instead of resorting to the shader cache. */
+   *  generation is the texture type on the layer. Therefore we create
+   *  a template pipeline which sets this state and all texture
+   *  pipelines are created as a copy of this. That way Cogl can find
+   *  the shader state for the pipeline more quickly by looking at the
+   *  pipeline ancestry instead of resorting to the shader cache. */
   if (G_UNLIKELY (texture_pipeline_template == NULL))
     {
       CoglContext *ctx =
@@ -119,14 +119,16 @@ meta_create_texture (int                   width,
     }
 
   if (should_use_rectangle)
-    texture = COGL_TEXTURE (cogl_texture_rectangle_new_with_size (ctx, width, height));
+    texture =
+      COGL_TEXTURE (cogl_texture_rectangle_new_with_size (ctx, width, height));
   else
     texture = COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx, width, height));
   cogl_texture_set_components (texture, components);
 
   if ((flags & META_TEXTURE_ALLOW_SLICING) != 0)
     {
-      /* To find out if we need to slice the texture, we have to go ahead and force storage
+      /* To find out if we need to slice the texture, we have to go ahead and
+       * force storage
        * to be allocated
        */
       CoglError *catch_error = NULL;
@@ -134,7 +136,10 @@ meta_create_texture (int                   width,
         {
           cogl_error_free (catch_error);
           cogl_object_unref (texture);
-          texture = COGL_TEXTURE (cogl_texture_2d_sliced_new_with_size (ctx, width, height, 
COGL_TEXTURE_MAX_WASTE));
+          texture =
+            COGL_TEXTURE (cogl_texture_2d_sliced_new_with_size (ctx, width,
+                                                                height,
+                                                                COGL_TEXTURE_MAX_WASTE));
           cogl_texture_set_components (texture, components);
         }
     }
diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c
index a378ed805..c5accdab9 100644
--- a/src/compositor/compositor.c
+++ b/src/compositor/compositor.c
@@ -39,7 +39,8 @@
  *
  * # Containers #
  *
- * There's two containers in the stage that are used to place window actors, here
+ * There's two containers in the stage that are used to place window actors,
+ *here
  * are listed in the order in which they are painted:
  *
  * - window group, accessible with meta_get_window_group_for_display()
@@ -141,7 +142,8 @@ process_damage (MetaCompositor     *compositor,
                 XDamageNotifyEvent *event,
                 MetaWindow         *window)
 {
-  MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
+  MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (
+                                                       window));
   meta_window_actor_process_x11_damage (window_actor, event);
 
   compositor->frame_has_updated_xsurfaces = TRUE;
@@ -210,7 +212,8 @@ meta_get_feedback_group_for_display (MetaDisplay *display)
  * meta_get_window_actors:
  * @display: a #MetaDisplay
  *
- * Returns: (transfer none) (element-type Clutter.Actor): The set of #MetaWindowActor on @display
+ * Returns: (transfer none) (element-type Clutter.Actor): The set of
+ *#MetaWindowActor on @display
  */
 GList *
 meta_get_window_actors (MetaDisplay *display)
@@ -232,23 +235,29 @@ meta_set_stage_input_region (MetaDisplay  *display,
     {
       MetaCompositor *compositor = display->compositor;
       Display *xdpy = meta_x11_display_get_xdisplay (display->x11_display);
-      Window xstage = clutter_x11_get_stage_window (CLUTTER_STAGE (compositor->stage));
+      Window xstage =
+        clutter_x11_get_stage_window (CLUTTER_STAGE (compositor->stage));
 
       XFixesSetWindowShapeRegion (xdpy, xstage, ShapeInput, 0, 0, region);
 
-      /* It's generally a good heuristic that when a crossing event is generated because
-       * we reshape the overlay, we don't want it to affect focus-follows-mouse focus -
-       * it's not the user doing something, it's the environment changing under the user.
+      /* It's generally a good heuristic that when a crossing event is generated
+       * because
+       * we reshape the overlay, we don't want it to affect focus-follows-mouse
+       *focus -
+       * it's not the user doing something, it's the environment changing under
+       *the user.
        */
       meta_display_add_ignored_crossing_serial (display, XNextRequest (xdpy));
-      XFixesSetWindowShapeRegion (xdpy, compositor->output, ShapeInput, 0, 0, region);
+      XFixesSetWindowShapeRegion (xdpy, compositor->output, ShapeInput, 0, 0,
+                                  region);
     }
 }
 
 void
 meta_empty_stage_input_region (MetaDisplay *display)
 {
-  /* Using a static region here is a bit hacky, but Metacity never opens more than
+  /* Using a static region here is a bit hacky, but Metacity never opens more
+   * than
    * one XDisplay, so it works fine. */
   static XserverRegion region = None;
 
@@ -304,8 +313,8 @@ meta_stage_is_focused (MetaDisplay *display)
 }
 
 static gboolean
-grab_devices (MetaModalOptions  options,
-              guint32           timestamp)
+grab_devices (MetaModalOptions options,
+              guint32          timestamp)
 {
   MetaBackend *backend = META_BACKEND (meta_get_backend ());
   gboolean pointer_grabbed = FALSE;
@@ -313,7 +322,8 @@ grab_devices (MetaModalOptions  options,
 
   if ((options & META_MODAL_POINTER_ALREADY_GRABBED) == 0)
     {
-      if (!meta_backend_grab_device (backend, META_VIRTUAL_CORE_POINTER_ID, timestamp))
+      if (!meta_backend_grab_device (backend, META_VIRTUAL_CORE_POINTER_ID,
+                                     timestamp))
         goto fail;
 
       pointer_grabbed = TRUE;
@@ -321,7 +331,8 @@ grab_devices (MetaModalOptions  options,
 
   if ((options & META_MODAL_KEYBOARD_ALREADY_GRABBED) == 0)
     {
-      if (!meta_backend_grab_device (backend, META_VIRTUAL_CORE_KEYBOARD_ID, timestamp))
+      if (!meta_backend_grab_device (backend, META_VIRTUAL_CORE_KEYBOARD_ID,
+                                     timestamp))
         goto fail;
 
       keyboard_grabbed = TRUE;
@@ -329,23 +340,27 @@ grab_devices (MetaModalOptions  options,
 
   return TRUE;
 
- fail:
+fail:
   if (pointer_grabbed)
-    meta_backend_ungrab_device (backend, META_VIRTUAL_CORE_POINTER_ID, timestamp);
+    meta_backend_ungrab_device (backend, META_VIRTUAL_CORE_POINTER_ID,
+                                timestamp);
   if (keyboard_grabbed)
-    meta_backend_ungrab_device (backend, META_VIRTUAL_CORE_KEYBOARD_ID, timestamp);
+    meta_backend_ungrab_device (backend, META_VIRTUAL_CORE_KEYBOARD_ID,
+                                timestamp);
 
   return FALSE;
 }
 
 gboolean
-meta_begin_modal_for_plugin (MetaCompositor   *compositor,
-                             MetaPlugin       *plugin,
-                             MetaModalOptions  options,
-                             guint32           timestamp)
+meta_begin_modal_for_plugin (MetaCompositor  *compositor,
+                             MetaPlugin      *plugin,
+                             MetaModalOptions options,
+                             guint32          timestamp)
 {
-  /* To some extent this duplicates code in meta_display_begin_grab_op(), but there
-   * are significant differences in how we handle grabs that make it difficult to
+  /* To some extent this duplicates code in meta_display_begin_grab_op(), but
+   * there
+   * are significant differences in how we handle grabs that make it difficult
+   *to
    * merge the two.
    */
   MetaDisplay *display = compositor->display;
@@ -417,7 +432,8 @@ meta_end_modal_for_plugin (MetaCompositor *compositor,
   display->grab_have_keyboard = FALSE;
 
   meta_backend_ungrab_device (backend, META_VIRTUAL_CORE_POINTER_ID, timestamp);
-  meta_backend_ungrab_device (backend, META_VIRTUAL_CORE_KEYBOARD_ID, timestamp);
+  meta_backend_ungrab_device (backend, META_VIRTUAL_CORE_KEYBOARD_ID,
+                              timestamp);
 
 #ifdef HAVE_WAYLAND
   if (meta_is_wayland_compositor ())
@@ -440,7 +456,8 @@ after_stage_paint (ClutterStage *stage,
 
 #ifdef HAVE_WAYLAND
   if (meta_is_wayland_compositor ())
-    meta_wayland_compositor_paint_finished (meta_wayland_compositor_get_default ());
+    meta_wayland_compositor_paint_finished (
+      meta_wayland_compositor_get_default ());
 #endif
 }
 
@@ -460,7 +477,8 @@ redirect_windows (MetaX11Display *x11_display)
 
   n_retries = 0;
 
-  /* Some compositors (like old versions of Mutter) might not properly unredirect
+  /* Some compositors (like old versions of Mutter) might not properly
+   * unredirect
    * subwindows before destroying the WM selection window; so we wait a while
    * for such a compositor to exit before giving up.
    */
@@ -475,9 +493,11 @@ redirect_windows (MetaX11Display *x11_display)
 
       if (n_retries == max_retries)
         {
-          /* This probably means that a non-WM compositor like xcompmgr is running;
+          /* This probably means that a non-WM compositor like xcompmgr is
+           * running;
            * we have no way to get it to exit */
-          meta_fatal (_("Another compositing manager is already running on screen %i on display “%s”."),
+          meta_fatal (_(
+                        "Another compositing manager is already running on screen %i on display “%s”."),
                       screen_number, x11_display->name);
         }
 
@@ -516,7 +536,8 @@ meta_compositor_manage (MetaCompositor *compositor)
   g_signal_connect_after (CLUTTER_STAGE (compositor->stage), "after-paint",
                           G_CALLBACK (after_stage_paint), compositor);
 
-  clutter_stage_set_sync_delay (CLUTTER_STAGE (compositor->stage), META_SYNC_DELAY);
+  clutter_stage_set_sync_delay (CLUTTER_STAGE (
+                                  compositor->stage), META_SYNC_DELAY);
 
   compositor->window_group = meta_window_group_new (display);
   compositor->top_window_group = meta_window_group_new (display);
@@ -553,9 +574,11 @@ meta_compositor_manage (MetaCompositor *compositor)
        *  because the X server will destroy the overlay window
        *  when the last client using it exits.
        */
-      XFixesSetWindowShapeRegion (xdisplay, compositor->output, ShapeBounding, 0, 0, None);
+      XFixesSetWindowShapeRegion (xdisplay, compositor->output, ShapeBounding,
+                                  0, 0, None);
 
-      /* Map overlay window before redirecting windows offscreen so we catch their
+      /* Map overlay window before redirecting windows offscreen so we catch
+       * their
        * contents until we show the stage.
        */
       XMapWindow (xdisplay, compositor->output);
@@ -598,13 +621,14 @@ meta_compositor_unmanage (MetaCompositor *compositor)
  */
 static void
 meta_shape_cow_for_window (MetaCompositor *compositor,
-                           MetaWindow *window)
+                           MetaWindow     *window)
 {
   MetaDisplay *display = compositor->display;
   Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
 
   if (window == NULL)
-    XFixesSetWindowShapeRegion (xdisplay, compositor->output, ShapeBounding, 0, 0, None);
+    XFixesSetWindowShapeRegion (xdisplay, compositor->output, ShapeBounding, 0,
+                                0, None);
   else
     {
       XserverRegion output_region;
@@ -628,7 +652,8 @@ meta_shape_cow_for_window (MetaCompositor *compositor,
       output_region = XFixesCreateRegion (xdisplay, &window_bounds, 1);
 
       XFixesInvertRegion (xdisplay, output_region, &screen_rect, output_region);
-      XFixesSetWindowShapeRegion (xdisplay, compositor->output, ShapeBounding, 0, 0, output_region);
+      XFixesSetWindowShapeRegion (xdisplay, compositor->output, ShapeBounding,
+                                  0, 0, output_region);
       XFixesDestroyRegion (xdisplay, output_region);
     }
 }
@@ -642,7 +667,9 @@ set_unredirected_window (MetaCompositor *compositor,
 
   if (compositor->unredirected_window != NULL)
     {
-      MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private 
(compositor->unredirected_window));
+      MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (
+                                                           compositor->
+                                                           unredirected_window));
       meta_window_actor_set_unredirected (window_actor, FALSE);
     }
 
@@ -651,14 +678,16 @@ set_unredirected_window (MetaCompositor *compositor,
 
   if (compositor->unredirected_window != NULL)
     {
-      MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private 
(compositor->unredirected_window));
+      MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (
+                                                           compositor->
+                                                           unredirected_window));
       meta_window_actor_set_unredirected (window_actor, TRUE);
     }
 }
 
 void
-meta_compositor_add_window (MetaCompositor    *compositor,
-                            MetaWindow        *window)
+meta_compositor_add_window (MetaCompositor *compositor,
+                            MetaWindow     *window)
 {
   MetaDisplay *display = compositor->display;
 
@@ -674,7 +703,8 @@ void
 meta_compositor_remove_window (MetaCompositor *compositor,
                                MetaWindow     *window)
 {
-  MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
+  MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (
+                                                       window));
 
   if (compositor->unredirected_window == window)
     set_unredirected_window (compositor, NULL);
@@ -686,7 +716,8 @@ void
 meta_compositor_sync_updates_frozen (MetaCompositor *compositor,
                                      MetaWindow     *window)
 {
-  MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
+  MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (
+                                                       window));
   meta_window_actor_sync_updates_frozen (window_actor);
 }
 
@@ -695,7 +726,8 @@ meta_compositor_queue_frame_drawn (MetaCompositor *compositor,
                                    MetaWindow     *window,
                                    gboolean        no_delay_frame)
 {
-  MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
+  MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (
+                                                       window));
   meta_window_actor_queue_frame_drawn (window_actor, no_delay_frame);
 }
 
@@ -704,7 +736,8 @@ meta_compositor_window_shape_changed (MetaCompositor *compositor,
                                       MetaWindow     *window)
 {
   MetaWindowActor *window_actor;
-  window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
+  window_actor =
+    META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
   if (!window_actor)
     return;
 
@@ -716,7 +749,8 @@ meta_compositor_window_opacity_changed (MetaCompositor *compositor,
                                         MetaWindow     *window)
 {
   MetaWindowActor *window_actor;
-  window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
+  window_actor =
+    META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
   if (!window_actor)
     return;
 
@@ -728,7 +762,8 @@ meta_compositor_window_surface_changed (MetaCompositor *compositor,
                                         MetaWindow     *window)
 {
   MetaWindowActor *window_actor;
-  window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
+  window_actor =
+    META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
   if (!window_actor)
     return;
 
@@ -750,9 +785,11 @@ meta_compositor_process_event (MetaCompositor *compositor,
   MetaX11Display *x11_display = compositor->display->x11_display;
 
   if (!meta_is_wayland_compositor () &&
-      event->type == meta_x11_display_get_damage_event_base (x11_display) + XDamageNotify)
+      event->type ==
+      meta_x11_display_get_damage_event_base (x11_display) + XDamageNotify)
     {
-      /* Core code doesn't handle damage events, so we need to extract the MetaWindow
+      /* Core code doesn't handle damage events, so we need to extract the
+       * MetaWindow
        * ourselves
        */
       if (window == NULL)
@@ -769,13 +806,14 @@ meta_compositor_process_event (MetaCompositor *compositor,
     meta_sync_ring_handle_event (event);
 
   /* Clutter needs to know about MapNotify events otherwise it will
-     think the stage is invisible */
+   *  think the stage is invisible */
   if (!meta_is_wayland_compositor () && event->type == MapNotify)
     clutter_x11_handle_event (event);
 
   /* The above handling is basically just "observing" the events, so we return
    * FALSE to indicate that the event should not be filtered out; if we have
-   * GTK+ windows in the same process, GTK+ needs the ConfigureNotify event, for example.
+   * GTK+ windows in the same process, GTK+ needs the ConfigureNotify event, for
+   *example.
    */
   return FALSE;
 }
@@ -784,16 +822,18 @@ gboolean
 meta_compositor_filter_keybinding (MetaCompositor *compositor,
                                    MetaKeyBinding *binding)
 {
-  return meta_plugin_manager_filter_keybinding (compositor->plugin_mgr, binding);
+  return meta_plugin_manager_filter_keybinding (compositor->plugin_mgr,
+                                                binding);
 }
 
 void
 meta_compositor_show_window (MetaCompositor *compositor,
-                            MetaWindow     *window,
+                             MetaWindow     *window,
                              MetaCompEffect  effect)
 {
-  MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
- meta_window_actor_show (window_actor, effect);
+  MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (
+                                                       window));
+  meta_window_actor_show (window_actor, effect);
 }
 
 void
@@ -801,20 +841,23 @@ meta_compositor_hide_window (MetaCompositor *compositor,
                              MetaWindow     *window,
                              MetaCompEffect  effect)
 {
-  MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
+  MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (
+                                                       window));
   meta_window_actor_hide (window_actor, effect);
   meta_stack_tracker_queue_sync_stack (compositor->display->stack_tracker);
 }
 
 void
-meta_compositor_size_change_window (MetaCompositor    *compositor,
-                                    MetaWindow        *window,
-                                    MetaSizeChange     which_change,
-                                    MetaRectangle     *old_frame_rect,
-                                    MetaRectangle     *old_buffer_rect)
+meta_compositor_size_change_window (MetaCompositor *compositor,
+                                    MetaWindow     *window,
+                                    MetaSizeChange  which_change,
+                                    MetaRectangle  *old_frame_rect,
+                                    MetaRectangle  *old_buffer_rect)
 {
-  MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
-  meta_window_actor_size_change (window_actor, which_change, old_frame_rect, old_buffer_rect);
+  MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (
+                                                       window));
+  meta_window_actor_size_change (window_actor, which_change, old_frame_rect,
+                                 old_buffer_rect);
 }
 
 void
@@ -825,7 +868,7 @@ meta_compositor_switch_workspace (MetaCompositor     *compositor,
 {
   gint to_indx, from_indx;
 
-  to_indx   = meta_workspace_index (to);
+  to_indx = meta_workspace_index (to);
   from_indx = meta_workspace_index (from);
 
   compositor->switch_workspace_in_progress++;
@@ -892,7 +935,8 @@ sync_actor_stacking (MetaCompositor *compositor)
         {
           has_windows = TRUE;
 
-          if (expected_window_node != NULL && actor == expected_window_node->data)
+          if (expected_window_node != NULL &&
+              actor == expected_window_node->data)
             expected_window_node = expected_window_node->next;
           else
             reordered = TRUE;
@@ -976,8 +1020,8 @@ on_top_window_actor_destroyed (MetaWindowActor *window_actor,
 }
 
 void
-meta_compositor_sync_stack (MetaCompositor  *compositor,
-                           GList           *stack)
+meta_compositor_sync_stack (MetaCompositor *compositor,
+                            GList          *stack)
 {
   GList *old_stack;
 
@@ -989,7 +1033,8 @@ meta_compositor_sync_stack (MetaCompositor  *compositor,
 
   /* Sources: first window is the highest */
   stack = g_list_copy (stack); /* The new stack of MetaWindow */
-  old_stack = g_list_reverse (compositor->windows); /* The old stack of MetaWindowActor */
+  old_stack = g_list_reverse (compositor->windows); /* The old stack of
+                                                     * MetaWindowActor */
   compositor->windows = NULL;
 
   while (TRUE)
@@ -1018,11 +1063,13 @@ meta_compositor_sync_stack (MetaCompositor  *compositor,
       while (stack)
         {
           stack_window = stack->data;
-          stack_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (stack_window));
+          stack_actor =
+            META_WINDOW_ACTOR (meta_window_get_compositor_private (stack_window));
           if (!stack_actor)
             {
               meta_verbose ("Failed to find corresponding MetaWindowActor "
-                            "for window %s\n", meta_window_get_description (stack_window));
+                            "for window %s\n",
+                            meta_window_get_description (stack_window));
               stack = g_list_delete_link (stack, stack);
             }
           else
@@ -1077,10 +1124,11 @@ meta_compositor_sync_stack (MetaCompositor  *compositor,
 
 void
 meta_compositor_sync_window_geometry (MetaCompositor *compositor,
-                                     MetaWindow *window,
-                                      gboolean did_placement)
+                                      MetaWindow     *window,
+                                      gboolean        did_placement)
 {
-  MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
+  MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (
+                                                       window));
   meta_window_actor_sync_actor_geometry (window_actor, did_placement);
   meta_plugin_manager_event_size_changed (compositor->plugin_mgr, window_actor);
 }
@@ -1104,7 +1152,8 @@ on_presented (ClutterStage     *stage,
            * guaranteed to be in nanoseconds but with no specified base. The
            * normal case with the open source GPU drivers on Linux 3.8 and
            * newer is that the base of cogl_get_clock_time() is that of
-           * clock_gettime(CLOCK_MONOTONIC), so the same as g_get_monotonic_time),
+           * clock_gettime(CLOCK_MONOTONIC), so the same as
+           *g_get_monotonic_time),
            * but there's no exposure of that through the API. clock_gettime()
            * is fairly fast, so calling it twice and subtracting to get a
            * nearly-zero number is acceptable, if a litle ugly.
@@ -1113,7 +1162,8 @@ on_presented (ClutterStage     *stage,
           gint64 current_monotonic_time = g_get_monotonic_time ();
 
           presentation_time =
-            current_monotonic_time + (presentation_time_cogl - current_cogl_time) / 1000;
+            current_monotonic_time +
+            (presentation_time_cogl - current_cogl_time) / 1000;
         }
       else
         {
@@ -1121,7 +1171,8 @@ on_presented (ClutterStage     *stage,
         }
 
       for (l = compositor->windows; l; l = l->next)
-        meta_window_actor_frame_complete (l->data, frame_info, presentation_time);
+        meta_window_actor_frame_complete (l->data, frame_info,
+                                          presentation_time);
     }
 }
 
@@ -1213,11 +1264,11 @@ meta_post_paint_func (gpointer data)
 
     default:
       /* The ARB_robustness spec says that, on error, the application
-         should destroy the old context and create a new one. Since we
-         don't have the necessary plumbing to do this we'll simply
-         restart the process. Obviously we can't do this when we are
-         a wayland compositor but in that case we shouldn't get here
-         since we don't enable robustness in that case. */
+       *  should destroy the old context and create a new one. Since we
+       *  don't have the necessary plumbing to do this we'll simply
+       *  restart the process. Obviously we can't do this when we are
+       *  a wayland compositor but in that case we shouldn't get here
+       *  since we don't enable robustness in that case. */
       g_assert (!meta_is_wayland_compositor ());
       meta_restart (NULL);
       break;
@@ -1309,7 +1360,8 @@ meta_enable_unredirect_for_display (MetaDisplay *display)
 {
   MetaCompositor *compositor = get_compositor_for_display (display);
   if (compositor->disable_unredirect_count == 0)
-    g_warning ("Called enable_unredirect_for_display while unredirection is enabled.");
+    g_warning (
+      "Called enable_unredirect_for_display while unredirection is enabled.");
   if (compositor->disable_unredirect_count > 0)
     compositor->disable_unredirect_count--;
 }
@@ -1422,10 +1474,13 @@ meta_compositor_monotonic_time_to_server_time (MetaDisplay *display,
 
   if (compositor->server_time_query_time == 0 ||
       (!compositor->server_time_is_monotonic_time &&
-       monotonic_time > compositor->server_time_query_time + 10*1000*1000)) /* 10 seconds */
+       monotonic_time > compositor->server_time_query_time + 10 * 1000 * 1000)) /*
+                                                                                 * 10
+                                                                                 * seconds
+                                                                                 * */
     {
       guint32 server_time = meta_display_get_current_time_roundtrip (display);
-      gint64 server_time_usec = (gint64)server_time * 1000;
+      gint64 server_time_usec = (gint64) server_time * 1000;
       gint64 current_monotonic_time = g_get_monotonic_time ();
       compositor->server_time_query_time = current_monotonic_time;
 
@@ -1435,11 +1490,12 @@ meta_compositor_monotonic_time_to_server_time (MetaDisplay *display,
        * is under load and our processing of the server response is
        * delayed.
        */
-      if (server_time_usec > current_monotonic_time - 1000*1000 &&
-          server_time_usec < current_monotonic_time + 1000*1000)
+      if (server_time_usec > current_monotonic_time - 1000 * 1000 &&
+          server_time_usec < current_monotonic_time + 1000 * 1000)
         compositor->server_time_is_monotonic_time = TRUE;
 
-      compositor->server_time_offset = server_time_usec - current_monotonic_time;
+      compositor->server_time_offset = server_time_usec -
+                                       current_monotonic_time;
     }
 
   if (compositor->server_time_is_monotonic_time)
@@ -1455,7 +1511,8 @@ meta_compositor_show_tile_preview (MetaCompositor *compositor,
                                    int             tile_monitor_number)
 {
   meta_plugin_manager_show_tile_preview (compositor->plugin_mgr,
-                                         window, tile_rect, tile_monitor_number);
+                                         window, tile_rect,
+                                         tile_monitor_number);
 }
 
 void
@@ -1465,22 +1522,24 @@ meta_compositor_hide_tile_preview (MetaCompositor *compositor)
 }
 
 void
-meta_compositor_show_window_menu (MetaCompositor     *compositor,
-                                  MetaWindow         *window,
-                                  MetaWindowMenuType  menu,
-                                  int                 x,
-                                  int                 y)
+meta_compositor_show_window_menu (MetaCompositor    *compositor,
+                                  MetaWindow        *window,
+                                  MetaWindowMenuType menu,
+                                  int                x,
+                                  int                y)
 {
-  meta_plugin_manager_show_window_menu (compositor->plugin_mgr, window, menu, x, y);
+  meta_plugin_manager_show_window_menu (compositor->plugin_mgr, window, menu, x,
+                                        y);
 }
 
 void
-meta_compositor_show_window_menu_for_rect (MetaCompositor     *compositor,
-                                           MetaWindow         *window,
-                                           MetaWindowMenuType  menu,
-                                          MetaRectangle      *rect)
+meta_compositor_show_window_menu_for_rect (MetaCompositor    *compositor,
+                                           MetaWindow        *window,
+                                           MetaWindowMenuType menu,
+                                           MetaRectangle     *rect)
 {
-  meta_plugin_manager_show_window_menu_for_rect (compositor->plugin_mgr, window, menu, rect);
+  meta_plugin_manager_show_window_menu_for_rect (compositor->plugin_mgr, window,
+                                                 menu, rect);
 }
 
 MetaCloseDialog *
@@ -1495,6 +1554,7 @@ MetaInhibitShortcutsDialog *
 meta_compositor_create_inhibit_shortcuts_dialog (MetaCompositor *compositor,
                                                  MetaWindow     *window)
 {
-  return meta_plugin_manager_create_inhibit_shortcuts_dialog (compositor->plugin_mgr,
-                                                              window);
+  return meta_plugin_manager_create_inhibit_shortcuts_dialog (
+    compositor->plugin_mgr,
+    window);
 }
diff --git a/src/compositor/meta-background-actor.c b/src/compositor/meta-background-actor.c
index 2b619eb27..50dd7d6d3 100644
--- a/src/compositor/meta-background-actor.c
+++ b/src/compositor/meta-background-actor.c
@@ -97,7 +97,8 @@ enum
   PROP_VIGNETTE_BRIGHTNESS
 };
 
-typedef enum {
+typedef enum
+{
   CHANGED_BACKGROUND = 1 << 0,
   CHANGED_EFFECTS = 1 << 2,
   CHANGED_VIGNETTE_PARAMETERS = 1 << 3,
@@ -106,44 +107,45 @@ typedef enum {
 } ChangedFlags;
 
 #define GRADIENT_VERTEX_SHADER_DECLARATIONS                             \
-"uniform vec2 scale;\n"                                                 \
-"varying vec2 position;\n"                                              \
+  "uniform vec2 scale;\n"                                                 \
+  "varying vec2 position;\n"                                              \
 
 #define GRADIENT_VERTEX_SHADER_CODE                                     \
-"position = cogl_tex_coord0_in.xy * scale;\n"                           \
+  "position = cogl_tex_coord0_in.xy * scale;\n"                           \
 
 #define GRADIENT_FRAGMENT_SHADER_DECLARATIONS                           \
-"uniform float gradient_height_perc;\n"                                 \
-"uniform float gradient_max_darkness;\n"                                \
-"varying vec2 position;\n"                                              \
+  "uniform float gradient_height_perc;\n"                                 \
+  "uniform float gradient_max_darkness;\n"                                \
+  "varying vec2 position;\n"                                              \
 
 #define GRADIENT_FRAGMENT_SHADER_CODE                                                    \
-"float min_brightness = 1.0 - gradient_max_darkness;\n"                                  \
-"float gradient_y_pos = min(position.y, gradient_height_perc) / gradient_height_perc;\n" \
-"float pixel_brightness = (1.0 - min_brightness) * gradient_y_pos + min_brightness;\n"   \
-"cogl_color_out.rgb = cogl_color_out.rgb * pixel_brightness;\n"                          \
+  "float min_brightness = 1.0 - gradient_max_darkness;\n"                                  \
+  "float gradient_y_pos = min(position.y, gradient_height_perc) / gradient_height_perc;\n" \
+  "float pixel_brightness = (1.0 - min_brightness) * gradient_y_pos + min_brightness;\n"   \
+  "cogl_color_out.rgb = cogl_color_out.rgb * pixel_brightness;\n"                          \
 
 #define VIGNETTE_VERTEX_SHADER_DECLARATIONS                             \
-"uniform vec2 scale;\n"                                                 \
-"uniform vec2 offset;\n"                                                \
-"varying vec2 position;\n"                                              \
+  "uniform vec2 scale;\n"                                                 \
+  "uniform vec2 offset;\n"                                                \
+  "varying vec2 position;\n"                                              \
 
 #define VIGNETTE_VERTEX_SHADER_CODE                                     \
-"position = cogl_tex_coord0_in.xy * scale + offset;\n"                  \
+  "position = cogl_tex_coord0_in.xy * scale + offset;\n"                  \
 
 #define VIGNETTE_FRAGMENT_SHADER_DECLARATIONS                           \
-"uniform float vignette_sharpness;\n"                                   \
-"varying vec2 position;\n"                                              \
+  "uniform float vignette_sharpness;\n"                                   \
+  "varying vec2 position;\n"                                              \
 
 #define VIGNETTE_FRAGMENT_SHADER_CODE                                          \
-"float t = 2.0 * length(position);\n"                                          \
-"t = min(t, 1.0);\n"                                                           \
-"float pixel_brightness = 1.0 - t * vignette_sharpness;\n"                     \
-"cogl_color_out.rgb = cogl_color_out.rgb * pixel_brightness;\n"                \
+  "float t = 2.0 * length(position);\n"                                          \
+  "t = min(t, 1.0);\n"                                                           \
+  "float pixel_brightness = 1.0 - t * vignette_sharpness;\n"                     \
+  "cogl_color_out.rgb = cogl_color_out.rgb * pixel_brightness;\n"                \
 
 typedef struct _MetaBackgroundLayer MetaBackgroundLayer;
 
-typedef enum {
+typedef enum
+{
   PIPELINE_VIGNETTE = (1 << 0),
   PIPELINE_BLEND = (1 << 1),
   PIPELINE_GRADIENT = (1 << 2),
@@ -175,9 +177,11 @@ struct _MetaBackgroundActorPrivate
 
 static void cullable_iface_init (MetaCullableInterface *iface);
 
-G_DEFINE_TYPE_WITH_CODE (MetaBackgroundActor, meta_background_actor, CLUTTER_TYPE_ACTOR,
+G_DEFINE_TYPE_WITH_CODE (MetaBackgroundActor, meta_background_actor,
+                         CLUTTER_TYPE_ACTOR,
                          G_ADD_PRIVATE (MetaBackgroundActor)
-                         G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE, cullable_iface_init));
+                         G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE,
+                                                cullable_iface_init));
 
 static void
 set_clip_region (MetaBackgroundActor *self,
@@ -280,16 +284,18 @@ make_pipeline (PipelineFlags pipeline_flags)
           static CoglSnippet *vignette_fragment_snippet;
 
           if (!vignette_vertex_snippet)
-            vignette_vertex_snippet = cogl_snippet_new (COGL_SNIPPET_HOOK_VERTEX,
-                                                        VIGNETTE_VERTEX_SHADER_DECLARATIONS,
-                                                        VIGNETTE_VERTEX_SHADER_CODE);
+            vignette_vertex_snippet = cogl_snippet_new (
+              COGL_SNIPPET_HOOK_VERTEX,
+              VIGNETTE_VERTEX_SHADER_DECLARATIONS,
+              VIGNETTE_VERTEX_SHADER_CODE);
 
           cogl_pipeline_add_snippet (*templatep, vignette_vertex_snippet);
 
           if (!vignette_fragment_snippet)
-            vignette_fragment_snippet = cogl_snippet_new (COGL_SNIPPET_HOOK_FRAGMENT,
-                                                          VIGNETTE_FRAGMENT_SHADER_DECLARATIONS,
-                                                          VIGNETTE_FRAGMENT_SHADER_CODE);
+            vignette_fragment_snippet = cogl_snippet_new (
+              COGL_SNIPPET_HOOK_FRAGMENT,
+              VIGNETTE_FRAGMENT_SHADER_DECLARATIONS,
+              VIGNETTE_FRAGMENT_SHADER_CODE);
 
           cogl_pipeline_add_snippet (*templatep, vignette_fragment_snippet);
         }
@@ -300,16 +306,18 @@ make_pipeline (PipelineFlags pipeline_flags)
           static CoglSnippet *gradient_fragment_snippet;
 
           if (!gradient_vertex_snippet)
-            gradient_vertex_snippet = cogl_snippet_new (COGL_SNIPPET_HOOK_VERTEX,
-                                                        GRADIENT_VERTEX_SHADER_DECLARATIONS,
-                                                        GRADIENT_VERTEX_SHADER_CODE);
+            gradient_vertex_snippet = cogl_snippet_new (
+              COGL_SNIPPET_HOOK_VERTEX,
+              GRADIENT_VERTEX_SHADER_DECLARATIONS,
+              GRADIENT_VERTEX_SHADER_CODE);
 
           cogl_pipeline_add_snippet (*templatep, gradient_vertex_snippet);
 
           if (!gradient_fragment_snippet)
-            gradient_fragment_snippet = cogl_snippet_new (COGL_SNIPPET_HOOK_FRAGMENT,
-                                                          GRADIENT_FRAGMENT_SHADER_DECLARATIONS,
-                                                          GRADIENT_FRAGMENT_SHADER_CODE);
+            gradient_fragment_snippet = cogl_snippet_new (
+              COGL_SNIPPET_HOOK_FRAGMENT,
+              GRADIENT_FRAGMENT_SHADER_DECLARATIONS,
+              GRADIENT_FRAGMENT_SHADER_CODE);
 
           cogl_pipeline_add_snippet (*templatep, gradient_fragment_snippet);
         }
@@ -334,9 +342,11 @@ setup_pipeline (MetaBackgroundActor   *self,
   opacity = clutter_actor_get_paint_opacity (CLUTTER_ACTOR (self));
   if (opacity < 255)
     pipeline_flags |= PIPELINE_BLEND;
-  if (priv->vignette && clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))
+  if (priv->vignette &&
+      clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))
     pipeline_flags |= PIPELINE_VIGNETTE;
-  if (priv->gradient && clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))
+  if (priv->gradient &&
+      clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))
     pipeline_flags |= PIPELINE_GRADIENT;
 
   if (priv->pipeline &&
@@ -361,8 +371,10 @@ setup_pipeline (MetaBackgroundActor   *self,
                                                           &priv->texture_area,
                                                           &wrap_mode);
       priv->force_bilinear = texture &&
-        (priv->texture_area.width != (int)cogl_texture_get_width (texture) ||
-         priv->texture_area.height != (int)cogl_texture_get_height (texture));
+                             (priv->texture_area.width !=
+                              (int) cogl_texture_get_width (texture) ||
+                              priv->texture_area.height !=
+                              (int) cogl_texture_get_height (texture));
 
       cogl_pipeline_set_layer_texture (priv->pipeline, 0, texture);
       cogl_pipeline_set_layer_wrap_mode (priv->pipeline, 0, wrap_mode);
@@ -373,7 +385,8 @@ setup_pipeline (MetaBackgroundActor   *self,
   if ((priv->changed & CHANGED_VIGNETTE_PARAMETERS) != 0)
     {
       cogl_pipeline_set_uniform_1f (priv->pipeline,
-                                    cogl_pipeline_get_uniform_location (priv->pipeline,
+                                    cogl_pipeline_get_uniform_location (priv->
+                                                                        pipeline,
                                                                         "vignette_sharpness"),
                                     priv->vignette_sharpness);
 
@@ -387,13 +400,17 @@ setup_pipeline (MetaBackgroundActor   *self,
 
       meta_display_get_monitor_geometry (priv->display,
                                          priv->monitor, &monitor_geometry);
-      gradient_height_perc = MAX (0.0001, priv->gradient_height / (float)monitor_geometry.height);
+      gradient_height_perc = MAX (0.0001,
+                                  priv->gradient_height /
+                                  (float) monitor_geometry.height);
       cogl_pipeline_set_uniform_1f (priv->pipeline,
-                                    cogl_pipeline_get_uniform_location (priv->pipeline,
+                                    cogl_pipeline_get_uniform_location (priv->
+                                                                        pipeline,
                                                                         "gradient_height_perc"),
                                     gradient_height_perc);
       cogl_pipeline_set_uniform_1f (priv->pipeline,
-                                    cogl_pipeline_get_uniform_location (priv->pipeline,
+                                    cogl_pipeline_get_uniform_location (priv->
+                                                                        pipeline,
                                                                         "gradient_max_darkness"),
                                     priv->gradient_max_darkness);
 
@@ -423,7 +440,8 @@ setup_pipeline (MetaBackgroundActor   *self,
                              opacity / 255.);
 
   if (!priv->force_bilinear &&
-      meta_actor_painting_untransformed (actor_pixel_rect->width, actor_pixel_rect->height, NULL, NULL))
+      meta_actor_painting_untransformed (actor_pixel_rect->width,
+                                         actor_pixel_rect->height, NULL, NULL))
     filter = COGL_PIPELINE_FILTER_NEAREST;
   else
     filter = COGL_PIPELINE_FILTER_LINEAR;
@@ -442,18 +460,20 @@ set_glsl_parameters (MetaBackgroundActor   *self,
   /* Compute a scale and offset for transforming texture coordinates to the
    * coordinate system from [-0.5 to 0.5] across the area of the actor
    */
-  scale[0] = priv->texture_area.width / (float)actor_pixel_rect->width;
-  scale[1] = priv->texture_area.height / (float)actor_pixel_rect->height;
-  offset[0] = priv->texture_area.x / (float)actor_pixel_rect->width - 0.5;
-  offset[1] = priv->texture_area.y / (float)actor_pixel_rect->height - 0.5;
+  scale[0] = priv->texture_area.width / (float) actor_pixel_rect->width;
+  scale[1] = priv->texture_area.height / (float) actor_pixel_rect->height;
+  offset[0] = priv->texture_area.x / (float) actor_pixel_rect->width - 0.5;
+  offset[1] = priv->texture_area.y / (float) actor_pixel_rect->height - 0.5;
 
   cogl_pipeline_set_uniform_float (priv->pipeline,
-                                   cogl_pipeline_get_uniform_location (priv->pipeline,
+                                   cogl_pipeline_get_uniform_location (priv->
+                                                                       pipeline,
                                                                        "scale"),
                                    2, 1, scale);
 
   cogl_pipeline_set_uniform_float (priv->pipeline,
-                                   cogl_pipeline_get_uniform_location (priv->pipeline,
+                                   cogl_pipeline_get_uniform_location (priv->
+                                                                       pipeline,
                                                                        "offset"),
                                    2, 1, offset);
 }
@@ -524,22 +544,24 @@ meta_background_actor_paint (ClutterActor *actor)
       int n_rects = cairo_region_num_rectangles (priv->clip_region);
       if (n_rects <= MAX_RECTS)
         {
-           for (i = 0; i < n_rects; i++)
-             {
-               cairo_rectangle_int_t rect;
-               cairo_region_get_rectangle (priv->clip_region, i, &rect);
+          for (i = 0; i < n_rects; i++)
+            {
+              cairo_rectangle_int_t rect;
+              cairo_region_get_rectangle (priv->clip_region, i, &rect);
 
-               if (!gdk_rectangle_intersect (&actor_pixel_rect, &rect, &rect))
-                 continue;
+              if (!gdk_rectangle_intersect (&actor_pixel_rect, &rect, &rect))
+                continue;
 
-               paint_clipped_rectangle (fb, priv->pipeline, &rect, &priv->texture_area);
-             }
+              paint_clipped_rectangle (fb, priv->pipeline, &rect,
+                                       &priv->texture_area);
+            }
 
-           return;
+          return;
         }
     }
 
-  paint_clipped_rectangle (fb, priv->pipeline, &actor_pixel_rect, &priv->texture_area);
+  paint_clipped_rectangle (fb, priv->pipeline, &actor_pixel_rect,
+                           &priv->texture_area);
 }
 
 static void
@@ -605,10 +627,10 @@ meta_background_actor_set_property (GObject      *object,
 }
 
 static void
-meta_background_actor_get_property (GObject      *object,
-                                    guint         prop_id,
-                                    GValue       *value,
-                                    GParamSpec   *pspec)
+meta_background_actor_get_property (GObject    *object,
+                                    guint       prop_id,
+                                    GValue     *value,
+                                    GParamSpec *pspec)
 {
   MetaBackgroundActorPrivate *priv = META_BACKGROUND_ACTOR (object)->priv;
 
@@ -659,7 +681,8 @@ meta_background_actor_class_init (MetaBackgroundActorClass *klass)
   object_class->get_property = meta_background_actor_get_property;
 
   actor_class->get_preferred_width = meta_background_actor_get_preferred_width;
-  actor_class->get_preferred_height = meta_background_actor_get_preferred_height;
+  actor_class->get_preferred_height =
+    meta_background_actor_get_preferred_height;
   actor_class->get_paint_volume = meta_background_actor_get_paint_volume;
   actor_class->paint = meta_background_actor_paint;
 
@@ -716,8 +739,8 @@ meta_background_actor_class_init (MetaBackgroundActorClass *klass)
   param_spec = g_param_spec_double ("gradient-max-darkness",
                                     "Gradient Max Darkness",
                                     "How dark is the gradient initially",
-                                     0.0, 1.0, 0.0,
-                                     G_PARAM_READWRITE);
+                                    0.0, 1.0, 0.0,
+                                    G_PARAM_READWRITE);
 
   g_object_class_install_property (object_class,
                                    PROP_GRADIENT_MAX_DARKNESS,
@@ -866,7 +889,7 @@ meta_background_actor_set_background (MetaBackgroundActor *self,
   if (priv->background)
     {
       g_signal_handlers_disconnect_by_func (priv->background,
-                                            (gpointer)on_background_changed,
+                                            (gpointer) on_background_changed,
                                             self);
       g_object_unref (priv->background);
       priv->background = NULL;
@@ -907,7 +930,8 @@ meta_background_actor_set_gradient (MetaBackgroundActor *self,
       changed = TRUE;
     }
 
-  if (height != priv->gradient_height || max_darkness != priv->gradient_max_darkness)
+  if (height != priv->gradient_height ||
+      max_darkness != priv->gradient_max_darkness)
     {
       priv->gradient_height = height;
       priv->gradient_max_darkness = max_darkness;
@@ -929,12 +953,13 @@ meta_background_actor_set_monitor (MetaBackgroundActor *self,
   MetaDisplay *display = priv->display;
 
   if(priv->monitor == monitor)
-      return;
+    return;
 
-  meta_display_get_monitor_geometry (display, priv->monitor, &old_monitor_geometry);
+  meta_display_get_monitor_geometry (display, priv->monitor,
+                                     &old_monitor_geometry);
   meta_display_get_monitor_geometry (display, monitor, &new_monitor_geometry);
   if(old_monitor_geometry.height != new_monitor_geometry.height)
-      invalidate_pipeline (self, CHANGED_GRADIENT_PARAMETERS);
+    invalidate_pipeline (self, CHANGED_GRADIENT_PARAMETERS);
 
   priv->monitor = monitor;
 }
@@ -963,7 +988,8 @@ meta_background_actor_set_vignette (MetaBackgroundActor *self,
       changed = TRUE;
     }
 
-  if (brightness != priv->vignette_brightness || sharpness != priv->vignette_sharpness)
+  if (brightness != priv->vignette_brightness ||
+      sharpness != priv->vignette_sharpness)
     {
       priv->vignette_brightness = brightness;
       priv->vignette_sharpness = sharpness;
diff --git a/src/compositor/meta-background-group.c b/src/compositor/meta-background-group.c
index e30b8af4c..c730bf4fe 100644
--- a/src/compositor/meta-background-group.c
+++ b/src/compositor/meta-background-group.c
@@ -21,8 +21,10 @@
 
 static void cullable_iface_init (MetaCullableInterface *iface);
 
-G_DEFINE_TYPE_WITH_CODE (MetaBackgroundGroup, meta_background_group, CLUTTER_TYPE_ACTOR,
-                         G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE, cullable_iface_init));
+G_DEFINE_TYPE_WITH_CODE (MetaBackgroundGroup, meta_background_group,
+                         CLUTTER_TYPE_ACTOR,
+                         G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE,
+                                                cullable_iface_init));
 
 static void
 meta_background_group_class_init (MetaBackgroundGroupClass *klass)
diff --git a/src/compositor/meta-background-image.c b/src/compositor/meta-background-image.c
index 802c10c76..371888384 100644
--- a/src/compositor/meta-background-image.c
+++ b/src/compositor/meta-background-image.c
@@ -19,7 +19,8 @@
 /**
  * SECTION:meta-background-image
  * @title: MetaBackgroundImage
- * @short_description: objects holding images loaded from files, used for backgrounds
+ * @short_description: objects holding images loaded from files, used for
+ *backgrounds
  */
 
 #include "config.h"
@@ -67,7 +68,8 @@ struct _MetaBackgroundImageClass
   GObjectClass parent_class;
 };
 
-G_DEFINE_TYPE (MetaBackgroundImageCache, meta_background_image_cache, G_TYPE_OBJECT);
+G_DEFINE_TYPE (MetaBackgroundImageCache, meta_background_image_cache,
+               G_TYPE_OBJECT);
 
 static void
 meta_background_image_cache_init (MetaBackgroundImageCache *cache)
@@ -193,7 +195,8 @@ file_loaded (GObject      *source_object,
                                  META_TEXTURE_ALLOW_SLICING);
 
   if (!cogl_texture_set_data (texture,
-                              has_alpha ? COGL_PIXEL_FORMAT_RGBA_8888 : COGL_PIXEL_FORMAT_RGB_888,
+                              has_alpha ? COGL_PIXEL_FORMAT_RGBA_8888 :
+                              COGL_PIXEL_FORMAT_RGB_888,
                               row_stride,
                               pixels, 0,
                               &catch_error))
@@ -226,7 +229,8 @@ out:
  * signal will be emitted exactly once. The 'loaded' state means that the
  * loading process finished, whether it succeeded or failed.
  *
- * Return value: (transfer full): a #MetaBackgroundImage to dereference to get the loaded texture
+ * Return value: (transfer full): a #MetaBackgroundImage to dereference to get
+ *the loaded texture
  */
 MetaBackgroundImage *
 meta_background_image_cache_load (MetaBackgroundImageCache *cache,
diff --git a/src/compositor/meta-background.c b/src/compositor/meta-background.c
index 0fb20d569..83d10c050 100644
--- a/src/compositor/meta-background.c
+++ b/src/compositor/meta-background.c
@@ -53,10 +53,10 @@ struct _MetaBackgroundPrivate
   MetaBackgroundMonitor *monitors;
   int n_monitors;
 
-  GDesktopBackgroundStyle   style;
+  GDesktopBackgroundStyle style;
   GDesktopBackgroundShading shading_direction;
-  ClutterColor              color;
-  ClutterColor              second_color;
+  ClutterColor color;
+  ClutterColor second_color;
 
   GFile *file1;
   MetaBackgroundImage *background_image1;
@@ -189,10 +189,10 @@ meta_background_set_property (GObject      *object,
 }
 
 static void
-meta_background_get_property (GObject      *object,
-                              guint         prop_id,
-                              GValue       *value,
-                              GParamSpec   *pspec)
+meta_background_get_property (GObject    *object,
+                              guint       prop_id,
+                              GValue     *value,
+                              GParamSpec *pspec)
 {
   MetaBackgroundPrivate *priv = META_BACKGROUND (object)->priv;
 
@@ -211,8 +211,12 @@ static gboolean
 need_prerender (MetaBackground *self)
 {
   MetaBackgroundPrivate *priv = self->priv;
-  CoglTexture *texture1 = priv->background_image1 ? meta_background_image_get_texture 
(priv->background_image1) : NULL;
-  CoglTexture *texture2 = priv->background_image2 ? meta_background_image_get_texture 
(priv->background_image2) : NULL;
+  CoglTexture *texture1 =
+    priv->background_image1 ? meta_background_image_get_texture (
+      priv->background_image1) : NULL;
+  CoglTexture *texture2 =
+    priv->background_image2 ? meta_background_image_get_texture (
+      priv->background_image2) : NULL;
 
   if (texture1 == NULL && texture2 == NULL)
     return FALSE;
@@ -271,7 +275,7 @@ set_file (MetaBackground       *self,
       if (*imagep)
         {
           g_signal_handlers_disconnect_by_func (*imagep,
-                                                (gpointer)on_background_loaded,
+                                                (gpointer) on_background_loaded,
                                                 self);
           g_object_unref (*imagep);
           *imagep = NULL;
@@ -279,7 +283,8 @@ set_file (MetaBackground       *self,
 
       if (file)
         {
-          MetaBackgroundImageCache *cache = meta_background_image_cache_get_default ();
+          MetaBackgroundImageCache *cache =
+            meta_background_image_cache_get_default ();
 
           *filep = g_object_ref (file);
           *imagep = meta_background_image_cache_load (cache, file);
@@ -292,7 +297,7 @@ set_file (MetaBackground       *self,
 static void
 meta_background_dispose (GObject *object)
 {
-  MetaBackground        *self = META_BACKGROUND (object);
+  MetaBackground *self = META_BACKGROUND (object);
   MetaBackgroundPrivate *priv = self->priv;
 
   free_color_texture (self);
@@ -317,14 +322,15 @@ meta_background_finalize (GObject *object)
 static void
 meta_background_constructed (GObject *object)
 {
-  MetaBackground        *self = META_BACKGROUND (object);
+  MetaBackground *self = META_BACKGROUND (object);
   MetaBackgroundPrivate *priv = self->priv;
   MetaMonitorManager *monitor_manager = meta_monitor_manager_get ();
 
   G_OBJECT_CLASS (meta_background_parent_class)->constructed (object);
 
   g_signal_connect_object (priv->display, "gl-video-memory-purged",
-                           G_CALLBACK (mark_changed), object, G_CONNECT_SWAPPED);
+                           G_CALLBACK (mark_changed), object,
+                           G_CONNECT_SWAPPED);
 
   g_signal_connect_object (monitor_manager, "monitors-changed",
                            G_CALLBACK (on_monitors_changed), self,
@@ -360,7 +366,6 @@ meta_background_class_init (MetaBackgroundClass *klass)
   g_object_class_install_property (object_class,
                                    PROP_META_DISPLAY,
                                    param_spec);
-
 }
 
 static void
@@ -383,10 +388,10 @@ set_texture_area_from_monitor_area (cairo_rectangle_int_t *monitor_area,
 }
 
 static void
-get_texture_area (MetaBackground          *self,
-                  cairo_rectangle_int_t   *monitor_rect,
-                  CoglTexture             *texture,
-                  cairo_rectangle_int_t   *texture_area)
+get_texture_area (MetaBackground        *self,
+                  cairo_rectangle_int_t *monitor_rect,
+                  CoglTexture           *texture,
+                  cairo_rectangle_int_t *texture_area)
 {
   MetaBackgroundPrivate *priv = self->priv;
   cairo_rectangle_int_t image_area;
@@ -472,23 +477,23 @@ get_texture_area (MetaBackground          *self,
       break;
 
     case G_DESKTOP_BACKGROUND_STYLE_SPANNED:
-      {
-        /* paint region is the union of all monitors, with the origin
-         * of the region set to align with monitor associated with the background.
-         */
-        meta_display_get_size (priv->display, &screen_width, &screen_height);
-
-        /* unclipped texture area is whole screen */
-        image_area.width = screen_width;
-        image_area.height = screen_height;
-
-        /* But make (0,0) line up with the appropriate monitor */
-        image_area.x = -monitor_rect->x;
-        image_area.y = -monitor_rect->y;
-
-        *texture_area = image_area;
-        break;
-      }
+    {
+      /* paint region is the union of all monitors, with the origin
+       * of the region set to align with monitor associated with the background.
+       */
+      meta_display_get_size (priv->display, &screen_width, &screen_height);
+
+      /* unclipped texture area is whole screen */
+      image_area.width = screen_width;
+      image_area.height = screen_height;
+
+      /* But make (0,0) line up with the appropriate monitor */
+      image_area.x = -monitor_rect->x;
+      image_area.y = -monitor_rect->y;
+
+      *texture_area = image_area;
+      break;
+    }
     }
 }
 
@@ -518,10 +523,13 @@ draw_texture (MetaBackground        *self,
                                                 0,
                                                 monitor_area->width,
                                                 monitor_area->height,
-                                                - texture_area.x / (float)texture_area.width,
-                                                - texture_area.y / (float)texture_area.height,
-                                                (monitor_area->width - texture_area.x) / 
(float)texture_area.width,
-                                                (monitor_area->height - texture_area.y) / 
(float)texture_area.height);
+                                                -texture_area.x / (float) texture_area.width,
+                                                -texture_area.y / (float) texture_area.height,
+                                                (monitor_area->width -
+                                                 texture_area.x) / (float) texture_area.width,
+                                                (monitor_area->height -
+                                                 texture_area.y) /
+                                                (float) texture_area.height);
 
       bare_region_visible = texture_has_alpha (texture);
 
@@ -535,13 +543,14 @@ draw_texture (MetaBackground        *self,
                                                 texture_area.x + texture_area.width,
                                                 texture_area.y + texture_area.height,
                                                 0, 0, 1.0, 1.0);
-      bare_region_visible = texture_has_alpha (texture) || memcmp (&texture_area, monitor_area, sizeof 
(cairo_rectangle_int_t)) != 0;
+      bare_region_visible = texture_has_alpha (texture) || memcmp (
+        &texture_area, monitor_area, sizeof (cairo_rectangle_int_t)) != 0;
       break;
     case G_DESKTOP_BACKGROUND_STYLE_NONE:
       bare_region_visible = TRUE;
       break;
     default:
-      g_return_val_if_reached(FALSE);
+      g_return_val_if_reached (FALSE);
     }
 
   return bare_region_visible;
@@ -593,21 +602,25 @@ ensure_color_texture (MetaBackground *self)
           pixels[5] = priv->second_color.blue;
         }
 
-      priv->color_texture = COGL_TEXTURE (cogl_texture_2d_new_from_data (ctx, width, height,
-                                                                         COGL_PIXEL_FORMAT_RGB_888,
-                                                                         width * 3,
-                                                                         pixels,
-                                                                         &error));
+      priv->color_texture =
+        COGL_TEXTURE (cogl_texture_2d_new_from_data (ctx, width, height,
+                                                     COGL_PIXEL_FORMAT_RGB_888,
+                                                     width *
+                                                     3,
+                                                     pixels,
+                                                     &error));
 
       if (error != NULL)
         {
-          meta_warning ("Failed to allocate color texture: %s\n", error->message);
+          meta_warning ("Failed to allocate color texture: %s\n",
+                        error->message);
           cogl_error_free (error);
         }
     }
 }
 
-typedef enum {
+typedef enum
+{
   PIPELINE_REPLACE,
   PIPELINE_ADD,
   PIPELINE_OVER_REVERSE,
@@ -616,10 +629,12 @@ typedef enum {
 static CoglPipeline *
 create_pipeline (PipelineType type)
 {
-  const char * const blend_strings[3] = {
+  const char * const blend_strings[3] =
+  {
     [PIPELINE_REPLACE] = "RGBA = ADD (SRC_COLOR, 0)",
     [PIPELINE_ADD] = "RGBA = ADD (SRC_COLOR, DST_COLOR)",
-    [PIPELINE_OVER_REVERSE] = "RGBA = ADD (SRC_COLOR * (1 - DST_COLOR[A]), DST_COLOR)",
+    [PIPELINE_OVER_REVERSE] =
+      "RGBA = ADD (SRC_COLOR * (1 - DST_COLOR[A]), DST_COLOR)",
   };
   static CoglPipeline *templates[3];
 
@@ -675,7 +690,8 @@ ensure_wallpaper_texture (MetaBackground *self,
 
       if (!cogl_framebuffer_allocate (fbo, &catch_error))
         {
-          /* This probably means that the size of the wallpapered texture is larger
+          /* This probably means that the size of the wallpapered texture is
+           * larger
            * than the maximum texture size; we treat it as permanent until the
            * background is changed again.
            */
@@ -694,7 +710,8 @@ ensure_wallpaper_texture (MetaBackground *self,
 
       pipeline = create_pipeline (PIPELINE_REPLACE);
       cogl_pipeline_set_layer_texture (pipeline, 0, texture);
-      cogl_framebuffer_draw_textured_rectangle (fbo, pipeline, 0, 0, width, height,
+      cogl_framebuffer_draw_textured_rectangle (fbo, pipeline, 0, 0, width,
+                                                height,
                                                 0., 0., 1., 1.);
       cogl_object_unref (pipeline);
 
@@ -719,24 +736,24 @@ get_wrap_mode (GDesktopBackgroundStyle style)
 {
   switch (style)
     {
-      case G_DESKTOP_BACKGROUND_STYLE_WALLPAPER:
-          return COGL_PIPELINE_WRAP_MODE_REPEAT;
-      case G_DESKTOP_BACKGROUND_STYLE_NONE:
-      case G_DESKTOP_BACKGROUND_STYLE_STRETCHED:
-      case G_DESKTOP_BACKGROUND_STYLE_CENTERED:
-      case G_DESKTOP_BACKGROUND_STYLE_SCALED:
-      case G_DESKTOP_BACKGROUND_STYLE_ZOOM:
-      case G_DESKTOP_BACKGROUND_STYLE_SPANNED:
-      default:
-          return COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE;
+    case G_DESKTOP_BACKGROUND_STYLE_WALLPAPER:
+      return COGL_PIPELINE_WRAP_MODE_REPEAT;
+    case G_DESKTOP_BACKGROUND_STYLE_NONE:
+    case G_DESKTOP_BACKGROUND_STYLE_STRETCHED:
+    case G_DESKTOP_BACKGROUND_STYLE_CENTERED:
+    case G_DESKTOP_BACKGROUND_STYLE_SCALED:
+    case G_DESKTOP_BACKGROUND_STYLE_ZOOM:
+    case G_DESKTOP_BACKGROUND_STYLE_SPANNED:
+    default:
+      return COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE;
     }
 }
 
 CoglTexture *
-meta_background_get_texture (MetaBackground         *self,
-                             int                     monitor_index,
-                             cairo_rectangle_int_t  *texture_area,
-                             CoglPipelineWrapMode   *wrap_mode)
+meta_background_get_texture (MetaBackground        *self,
+                             int                    monitor_index,
+                             cairo_rectangle_int_t *texture_area,
+                             CoglPipelineWrapMode  *wrap_mode)
 {
   MetaBackgroundPrivate *priv;
   MetaBackgroundMonitor *monitor;
@@ -746,7 +763,8 @@ meta_background_get_texture (MetaBackground         *self,
 
   g_return_val_if_fail (META_IS_BACKGROUND (self), NULL);
   priv = self->priv;
-  g_return_val_if_fail (monitor_index >= 0 && monitor_index < priv->n_monitors, NULL);
+  g_return_val_if_fail (monitor_index >= 0 && monitor_index < priv->n_monitors,
+                        NULL);
 
   monitor = &priv->monitors[monitor_index];
 
@@ -756,8 +774,10 @@ meta_background_get_texture (MetaBackground         *self,
   monitor_area.width = geometry.width;
   monitor_area.height = geometry.height;
 
-  texture1 = priv->background_image1 ? meta_background_image_get_texture (priv->background_image1) : NULL;
-  texture2 = priv->background_image2 ? meta_background_image_get_texture (priv->background_image2) : NULL;
+  texture1 = priv->background_image1 ? meta_background_image_get_texture (
+    priv->background_image1) : NULL;
+  texture2 = priv->background_image2 ? meta_background_image_get_texture (
+    priv->background_image2) : NULL;
 
   if (texture1 == NULL && texture2 == NULL)
     {
@@ -790,7 +810,8 @@ meta_background_get_texture (MetaBackground         *self,
         {
           CoglOffscreen *offscreen;
 
-          monitor->texture = meta_create_texture (monitor_area.width, monitor_area.height,
+          monitor->texture = meta_create_texture (monitor_area.width,
+                                                  monitor_area.height,
                                                   COGL_TEXTURE_COMPONENTS_RGBA,
                                                   META_TEXTURE_FLAGS_NONE);
           offscreen = cogl_offscreen_new_with_texture (monitor->texture);
@@ -799,7 +820,8 @@ meta_background_get_texture (MetaBackground         *self,
 
       if (!cogl_framebuffer_allocate (monitor->fbo, &catch_error))
         {
-          /* Texture or framebuffer allocation failed; it's unclear why this happened;
+          /* Texture or framebuffer allocation failed; it's unclear why this
+           * happened;
            * we'll try again the next time this is called. (MetaBackgroundActor
            * caches the result, so user might be left without a background.)
            */
@@ -813,15 +835,18 @@ meta_background_get_texture (MetaBackground         *self,
         }
 
       cogl_framebuffer_orthographic (monitor->fbo, 0, 0,
-                                     monitor_area.width, monitor_area.height, -1., 1.);
+                                     monitor_area.width, monitor_area.height,
+                                     -1., 1.);
 
       if (texture2 != NULL && priv->blend_factor != 0.0)
         {
           CoglPipeline *pipeline = create_pipeline (PIPELINE_REPLACE);
           cogl_pipeline_set_color4f (pipeline,
-                                      priv->blend_factor, priv->blend_factor, priv->blend_factor, 
priv->blend_factor);
+                                     priv->blend_factor, priv->blend_factor,
+                                     priv->blend_factor, priv->blend_factor);
           cogl_pipeline_set_layer_texture (pipeline, 0, texture2);
-          cogl_pipeline_set_layer_wrap_mode (pipeline, 0, get_wrap_mode (priv->style));
+          cogl_pipeline_set_layer_wrap_mode (pipeline, 0,
+                                             get_wrap_mode (priv->style));
 
           bare_region_visible = draw_texture (self,
                                               monitor->fbo, pipeline,
@@ -843,13 +868,15 @@ meta_background_get_texture (MetaBackground         *self,
                                      (1 - priv->blend_factor),
                                      (1 - priv->blend_factor),
                                      (1 - priv->blend_factor),
-                                     (1 - priv->blend_factor));;
+                                     (1 - priv->blend_factor));
           cogl_pipeline_set_layer_texture (pipeline, 0, texture1);
-          cogl_pipeline_set_layer_wrap_mode (pipeline, 0, get_wrap_mode (priv->style));
+          cogl_pipeline_set_layer_wrap_mode (pipeline, 0,
+                                             get_wrap_mode (priv->style));
 
           bare_region_visible = bare_region_visible || draw_texture (self,
                                                                      monitor->fbo, pipeline,
-                                                                     texture1, &monitor_area);
+                                                                     texture1,
+                                                                     &monitor_area);
 
           cogl_object_unref (pipeline);
         }
@@ -863,7 +890,8 @@ meta_background_get_texture (MetaBackground         *self,
           cogl_framebuffer_draw_rectangle (monitor->fbo,
                                            pipeline,
                                            0, 0,
-                                           monitor_area.width, monitor_area.height);
+                                           monitor_area.width,
+                                           monitor_area.height);
           cogl_object_unref (pipeline);
         }
 
@@ -901,10 +929,10 @@ meta_background_set_color (MetaBackground *self,
 }
 
 void
-meta_background_set_gradient (MetaBackground            *self,
-                              GDesktopBackgroundShading  shading_direction,
-                              ClutterColor              *color,
-                              ClutterColor              *second_color)
+meta_background_set_gradient (MetaBackground           *self,
+                              GDesktopBackgroundShading shading_direction,
+                              ClutterColor             *color,
+                              ClutterColor             *second_color)
 {
   MetaBackgroundPrivate *priv;
 
@@ -924,9 +952,9 @@ meta_background_set_gradient (MetaBackground            *self,
 }
 
 void
-meta_background_set_file (MetaBackground            *self,
-                          GFile                     *file,
-                          GDesktopBackgroundStyle    style)
+meta_background_set_file (MetaBackground         *self,
+                          GFile                  *file,
+                          GDesktopBackgroundStyle style)
 {
   g_return_if_fail (META_IS_BACKGROUND (self));
 
@@ -934,11 +962,11 @@ meta_background_set_file (MetaBackground            *self,
 }
 
 void
-meta_background_set_blend (MetaBackground          *self,
-                           GFile                   *file1,
-                           GFile                   *file2,
-                           double                   blend_factor,
-                           GDesktopBackgroundStyle  style)
+meta_background_set_blend (MetaBackground         *self,
+                           GFile                  *file1,
+                           GFile                  *file2,
+                           double                  blend_factor,
+                           GDesktopBackgroundStyle style)
 {
   MetaBackgroundPrivate *priv;
 
diff --git a/src/compositor/meta-cullable.c b/src/compositor/meta-cullable.c
index 5cdc03a6d..2e9913874 100644
--- a/src/compositor/meta-cullable.c
+++ b/src/compositor/meta-cullable.c
@@ -108,10 +108,11 @@ meta_cullable_cull_out_children (MetaCullable   *cullable,
           clutter_actor_get_position (child, &x, &y);
 
           /* Temporarily move to the coordinate system of the actor */
-          cairo_region_translate (unobscured_region, - x, - y);
-          cairo_region_translate (clip_region, - x, - y);
+          cairo_region_translate (unobscured_region, -x, -y);
+          cairo_region_translate (clip_region, -x, -y);
 
-          meta_cullable_cull_out (META_CULLABLE (child), unobscured_region, clip_region);
+          meta_cullable_cull_out (META_CULLABLE (
+                                    child), unobscured_region, clip_region);
 
           cairo_region_translate (unobscured_region, x, y);
           cairo_region_translate (clip_region, x, y);
@@ -183,7 +184,8 @@ meta_cullable_cull_out (MetaCullable   *cullable,
                         cairo_region_t *unobscured_region,
                         cairo_region_t *clip_region)
 {
-  META_CULLABLE_GET_IFACE (cullable)->cull_out (cullable, unobscured_region, clip_region);
+  META_CULLABLE_GET_IFACE (cullable)->cull_out (cullable, unobscured_region,
+                                                clip_region);
 }
 
 /**
diff --git a/src/compositor/meta-dnd-actor.c b/src/compositor/meta-dnd-actor.c
index 24f578be1..9d9ef43b4 100644
--- a/src/compositor/meta-dnd-actor.c
+++ b/src/compositor/meta-dnd-actor.c
@@ -33,7 +33,8 @@
 
 #define DRAG_FAILED_DURATION 500
 
-enum {
+enum
+{
   PROP_DRAG_ORIGIN = 1,
   PROP_DRAG_START_X,
   PROP_DRAG_START_Y
@@ -48,7 +49,8 @@ struct _MetaDnDActorPrivate
   int drag_start_y;
 };
 
-G_DEFINE_TYPE_WITH_PRIVATE (MetaDnDActor, meta_dnd_actor, META_TYPE_FEEDBACK_ACTOR)
+G_DEFINE_TYPE_WITH_PRIVATE (MetaDnDActor, meta_dnd_actor,
+                            META_TYPE_FEEDBACK_ACTOR)
 
 static void
 meta_dnd_actor_set_property (GObject      *object,
@@ -77,10 +79,10 @@ meta_dnd_actor_set_property (GObject      *object,
 }
 
 static void
-meta_dnd_actor_get_property (GObject      *object,
-                             guint         prop_id,
-                             GValue       *value,
-                             GParamSpec   *pspec)
+meta_dnd_actor_get_property (GObject    *object,
+                             guint       prop_id,
+                             GValue     *value,
+                             GParamSpec *pspec)
 {
   MetaDnDActor *self = META_DND_ACTOR (object);
   MetaDnDActorPrivate *priv = meta_dnd_actor_get_instance_private (self);
diff --git a/src/compositor/meta-dnd.c b/src/compositor/meta-dnd.c
index 467aec347..2de034d04 100644
--- a/src/compositor/meta-dnd.c
+++ b/src/compositor/meta-dnd.c
@@ -49,7 +49,8 @@ struct _MetaDndPrivate
   MetaCompositor *compositor;
   MetaWaylandCompositor *wl_compositor;
 #else
-  /* to avoid warnings (g_type_class_add_private: assertion `private_size > 0' failed) */
+  /* to avoid warnings (g_type_class_add_private: assertion `private_size > 0'
+   * failed) */
   gchar dummy;
 #endif
 };
@@ -117,8 +118,8 @@ meta_dnd_notify_dnd_enter (MetaDnd *dnd)
 
 static void
 meta_dnd_notify_dnd_position_change (MetaDnd *dnd,
-                                      int      x,
-                                      int      y)
+                                     int      x,
+                                     int      y)
 {
   g_signal_emit (dnd, signals[POSITION_CHANGE], 0, x, y);
 }
@@ -150,7 +151,8 @@ meta_dnd_handle_xdnd_event (MetaBackend    *backend,
     return FALSE;
 
   if (xev->xany.window != output_window &&
-      xev->xany.window != clutter_x11_get_stage_window (CLUTTER_STAGE (compositor->stage)))
+      xev->xany.window !=
+      clutter_x11_get_stage_window (CLUTTER_STAGE (compositor->stage)))
     return FALSE;
 
   if (xev->xclient.message_type == XInternAtom (xdisplay, "XdndPosition", TRUE))
@@ -158,39 +160,43 @@ meta_dnd_handle_xdnd_event (MetaBackend    *backend,
       XEvent xevent;
       Window src = xev->xclient.data.l[0];
 
-      memset (&xevent, 0, sizeof(xevent));
+      memset (&xevent, 0, sizeof (xevent));
       xevent.xany.type = ClientMessage;
       xevent.xany.display = xdisplay;
       xevent.xclient.window = src;
       xevent.xclient.message_type = XInternAtom (xdisplay, "XdndStatus", TRUE);
       xevent.xclient.format = 32;
       xevent.xclient.data.l[0] = output_window;
-      /* flags: bit 0: will we accept the drop? bit 1: do we want more position messages */
+      /* flags: bit 0: will we accept the drop? bit 1: do we want more position
+       * messages */
       xevent.xclient.data.l[1] = 2;
       xevent.xclient.data.l[4] = None;
 
       XSendEvent (xdisplay, src, False, 0, &xevent);
 
       meta_dnd_notify_dnd_position_change (dnd,
-                                            (int)(xev->xclient.data.l[2] >> 16),
-                                            (int)(xev->xclient.data.l[2] & 0xFFFF));
+                                           (int) (xev->xclient.data.l[2] >> 16),
+                                           (int) (xev->xclient.data.l[2] &
+                                                  0xFFFF));
 
       return TRUE;
     }
-  else if (xev->xclient.message_type == XInternAtom (xdisplay, "XdndLeave", TRUE))
+  else if (xev->xclient.message_type ==
+           XInternAtom (xdisplay, "XdndLeave", TRUE))
     {
       meta_dnd_notify_dnd_leave (dnd);
 
       return TRUE;
     }
-  else if (xev->xclient.message_type == XInternAtom (xdisplay, "XdndEnter", TRUE))
+  else if (xev->xclient.message_type ==
+           XInternAtom (xdisplay, "XdndEnter", TRUE))
     {
       meta_dnd_notify_dnd_enter (dnd);
 
       return TRUE;
     }
 
-    return FALSE;
+  return FALSE;
 }
 
 #ifdef HAVE_WAYLAND
@@ -206,9 +212,10 @@ meta_dnd_wayland_on_motion_event (ClutterActor *actor,
   g_return_if_fail (event != NULL);
 
   clutter_event_get_coords (event, &event_x, &event_y);
-  meta_dnd_notify_dnd_position_change (dnd, (int)event_x, (int)event_y);
+  meta_dnd_notify_dnd_position_change (dnd, (int) event_x, (int) event_y);
 
-  current_grab = meta_wayland_data_device_get_current_grab (&priv->wl_compositor->seat->data_device);
+  current_grab = meta_wayland_data_device_get_current_grab (
+    &priv->wl_compositor->seat->data_device);
   if (current_grab)
     meta_wayland_drag_grab_update_feedback_actor (current_grab, event);
 }
@@ -253,24 +260,28 @@ meta_dnd_wayland_handle_begin_modal (MetaCompositor *compositor)
   MetaDndPrivate *priv = meta_dnd_get_instance_private (dnd);
 
   if (priv->handler_id[0] == 0 &&
-      meta_wayland_data_device_get_current_grab (&wl_compositor->seat->data_device) != NULL)
+      meta_wayland_data_device_get_current_grab (&wl_compositor->seat->
+                                                 data_device) != NULL)
     {
       priv->compositor = compositor;
       priv->wl_compositor = wl_compositor;
 
       priv->handler_id[0] = g_signal_connect (compositor->stage,
                                               "motion-event",
-                                              G_CALLBACK (meta_dnd_wayland_on_motion_event),
+                                              G_CALLBACK (
+                                                meta_dnd_wayland_on_motion_event),
                                               dnd);
 
       priv->handler_id[1] = g_signal_connect (compositor->stage,
                                               "button-release-event",
-                                              G_CALLBACK (meta_dnd_wayland_on_button_released),
+                                              G_CALLBACK (
+                                                meta_dnd_wayland_on_button_released),
                                               dnd);
 
       priv->handler_id[2] = g_signal_connect (compositor->stage,
                                               "key-press-event",
-                                              G_CALLBACK (meta_dnd_wayland_on_key_pressed),
+                                              G_CALLBACK (
+                                                meta_dnd_wayland_on_key_pressed),
                                               dnd);
 
       meta_dnd_notify_dnd_enter (dnd);
@@ -289,7 +300,8 @@ meta_dnd_wayland_handle_end_modal (MetaCompositor *compositor)
 
   for (i = 0; i < G_N_ELEMENTS (priv->handler_id); i++)
     {
-      g_signal_handler_disconnect (priv->compositor->stage, priv->handler_id[i]);
+      g_signal_handler_disconnect (priv->compositor->stage,
+                                   priv->handler_id[i]);
       priv->handler_id[i] = 0;
     }
 
diff --git a/src/compositor/meta-feedback-actor.c b/src/compositor/meta-feedback-actor.c
index 0e98faba7..abac817a8 100644
--- a/src/compositor/meta-feedback-actor.c
+++ b/src/compositor/meta-feedback-actor.c
@@ -30,7 +30,8 @@
 #include "compositor/meta-feedback-actor-private.h"
 #include "core/display-private.h"
 
-enum {
+enum
+{
   PROP_ANCHOR_X = 1,
   PROP_ANCHOR_Y
 };
@@ -45,7 +46,8 @@ struct _MetaFeedbackActorPrivate
   int pos_y;
 };
 
-G_DEFINE_TYPE_WITH_PRIVATE (MetaFeedbackActor, meta_feedback_actor, CLUTTER_TYPE_ACTOR)
+G_DEFINE_TYPE_WITH_PRIVATE (MetaFeedbackActor, meta_feedback_actor,
+                            CLUTTER_TYPE_ACTOR)
 
 static void
 meta_feedback_actor_constructed (GObject *object)
@@ -60,7 +62,8 @@ meta_feedback_actor_constructed (GObject *object)
 static void
 meta_feedback_actor_update_position (MetaFeedbackActor *self)
 {
-  MetaFeedbackActorPrivate *priv = meta_feedback_actor_get_instance_private (self);
+  MetaFeedbackActorPrivate *priv = meta_feedback_actor_get_instance_private (
+    self);
 
   clutter_actor_set_position (CLUTTER_ACTOR (self),
                               priv->pos_x - priv->anchor_x,
@@ -74,7 +77,8 @@ meta_feedback_actor_set_property (GObject      *object,
                                   GParamSpec   *pspec)
 {
   MetaFeedbackActor *self = META_FEEDBACK_ACTOR (object);
-  MetaFeedbackActorPrivate *priv = meta_feedback_actor_get_instance_private (self);
+  MetaFeedbackActorPrivate *priv = meta_feedback_actor_get_instance_private (
+    self);
 
   switch (prop_id)
     {
@@ -93,13 +97,14 @@ meta_feedback_actor_set_property (GObject      *object,
 }
 
 static void
-meta_feedback_actor_get_property (GObject      *object,
-                                  guint         prop_id,
-                                  GValue       *value,
-                                  GParamSpec   *pspec)
+meta_feedback_actor_get_property (GObject    *object,
+                                  guint       prop_id,
+                                  GValue     *value,
+                                  GParamSpec *pspec)
 {
   MetaFeedbackActor *self = META_FEEDBACK_ACTOR (object);
-  MetaFeedbackActorPrivate *priv = meta_feedback_actor_get_instance_private (self);
+  MetaFeedbackActorPrivate *priv = meta_feedback_actor_get_instance_private (
+    self);
 
   switch (prop_id)
     {
@@ -220,9 +225,9 @@ meta_feedback_actor_get_anchor (MetaFeedbackActor *self,
 }
 
 void
-meta_feedback_actor_set_position (MetaFeedbackActor  *self,
-                                  int                 x,
-                                  int                 y)
+meta_feedback_actor_set_position (MetaFeedbackActor *self,
+                                  int                x,
+                                  int                y)
 {
   MetaFeedbackActorPrivate *priv;
 
diff --git a/src/compositor/meta-module.c b/src/compositor/meta-module.c
index 0283b4a9a..67afed65f 100644
--- a/src/compositor/meta-module.c
+++ b/src/compositor/meta-module.c
@@ -36,22 +36,22 @@ enum
 
 struct _MetaModulePrivate
 {
-  GModule      *lib;
-  gchar        *path;
-  GType         plugin_type;
+  GModule *lib;
+  gchar *path;
+  GType plugin_type;
 };
 
 #define META_MODULE_GET_PRIVATE(obj) \
-(G_TYPE_INSTANCE_GET_PRIVATE ((obj), META_TYPE_MODULE, MetaModulePrivate))
+  (G_TYPE_INSTANCE_GET_PRIVATE ((obj), META_TYPE_MODULE, MetaModulePrivate))
 
 G_DEFINE_TYPE_WITH_PRIVATE (MetaModule, meta_module, G_TYPE_TYPE_MODULE);
 
 static gboolean
 meta_module_load (GTypeModule *gmodule)
 {
-  MetaModulePrivate  *priv = META_MODULE (gmodule)->priv;
-  MetaPluginVersion  *info = NULL;
-  GType                (*register_type) (GTypeModule *) = NULL;
+  MetaModulePrivate *priv = META_MODULE (gmodule)->priv;
+  MetaPluginVersion *info = NULL;
+  GType (*register_type) (GTypeModule *) = NULL;
 
   if (priv->lib && priv->plugin_type)
     return TRUE;
@@ -67,13 +67,13 @@ meta_module_load (GTypeModule *gmodule)
     }
 
   if (g_module_symbol (priv->lib, "meta_plugin_version",
-                       (gpointer *)(void *)&info) &&
+                       (gpointer *) (void *) &info) &&
       g_module_symbol (priv->lib, "meta_plugin_register_type",
-                      (gpointer *)(void *)&register_type) &&
+                       (gpointer *) (void *) &register_type) &&
       info && register_type)
     {
       if (info->version_api != META_PLUGIN_API_VERSION)
-       g_warning ("Plugin API mismatch for [%s]", priv->path);
+        g_warning ("Plugin API mismatch for [%s]", priv->path);
       else
         {
           GType plugin_type;
@@ -86,7 +86,7 @@ meta_module_load (GTypeModule *gmodule)
             }
           else
             {
-              priv->plugin_type =  plugin_type;
+              priv->plugin_type = plugin_type;
             }
 
           return TRUE;
@@ -168,25 +168,25 @@ meta_module_get_property (GObject    *object,
 static void
 meta_module_class_init (MetaModuleClass *klass)
 {
-  GObjectClass     *gobject_class = G_OBJECT_CLASS (klass);
+  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
   GTypeModuleClass *gmodule_class = G_TYPE_MODULE_CLASS (klass);
 
-  gobject_class->finalize     = meta_module_finalize;
-  gobject_class->dispose      = meta_module_dispose;
+  gobject_class->finalize = meta_module_finalize;
+  gobject_class->dispose = meta_module_dispose;
   gobject_class->set_property = meta_module_set_property;
   gobject_class->get_property = meta_module_get_property;
 
-  gmodule_class->load         = meta_module_load;
-  gmodule_class->unload       = meta_module_unload;
+  gmodule_class->load = meta_module_load;
+  gmodule_class->unload = meta_module_unload;
 
   g_object_class_install_property (gobject_class,
-                                  PROP_PATH,
-                                  g_param_spec_string ("path",
-                                                       "Path",
-                                                       "Load path",
-                                                       NULL,
-                                                       G_PARAM_READWRITE |
-                                                     G_PARAM_CONSTRUCT_ONLY));
+                                   PROP_PATH,
+                                   g_param_spec_string ("path",
+                                                        "Path",
+                                                        "Load path",
+                                                        NULL,
+                                                        G_PARAM_READWRITE |
+                                                        G_PARAM_CONSTRUCT_ONLY));
 }
 
 static void
@@ -202,4 +202,3 @@ meta_module_get_plugin_type (MetaModule *module)
 
   return priv->plugin_type;
 }
-
diff --git a/src/compositor/meta-plugin-manager.c b/src/compositor/meta-plugin-manager.c
index 236b6b1d3..798ec08de 100644
--- a/src/compositor/meta-plugin-manager.c
+++ b/src/compositor/meta-plugin-manager.c
@@ -57,11 +57,11 @@ meta_plugin_manager_set_plugin_type (GType gtype)
  * Loads the given plugin.
  */
 void
-meta_plugin_manager_load (const gchar       *plugin_name)
+meta_plugin_manager_load (const gchar *plugin_name)
 {
   const gchar *dpath = MUTTER_PLUGIN_DIR "/";
-  gchar       *path;
-  MetaModule  *module;
+  gchar *path;
+  MetaModule *module;
 
   if (g_path_is_absolute (plugin_name))
     path = g_strdup (plugin_name);
@@ -76,7 +76,7 @@ meta_plugin_manager_load (const gchar       *plugin_name)
        * our untimely exit.
        */
       g_printerr ("Unable to load plugin module [%s]: %s",
-                  path, g_module_error());
+                  path, g_module_error ());
       exit (1);
     }
 
@@ -123,8 +123,8 @@ static void
 meta_plugin_manager_kill_window_effects (MetaPluginManager *plugin_mgr,
                                          MetaWindowActor   *actor)
 {
-  MetaPlugin        *plugin = plugin_mgr->plugin;
-  MetaPluginClass   *klass = META_PLUGIN_GET_CLASS (plugin);
+  MetaPlugin *plugin = plugin_mgr->plugin;
+  MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
 
   if (klass->kill_window_effects)
     klass->kill_window_effects (plugin, actor);
@@ -133,8 +133,8 @@ meta_plugin_manager_kill_window_effects (MetaPluginManager *plugin_mgr,
 static void
 meta_plugin_manager_kill_switch_workspace (MetaPluginManager *plugin_mgr)
 {
-  MetaPlugin        *plugin = plugin_mgr->plugin;
-  MetaPluginClass   *klass = META_PLUGIN_GET_CLASS (plugin);
+  MetaPlugin *plugin = plugin_mgr->plugin;
+  MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
 
   if (klass->kill_switch_workspace)
     klass->kill_switch_workspace (plugin);
@@ -234,7 +234,8 @@ meta_plugin_manager_event_size_change (MetaPluginManager *plugin_mgr,
     return FALSE;
 
   meta_plugin_manager_kill_window_effects (plugin_mgr, actor);
-  klass->size_change (plugin, actor, which_change, old_frame_rect, old_buffer_rect);
+  klass->size_change (plugin, actor, which_change, old_frame_rect,
+                      old_buffer_rect);
   return TRUE;
 }
 
@@ -247,10 +248,10 @@ meta_plugin_manager_event_size_change (MetaPluginManager *plugin_mgr,
  * appropriate post-effect cleanup is carried out.
  */
 gboolean
-meta_plugin_manager_switch_workspace (MetaPluginManager   *plugin_mgr,
-                                      gint                 from,
-                                      gint                 to,
-                                      MetaMotionDirection  direction)
+meta_plugin_manager_switch_workspace (MetaPluginManager  *plugin_mgr,
+                                      gint                from,
+                                      gint                to,
+                                      MetaMotionDirection direction)
 {
   MetaPlugin *plugin = plugin_mgr->plugin;
   MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
@@ -346,11 +347,11 @@ meta_plugin_manager_hide_tile_preview (MetaPluginManager *plugin_mgr)
 }
 
 void
-meta_plugin_manager_show_window_menu (MetaPluginManager  *plugin_mgr,
-                                      MetaWindow         *window,
-                                      MetaWindowMenuType  menu,
-                                      int                 x,
-                                      int                 y)
+meta_plugin_manager_show_window_menu (MetaPluginManager *plugin_mgr,
+                                      MetaWindow        *window,
+                                      MetaWindowMenuType menu,
+                                      int                x,
+                                      int                y)
 {
   MetaPlugin *plugin = plugin_mgr->plugin;
   MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
@@ -364,10 +365,10 @@ meta_plugin_manager_show_window_menu (MetaPluginManager  *plugin_mgr,
 }
 
 void
-meta_plugin_manager_show_window_menu_for_rect (MetaPluginManager  *plugin_mgr,
-                                               MetaWindow         *window,
-                                               MetaWindowMenuType  menu,
-                                              MetaRectangle      *rect)
+meta_plugin_manager_show_window_menu_for_rect (MetaPluginManager *plugin_mgr,
+                                               MetaWindow        *window,
+                                               MetaWindowMenuType menu,
+                                               MetaRectangle     *rect)
 {
   MetaPlugin *plugin = plugin_mgr->plugin;
   MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
@@ -394,8 +395,9 @@ meta_plugin_manager_create_close_dialog (MetaPluginManager *plugin_mgr,
 }
 
 MetaInhibitShortcutsDialog *
-meta_plugin_manager_create_inhibit_shortcuts_dialog (MetaPluginManager *plugin_mgr,
-                                                     MetaWindow        *window)
+meta_plugin_manager_create_inhibit_shortcuts_dialog (
+  MetaPluginManager *plugin_mgr,
+  MetaWindow        *window)
 {
   MetaPlugin *plugin = plugin_mgr->plugin;
   MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
diff --git a/src/compositor/meta-plugin.c b/src/compositor/meta-plugin.c
index b787652bc..9fe17cc87 100644
--- a/src/compositor/meta-plugin.c
+++ b/src/compositor/meta-plugin.c
@@ -51,7 +51,7 @@ struct _MetaPluginPrivate
 G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (MetaPlugin, meta_plugin, G_TYPE_OBJECT);
 
 #define META_PLUGIN_GET_PRIVATE(obj) \
-(G_TYPE_INSTANCE_GET_PRIVATE ((obj), META_TYPE_PLUGIN, MetaPluginPrivate))
+  (G_TYPE_INSTANCE_GET_PRIVATE ((obj), META_TYPE_PLUGIN, MetaPluginPrivate))
 
 static void
 meta_plugin_class_init (MetaPluginClass *klass)
@@ -67,7 +67,7 @@ meta_plugin_init (MetaPlugin *self)
 const MetaPluginInfo *
 meta_plugin_get_info (MetaPlugin *plugin)
 {
-  MetaPluginClass  *klass = META_PLUGIN_GET_CLASS (plugin);
+  MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
 
   if (klass && klass->plugin_info)
     return klass->plugin_info (plugin);
@@ -150,7 +150,8 @@ meta_plugin_destroy_completed (MetaPlugin      *plugin,
  * passive X grabs in Meta can trigger but not be handled by the normal
  * keybinding handling code.) However, the plugin can establish the keyboard
  * and/or mouse grabs ahead of time and pass in the
- * %META_MODAL_POINTER_ALREADY_GRABBED and/or %META_MODAL_KEYBOARD_ALREADY_GRABBED
+ * %META_MODAL_POINTER_ALREADY_GRABBED and/or
+ *%META_MODAL_KEYBOARD_ALREADY_GRABBED
  * options. This facility is provided for two reasons: first to allow using
  * this function to establish modality after a passive grab, and second to
  * allow using obscure features of XGrabPointer() and XGrabKeyboard() without
@@ -160,9 +161,9 @@ meta_plugin_destroy_completed (MetaPlugin      *plugin,
  *  mouse and made the plugin modal.
  */
 gboolean
-meta_plugin_begin_modal (MetaPlugin       *plugin,
-                         MetaModalOptions  options,
-                         guint32           timestamp)
+meta_plugin_begin_modal (MetaPlugin      *plugin,
+                         MetaModalOptions options,
+                         guint32          timestamp)
 {
   MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
 
diff --git a/src/compositor/meta-shadow-factory.c b/src/compositor/meta-shadow-factory.c
index 38594aebd..94a669ce3 100644
--- a/src/compositor/meta-shadow-factory.c
+++ b/src/compositor/meta-shadow-factory.c
@@ -19,7 +19,8 @@
 /**
  * SECTION:meta-shadow-factory
  * @title: MetaShadowFactory
- * @short_description: Create and cache shadow textures for abritrary window shapes
+ * @short_description: Create and cache shadow textures for abritrary window
+ *shapes
  */
 
 #include "config.h"
@@ -52,7 +53,7 @@
  * - We approximate the 1D gaussian blur as 3 successive box filters.
  */
 
-typedef struct _MetaShadowCacheKey  MetaShadowCacheKey;
+typedef struct _MetaShadowCacheKey MetaShadowCacheKey;
 typedef struct _MetaShadowClassInfo MetaShadowClassInfo;
 
 struct _MetaShadowCacheKey
@@ -122,18 +123,19 @@ static guint signals[LAST_SIGNAL] = { 0 };
 
 /* The first element in this array also defines the default parameters
  * for newly created classes */
-MetaShadowClassInfo default_shadow_classes[] = {
-  { "normal",       { 10, -1, 0, 3, 128 }, { 8, -1, 0, 2, 64 } },
-  { "dialog",       { 10, -1, 0, 3, 128 }, { 8, -1, 0, 2, 64 } },
+MetaShadowClassInfo default_shadow_classes[] =
+{
+  { "normal", { 10, -1, 0, 3, 128 }, { 8, -1, 0, 2, 64 } },
+  { "dialog", { 10, -1, 0, 3, 128 }, { 8, -1, 0, 2, 64 } },
   { "modal_dialog", { 10, -1, 0, 3, 128 }, { 8, -1, 0, 2, 64 } },
-  { "utility",      { 10, -1, 0, 3, 128 }, { 8, -1, 0, 2, 64 } },
-  { "border",       { 10, -1, 0, 3, 128 }, { 8, -1, 0, 2, 64 } },
-  { "menu",         { 10, -1, 0, 3, 128 }, { 8, -1, 0, 2, 64 } },
+  { "utility", { 10, -1, 0, 3, 128 }, { 8, -1, 0, 2, 64 } },
+  { "border", { 10, -1, 0, 3, 128 }, { 8, -1, 0, 2, 64 } },
+  { "menu", { 10, -1, 0, 3, 128 }, { 8, -1, 0, 2, 64 } },
 
-  { "popup-menu",    { 1, -1, 0, 0, 128 }, { 1, -1, 0, 0, 128 } },
+  { "popup-menu", { 1, -1, 0, 0, 128 }, { 1, -1, 0, 0, 128 } },
   { "dropdown-menu", { 1, -1, 0, 0, 128 }, { 1, -1, 0, 0, 128 } },
 
-  { "attached",      { 0, -1, 0, 0, 0 }, { 0, -1, 0, 0, 0 } }
+  { "attached", { 0, -1, 0, 0, 0 }, { 0, -1, 0, 0, 0 } }
 };
 
 G_DEFINE_TYPE (MetaShadowFactory, meta_shadow_factory, G_TYPE_OBJECT);
@@ -143,7 +145,8 @@ meta_shadow_cache_key_hash (gconstpointer val)
 {
   const MetaShadowCacheKey *key = val;
 
-  return 59 * key->radius + 67 * key->top_fade + 73 * meta_window_shape_hash (key->shape);
+  return 59 * key->radius + 67 * key->top_fade + 73 * meta_window_shape_hash (
+    key->shape);
 }
 
 static gboolean
@@ -153,7 +156,8 @@ meta_shadow_cache_key_equal (gconstpointer a,
   const MetaShadowCacheKey *key_a = a;
   const MetaShadowCacheKey *key_b = b;
 
-  return (key_a->radius == key_b->radius && key_a->top_fade == key_b->top_fade &&
+  return (key_a->radius == key_b->radius &&
+          key_a->top_fade == key_b->top_fade &&
           meta_window_shape_equal (key_a->shape, key_b->shape));
 }
 
@@ -231,8 +235,12 @@ meta_shadow_paint (MetaShadow     *shadow,
       n_x = 3;
 
       src_x[0] = 0.0;
-      src_x[1] = (shadow->inner_border_left + shadow->outer_border_left) / texture_width;
-      src_x[2] = (texture_width - (shadow->inner_border_right + shadow->outer_border_right)) / texture_width;
+      src_x[1] = (shadow->inner_border_left + shadow->outer_border_left) /
+                 texture_width;
+      src_x[2] =
+        (texture_width -
+         (shadow->inner_border_right + shadow->outer_border_right)) /
+        texture_width;
       src_x[3] = 1.0;
 
       dest_x[0] = window_x - shadow->outer_border_left;
@@ -256,8 +264,12 @@ meta_shadow_paint (MetaShadow     *shadow,
       n_y = 3;
 
       src_y[0] = 0.0;
-      src_y[1] = (shadow->inner_border_top + shadow->outer_border_top) / texture_height;
-      src_y[2] = (texture_height - (shadow->inner_border_bottom + shadow->outer_border_bottom)) / 
texture_height;
+      src_y[1] = (shadow->inner_border_top + shadow->outer_border_top) /
+                 texture_height;
+      src_y[2] =
+        (texture_height -
+         (shadow->inner_border_bottom + shadow->outer_border_bottom)) /
+        texture_height;
       src_y[3] = 1.0;
 
       dest_y[0] = window_y - shadow->outer_border_top;
@@ -330,22 +342,35 @@ meta_shadow_paint (MetaShadow     *shadow,
 
                   cairo_region_get_rectangle (intersection, k, &rect);
 
-                  /* Separately linear interpolate X and Y coordinates in the source
+                  /* Separately linear interpolate X and Y coordinates in the
+                   * source
                    * based on the destination X and Y coordinates */
 
-                  src_x1 = (src_x[i] * (dest_rect.x + dest_rect.width - rect.x) +
-                            src_x[i + 1] * (rect.x - dest_rect.x)) / dest_rect.width;
-                  src_x2 = (src_x[i] * (dest_rect.x + dest_rect.width - (rect.x + rect.width)) +
-                            src_x[i + 1] * (rect.x + rect.width - dest_rect.x)) / dest_rect.width;
-
-                  src_y1 = (src_y[j] * (dest_rect.y + dest_rect.height - rect.y) +
-                            src_y[j + 1] * (rect.y - dest_rect.y)) / dest_rect.height;
-                  src_y2 = (src_y[j] * (dest_rect.y + dest_rect.height - (rect.y + rect.height)) +
-                            src_y[j + 1] * (rect.y + rect.height - dest_rect.y)) / dest_rect.height;
+                  src_x1 =
+                    (src_x[i] * (dest_rect.x + dest_rect.width - rect.x) +
+                     src_x[i + 1] * (rect.x - dest_rect.x)) /
+                    dest_rect.width;
+                  src_x2 =
+                    (src_x[i] *
+                     (dest_rect.x + dest_rect.width - (rect.x + rect.width)) +
+                     src_x[i + 1] *
+                     (rect.x + rect.width - dest_rect.x)) / dest_rect.width;
+
+                  src_y1 =
+                    (src_y[j] * (dest_rect.y + dest_rect.height - rect.y) +
+                     src_y[j + 1] * (rect.y - dest_rect.y)) /
+                    dest_rect.height;
+                  src_y2 =
+                    (src_y[j] *
+                     (dest_rect.y + dest_rect.height - (rect.y + rect.height)) +
+                     src_y[j + 1] *
+                     (rect.y + rect.height - dest_rect.y)) / dest_rect.height;
 
                   cogl_rectangle_with_texture_coords (rect.x, rect.y,
-                                                      rect.x + rect.width, rect.y + rect.height,
-                                                      src_x1, src_y1, src_x2, src_y2);
+                                                      rect.x + rect.width,
+                                                      rect.y + rect.height,
+                                                      src_x1, src_y1, src_x2,
+                                                      src_y2);
                 }
 
               cairo_region_destroy (intersection);
@@ -375,14 +400,16 @@ meta_shadow_get_bounds  (MetaShadow            *shadow,
 {
   bounds->x = window_x - shadow->outer_border_left;
   bounds->y = window_y - shadow->outer_border_top;
-  bounds->width = window_width + shadow->outer_border_left + shadow->outer_border_right;
-  bounds->height = window_height + shadow->outer_border_top + shadow->outer_border_bottom;
+  bounds->width = window_width + shadow->outer_border_left +
+                  shadow->outer_border_right;
+  bounds->height = window_height + shadow->outer_border_top +
+                   shadow->outer_border_bottom;
 }
 
 static void
 meta_shadow_class_info_free (MetaShadowClassInfo *class_info)
 {
-  g_free ((char *)class_info->name);
+  g_free ((char *) class_info->name);
   g_slice_free (MetaShadowClassInfo, class_info);
 }
 
@@ -397,7 +424,7 @@ meta_shadow_factory_init (MetaShadowFactory *factory)
   factory->shadow_classes = g_hash_table_new_full (g_str_hash,
                                                    g_str_equal,
                                                    NULL,
-                                                   (GDestroyNotify)meta_shadow_class_info_free);
+                                                   (GDestroyNotify) meta_shadow_class_info_free);
 
   for (i = 0; i < G_N_ELEMENTS (default_shadow_classes); i++)
     {
@@ -407,7 +434,7 @@ meta_shadow_factory_init (MetaShadowFactory *factory)
       class_info->name = g_strdup (class_info->name);
 
       g_hash_table_insert (factory->shadow_classes,
-                           (char *)class_info->name, class_info);
+                           (char *) class_info->name, class_info);
     }
 }
 
@@ -487,7 +514,7 @@ meta_shadow_factory_get_default (void)
 static int
 get_box_filter_size (int radius)
 {
-  return (int)(0.5 + radius * (0.75 * sqrt(2*M_PI)));
+  return (int) (0.5 + radius * (0.75 * sqrt (2 * M_PI)));
 }
 
 /* The "spread" of the filter is the number of pixels from an original
@@ -566,13 +593,13 @@ blur_xspan (guchar *row,
 }
 
 static void
-blur_rows (cairo_region_t   *convolve_region,
-           int               x_offset,
-           int               y_offset,
-           guchar           *buffer,
-           int               buffer_width,
-           int               buffer_height,
-           int               d)
+blur_rows (cairo_region_t *convolve_region,
+           int             x_offset,
+           int             y_offset,
+           guchar         *buffer,
+           int             buffer_width,
+           int             buffer_height,
+           int             d)
 {
   int i, j;
   int n_rectangles;
@@ -650,8 +677,8 @@ flip_buffer (guchar *buffer,
       for (j0 = 0; j0 < height; j0 += BLOCK_SIZE)
         for (i0 = 0; i0 <= j0; i0 += BLOCK_SIZE)
           {
-            int max_j = MIN(j0 + BLOCK_SIZE, height);
-            int max_i = MIN(i0 + BLOCK_SIZE, width);
+            int max_j = MIN (j0 + BLOCK_SIZE, height);
+            int max_i = MIN (i0 + BLOCK_SIZE, width);
             int i, j;
 
             if (i0 == j0)
@@ -686,8 +713,8 @@ flip_buffer (guchar *buffer,
       for (i0 = 0; i0 < width; i0 += BLOCK_SIZE)
         for (j0 = 0; j0 < height; j0 += BLOCK_SIZE)
           {
-            int max_j = MIN(j0 + BLOCK_SIZE, height);
-            int max_i = MIN(i0 + BLOCK_SIZE, width);
+            int max_j = MIN (j0 + BLOCK_SIZE, height);
+            int max_i = MIN (i0 + BLOCK_SIZE, width);
             int i, j;
 
             for (i = i0; i < max_i; i++)
@@ -790,22 +817,45 @@ make_shadow (MetaShadow     *shadow,
   /* Step 6: fade out the top, if applicable */
   if (shadow->key.top_fade >= 0)
     {
-      for (j = y_offset; j < y_offset + MIN (shadow->key.top_fade, extents.height + 
shadow->outer_border_bottom); j++)
-        fade_bytes(buffer + j * buffer_width, buffer_width, j - y_offset, shadow->key.top_fade);
+      for (j = y_offset;
+           j <
+           y_offset +
+           MIN (shadow->key.top_fade,
+                extents.height + shadow->outer_border_bottom);
+           j++)
+        fade_bytes (buffer + j * buffer_width, buffer_width, j - y_offset,
+                    shadow->key.top_fade);
     }
 
-  /* We offset the passed in pixels to crop off the extra area we allocated at the top
-   * in the case of top_fade >= 0. We also account for padding at the left for symmetry
+  /* We offset the passed in pixels to crop off the extra area we allocated at
+   * the top
+   * in the case of top_fade >= 0. We also account for padding at the left for
+   *symmetry
    * though that doesn't currently occur.
    */
   shadow->texture = COGL_TEXTURE (cogl_texture_2d_new_from_data (ctx,
-                                                                 shadow->outer_border_left + extents.width + 
shadow->outer_border_right,
-                                                                 shadow->outer_border_top + extents.height + 
shadow->outer_border_bottom,
+                                                                 shadow->
+                                                                 outer_border_left
+                                                                 + extents.width
+                                                                 + shadow->
+                                                                 outer_border_right,
+                                                                 shadow->
+                                                                 outer_border_top
+                                                                 + extents.
+                                                                 height +
+                                                                 shadow->
+                                                                 outer_border_bottom,
                                                                  COGL_PIXEL_FORMAT_A_8,
                                                                  buffer_width,
                                                                  (buffer +
-                                                                  (y_offset - shadow->outer_border_top) * 
buffer_width +
-                                                                  (x_offset - shadow->outer_border_left)),
+                                                                  (y_offset -
+                                                                   shadow->
+                                                                   outer_border_top)
+                                                                  * buffer_width
+                                                                  +
+                                                                  (x_offset -
+                                                                   shadow->
+                                                                   outer_border_left)),
                                                                  &error));
 
   if (error)
@@ -827,8 +877,9 @@ get_shadow_params (MetaShadowFactory *factory,
                    gboolean           focused,
                    gboolean           create)
 {
-  MetaShadowClassInfo *class_info = g_hash_table_lookup (factory->shadow_classes,
-                                                         class_name);
+  MetaShadowClassInfo *class_info = g_hash_table_lookup (
+    factory->shadow_classes,
+    class_name);
   if (class_info == NULL)
     {
       if (create)
@@ -838,7 +889,7 @@ get_shadow_params (MetaShadowFactory *factory,
           class_info->name = g_strdup (class_info->name);
 
           g_hash_table_insert (factory->shadow_classes,
-                               (char *)class_info->name, class_info);
+                               (char *) class_info->name, class_info);
         }
       else
         {
@@ -883,9 +934,12 @@ meta_shadow_factory_get_shadow (MetaShadowFactory *factory,
   MetaShadow *shadow;
   cairo_region_t *region;
   int spread;
-  int shape_border_top, shape_border_right, shape_border_bottom, shape_border_left;
-  int inner_border_top, inner_border_right, inner_border_bottom, inner_border_left;
-  int outer_border_top, outer_border_right, outer_border_bottom, outer_border_left;
+  int shape_border_top, shape_border_right, shape_border_bottom,
+      shape_border_left;
+  int inner_border_top, inner_border_right, inner_border_bottom,
+      inner_border_left;
+  int outer_border_top, outer_border_right, outer_border_bottom,
+      outer_border_left;
   gboolean scale_width, scale_height;
   gboolean cacheable;
   int center_width, center_height;
@@ -969,13 +1023,15 @@ meta_shadow_factory_get_shadow (MetaShadowFactory *factory,
 
   shadow->scale_width = scale_width;
   if (scale_width)
-    center_width = inner_border_left + inner_border_right - (shape_border_left + shape_border_right);
+    center_width = inner_border_left + inner_border_right -
+                   (shape_border_left + shape_border_right);
   else
     center_width = width - (shape_border_left + shape_border_right);
 
   shadow->scale_height = scale_height;
   if (scale_height)
-    center_height = inner_border_top + inner_border_bottom - (shape_border_top + shape_border_bottom);
+    center_height = inner_border_top + inner_border_bottom -
+                    (shape_border_top + shape_border_bottom);
   else
     center_height = height - (shape_border_top + shape_border_bottom);
 
@@ -1034,7 +1090,8 @@ meta_shadow_factory_set_params (MetaShadowFactory *factory,
  * @factory: a #MetaShadowFactory
  * @class_name: name of the class of shadow to get the params for
  * @focused: whether the shadow is for a focused window
- * @params: (out caller-allocates): location to store the current parameter values
+ * @params: (out caller-allocates): location to store the current parameter
+ *values
  *
  * Gets the shadow parameters for a particular class of shadows
  * for either the focused or unfocused state. If the class name
diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c
index 919e7a9b5..077d3ee72 100644
--- a/src/compositor/meta-shaped-texture.c
+++ b/src/compositor/meta-shaped-texture.c
@@ -52,9 +52,9 @@
  */
 #define MIN_FAST_UPDATES_BEFORE_UNMIPMAP 20
 
-static void meta_shaped_texture_dispose  (GObject    *object);
+static void meta_shaped_texture_dispose (GObject *object);
 
-static void meta_shaped_texture_paint (ClutterActor       *actor);
+static void meta_shaped_texture_paint (ClutterActor *actor);
 
 static void meta_shaped_texture_get_preferred_width (ClutterActor *self,
                                                      gfloat        for_height,
@@ -66,7 +66,8 @@ static void meta_shaped_texture_get_preferred_height (ClutterActor *self,
                                                       gfloat       *min_height_p,
                                                       gfloat       *natural_height_p);
 
-static gboolean meta_shaped_texture_get_paint_volume (ClutterActor *self, ClutterPaintVolume *volume);
+static gboolean meta_shaped_texture_get_paint_volume (ClutterActor       *self,
+                                                      ClutterPaintVolume *volume);
 
 static void cullable_iface_init (MetaCullableInterface *iface);
 
@@ -74,7 +75,8 @@ static void cullable_iface_init (MetaCullableInterface *iface);
   (G_TYPE_INSTANCE_GET_PRIVATE ((obj), META_TYPE_SHAPED_TEXTURE, \
                                 MetaShapedTexturePrivate))
 
-enum {
+enum
+{
   SIZE_CHANGED,
 
   LAST_SIGNAL,
@@ -114,9 +116,11 @@ struct _MetaShapedTexturePrivate
   guint create_mipmaps : 1;
 };
 
-G_DEFINE_TYPE_WITH_CODE (MetaShapedTexture, meta_shaped_texture, CLUTTER_TYPE_ACTOR,
+G_DEFINE_TYPE_WITH_CODE (MetaShapedTexture, meta_shaped_texture,
+                         CLUTTER_TYPE_ACTOR,
                          G_ADD_PRIVATE (MetaShapedTexture)
-                         G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE, cullable_iface_init));
+                         G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE,
+                                                cullable_iface_init));
 
 static void
 meta_shaped_texture_class_init (MetaShapedTextureClass *klass)
@@ -488,7 +492,9 @@ meta_shaped_texture_paint (ClutterActor *actor)
   if (tex_width == 0 || tex_height == 0) /* no contents yet */
     return;
 
-  tex_rect = (cairo_rectangle_int_t) { 0, 0, tex_width, tex_height };
+  tex_rect = (cairo_rectangle_int_t) {
+    0, 0, tex_width, tex_height
+  };
 
   /* Use nearest-pixel interpolation if the texture is unscaled. This
    * improves performance, especially with software rendering.
@@ -621,7 +627,8 @@ meta_shaped_texture_paint (ClutterActor *actor)
       else
         {
           blended_pipeline = get_masked_pipeline (stex, ctx);
-          cogl_pipeline_set_layer_texture (blended_pipeline, 1, priv->mask_texture);
+          cogl_pipeline_set_layer_texture (blended_pipeline, 1,
+                                           priv->mask_texture);
           cogl_pipeline_set_layer_filters (blended_pipeline, 1, filter, filter);
         }
 
@@ -724,7 +731,7 @@ effective_unobscured_region (MetaShapedTexture *self)
 }
 
 static gboolean
-meta_shaped_texture_get_paint_volume (ClutterActor *actor,
+meta_shaped_texture_get_paint_volume (ClutterActor       *actor,
                                       ClutterPaintVolume *volume)
 {
   return clutter_paint_volume_set_from_allocation (volume, actor);
@@ -732,7 +739,7 @@ meta_shaped_texture_get_paint_volume (ClutterActor *actor,
 
 void
 meta_shaped_texture_set_create_mipmaps (MetaShapedTexture *stex,
-                                       gboolean           create_mipmaps)
+                                        gboolean           create_mipmaps)
 {
   MetaShapedTexturePrivate *priv;
 
@@ -798,10 +805,10 @@ meta_shaped_texture_is_obscured (MetaShapedTexture *self)
  */
 gboolean
 meta_shaped_texture_update_area (MetaShapedTexture *stex,
-                                int                x,
-                                int                y,
-                                int                width,
-                                int                height)
+                                 int                x,
+                                 int                y,
+                                 int                width,
+                                 int                height)
 {
   MetaShapedTexturePrivate *priv;
   cairo_region_t *unobscured_region;
@@ -843,7 +850,8 @@ meta_shaped_texture_update_area (MetaShapedTexture *stex,
         {
           cairo_rectangle_int_t damage_rect;
           cairo_region_get_extents (intersection, &damage_rect);
-          clutter_actor_queue_redraw_with_clip (CLUTTER_ACTOR (stex), &damage_rect);
+          clutter_actor_queue_redraw_with_clip (CLUTTER_ACTOR (
+                                                  stex), &damage_rect);
           cairo_region_destroy (intersection);
           return TRUE;
         }
@@ -1032,8 +1040,10 @@ meta_shaped_texture_get_image (MetaShapedTexture     *stex,
                                                           clip->height);
 
       mask_surface = cairo_image_surface_create (CAIRO_FORMAT_A8,
-                                                 cogl_texture_get_width (mask_texture),
-                                                 cogl_texture_get_height (mask_texture));
+                                                 cogl_texture_get_width (
+                                                   mask_texture),
+                                                 cogl_texture_get_height (
+                                                   mask_texture));
 
       cogl_texture_get_data (mask_texture, COGL_PIXEL_FORMAT_A_8,
                              cairo_image_surface_get_stride (mask_surface),
diff --git a/src/compositor/meta-surface-actor-wayland.c b/src/compositor/meta-surface-actor-wayland.c
index a099cef72..d8505f045 100644
--- a/src/compositor/meta-surface-actor-wayland.c
+++ b/src/compositor/meta-surface-actor-wayland.c
@@ -91,9 +91,10 @@ meta_surface_actor_wayland_is_unredirected (MetaSurfaceActor *actor)
 
 void
 meta_surface_actor_wayland_add_frame_callbacks (MetaSurfaceActorWayland *self,
-                                                struct wl_list *frame_callbacks)
+                                                struct wl_list          *frame_callbacks)
 {
-  MetaSurfaceActorWaylandPrivate *priv = meta_surface_actor_wayland_get_instance_private (self);
+  MetaSurfaceActorWaylandPrivate *priv =
+    meta_surface_actor_wayland_get_instance_private (self);
 
   wl_list_insert_list (&priv->frame_callback_list, frame_callbacks);
 }
@@ -128,7 +129,7 @@ meta_surface_actor_wayland_get_preferred_width  (ClutterActor *actor,
                                      natural_width_p);
 
   if (min_width_p)
-     *min_width_p *= scale;
+    *min_width_p *= scale;
 
   if (natural_width_p)
     *natural_width_p *= scale;
@@ -152,7 +153,7 @@ meta_surface_actor_wayland_get_preferred_height  (ClutterActor *actor,
                                       natural_height_p);
 
   if (min_height_p)
-     *min_height_p *= scale;
+    *min_height_p *= scale;
 
   if (natural_height_p)
     *natural_height_p *= scale;
@@ -169,7 +170,8 @@ meta_surface_actor_wayland_paint (ClutterActor *actor)
     {
       MetaWaylandCompositor *compositor = priv->surface->compositor;
 
-      wl_list_insert_list (&compositor->frame_callbacks, &priv->frame_callback_list);
+      wl_list_insert_list (&compositor->frame_callbacks,
+                           &priv->frame_callback_list);
       wl_list_init (&priv->frame_callback_list);
     }
 
@@ -195,7 +197,7 @@ meta_surface_actor_wayland_dispose (GObject *object)
     }
 
   wl_list_for_each_safe (cb, next, &priv->frame_callback_list, link)
-    wl_resource_destroy (cb->resource);
+  wl_resource_destroy (cb->resource);
 
   G_OBJECT_CLASS (meta_surface_actor_wayland_parent_class)->dispose (object);
 }
@@ -207,17 +209,23 @@ meta_surface_actor_wayland_class_init (MetaSurfaceActorWaylandClass *klass)
   ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-  actor_class->get_preferred_width = meta_surface_actor_wayland_get_preferred_width;
-  actor_class->get_preferred_height = meta_surface_actor_wayland_get_preferred_height;
+  actor_class->get_preferred_width =
+    meta_surface_actor_wayland_get_preferred_width;
+  actor_class->get_preferred_height =
+    meta_surface_actor_wayland_get_preferred_height;
   actor_class->paint = meta_surface_actor_wayland_paint;
 
-  surface_actor_class->process_damage = meta_surface_actor_wayland_process_damage;
+  surface_actor_class->process_damage =
+    meta_surface_actor_wayland_process_damage;
   surface_actor_class->pre_paint = meta_surface_actor_wayland_pre_paint;
   surface_actor_class->is_visible = meta_surface_actor_wayland_is_visible;
 
-  surface_actor_class->should_unredirect = meta_surface_actor_wayland_should_unredirect;
-  surface_actor_class->set_unredirected = meta_surface_actor_wayland_set_unredirected;
-  surface_actor_class->is_unredirected = meta_surface_actor_wayland_is_unredirected;
+  surface_actor_class->should_unredirect =
+    meta_surface_actor_wayland_should_unredirect;
+  surface_actor_class->set_unredirected =
+    meta_surface_actor_wayland_set_unredirected;
+  surface_actor_class->is_unredirected =
+    meta_surface_actor_wayland_is_unredirected;
 
   surface_actor_class->get_window = meta_surface_actor_wayland_get_window;
 
@@ -232,8 +240,10 @@ meta_surface_actor_wayland_init (MetaSurfaceActorWayland *self)
 MetaSurfaceActor *
 meta_surface_actor_wayland_new (MetaWaylandSurface *surface)
 {
-  MetaSurfaceActorWayland *self = g_object_new (META_TYPE_SURFACE_ACTOR_WAYLAND, NULL);
-  MetaSurfaceActorWaylandPrivate *priv = meta_surface_actor_wayland_get_instance_private (self);
+  MetaSurfaceActorWayland *self = g_object_new (META_TYPE_SURFACE_ACTOR_WAYLAND,
+                                                NULL);
+  MetaSurfaceActorWaylandPrivate *priv =
+    meta_surface_actor_wayland_get_instance_private (self);
 
   g_assert (meta_is_wayland_compositor ());
 
@@ -248,6 +258,7 @@ meta_surface_actor_wayland_new (MetaWaylandSurface *surface)
 MetaWaylandSurface *
 meta_surface_actor_wayland_get_surface (MetaSurfaceActorWayland *self)
 {
-  MetaSurfaceActorWaylandPrivate *priv = meta_surface_actor_wayland_get_instance_private (self);
+  MetaSurfaceActorWaylandPrivate *priv =
+    meta_surface_actor_wayland_get_instance_private (self);
   return priv->surface;
 }
diff --git a/src/compositor/meta-surface-actor-x11.c b/src/compositor/meta-surface-actor-x11.c
index 1f897be3f..adaa61777 100644
--- a/src/compositor/meta-surface-actor-x11.c
+++ b/src/compositor/meta-surface-actor-x11.c
@@ -62,12 +62,14 @@ struct _MetaSurfaceActorX11Private
 };
 typedef struct _MetaSurfaceActorX11Private MetaSurfaceActorX11Private;
 
-G_DEFINE_TYPE_WITH_PRIVATE (MetaSurfaceActorX11, meta_surface_actor_x11, META_TYPE_SURFACE_ACTOR)
+G_DEFINE_TYPE_WITH_PRIVATE (MetaSurfaceActorX11, meta_surface_actor_x11,
+                            META_TYPE_SURFACE_ACTOR)
 
 static void
 free_damage (MetaSurfaceActorX11 *self)
 {
-  MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
+  MetaSurfaceActorX11Private *priv =
+    meta_surface_actor_x11_get_instance_private (self);
   MetaDisplay *display = priv->display;
   Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
 
@@ -83,16 +85,20 @@ free_damage (MetaSurfaceActorX11 *self)
 static void
 detach_pixmap (MetaSurfaceActorX11 *self)
 {
-  MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
+  MetaSurfaceActorX11Private *priv =
+    meta_surface_actor_x11_get_instance_private (self);
   MetaDisplay *display = priv->display;
   Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
-  MetaShapedTexture *stex = meta_surface_actor_get_texture (META_SURFACE_ACTOR (self));
+  MetaShapedTexture *stex =
+    meta_surface_actor_get_texture (META_SURFACE_ACTOR (self));
 
   if (priv->pixmap == None)
     return;
 
-  /* Get rid of all references to the pixmap before freeing it; it's unclear whether
-   * you are supposed to be able to free a GLXPixmap after freeing the underlying
+  /* Get rid of all references to the pixmap before freeing it; it's unclear
+   * whether
+   * you are supposed to be able to free a GLXPixmap after freeing the
+   *underlying
    * pixmap, but it certainly doesn't work with current DRI/Mesa
    */
   meta_shaped_texture_set_texture (stex, NULL);
@@ -110,24 +116,30 @@ static void
 set_pixmap (MetaSurfaceActorX11 *self,
             Pixmap               pixmap)
 {
-  MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
+  MetaSurfaceActorX11Private *priv =
+    meta_surface_actor_x11_get_instance_private (self);
 
-  CoglContext *ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
-  MetaShapedTexture *stex = meta_surface_actor_get_texture (META_SURFACE_ACTOR (self));
+  CoglContext *ctx = clutter_backend_get_cogl_context (
+    clutter_get_default_backend ());
+  MetaShapedTexture *stex =
+    meta_surface_actor_get_texture (META_SURFACE_ACTOR (self));
   CoglError *error = NULL;
   CoglTexture *texture;
 
   g_assert (priv->pixmap == None);
   priv->pixmap = pixmap;
 
-  texture = COGL_TEXTURE (cogl_texture_pixmap_x11_new (ctx, priv->pixmap, FALSE, &error));
+  texture =
+    COGL_TEXTURE (cogl_texture_pixmap_x11_new (ctx, priv->pixmap, FALSE,
+                                               &error));
 
   if (error != NULL)
     {
       g_warning ("Failed to allocate stex texture: %s", error->message);
       cogl_error_free (error);
     }
-  else if (G_UNLIKELY (!cogl_texture_pixmap_x11_is_using_tfp_extension (COGL_TEXTURE_PIXMAP_X11 (texture))))
+  else if (G_UNLIKELY (!cogl_texture_pixmap_x11_is_using_tfp_extension (
+                         COGL_TEXTURE_PIXMAP_X11 (texture))))
     g_warning ("NOTE: Not using GLX TFP!\n");
 
   priv->texture = texture;
@@ -137,7 +149,8 @@ set_pixmap (MetaSurfaceActorX11 *self,
 static void
 update_pixmap (MetaSurfaceActorX11 *self)
 {
-  MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
+  MetaSurfaceActorX11Private *priv =
+    meta_surface_actor_x11_get_instance_private (self);
   MetaDisplay *display = priv->display;
   Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
 
@@ -181,7 +194,8 @@ update_pixmap (MetaSurfaceActorX11 *self)
 static gboolean
 is_visible (MetaSurfaceActorX11 *self)
 {
-  MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
+  MetaSurfaceActorX11Private *priv =
+    meta_surface_actor_x11_get_instance_private (self);
   return (priv->pixmap != None) && !priv->unredirected;
 }
 
@@ -190,11 +204,13 @@ meta_surface_actor_x11_process_damage (MetaSurfaceActor *actor,
                                        int x, int y, int width, int height)
 {
   MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (actor);
-  MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
+  MetaSurfaceActorX11Private *priv =
+    meta_surface_actor_x11_get_instance_private (self);
 
   priv->received_damage = TRUE;
 
-  if (meta_window_is_fullscreen (priv->window) && !priv->unredirected && !priv->does_full_damage)
+  if (meta_window_is_fullscreen (priv->window) && !priv->unredirected &&
+      !priv->does_full_damage)
     {
       MetaRectangle window_rect;
       meta_window_get_frame_rect (priv->window, &window_rect);
@@ -222,7 +238,8 @@ static void
 meta_surface_actor_x11_pre_paint (MetaSurfaceActor *actor)
 {
   MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (actor);
-  MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
+  MetaSurfaceActorX11Private *priv =
+    meta_surface_actor_x11_get_instance_private (self);
   MetaDisplay *display = priv->display;
   Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
 
@@ -249,7 +266,8 @@ static gboolean
 meta_surface_actor_x11_is_opaque (MetaSurfaceActor *actor)
 {
   MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (actor);
-  MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
+  MetaSurfaceActorX11Private *priv =
+    meta_surface_actor_x11_get_instance_private (self);
 
   /* If we're not ARGB32, then we're opaque. */
   if (!meta_surface_actor_is_argb32 (actor))
@@ -266,7 +284,8 @@ meta_surface_actor_x11_is_opaque (MetaSurfaceActor *actor)
   meta_window_get_client_area_rect (window, &client_area);
 
   /* Otherwise, check if our opaque region covers our entire surface. */
-  if (cairo_region_contains_rectangle (opaque_region, &client_area) == CAIRO_REGION_OVERLAP_IN)
+  if (cairo_region_contains_rectangle (opaque_region,
+                                       &client_area) == CAIRO_REGION_OVERLAP_IN)
     return TRUE;
 
   return FALSE;
@@ -276,7 +295,8 @@ static gboolean
 meta_surface_actor_x11_should_unredirect (MetaSurfaceActor *actor)
 {
   MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (actor);
-  MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
+  MetaSurfaceActorX11Private *priv =
+    meta_surface_actor_x11_get_instance_private (self);
 
   MetaWindow *window = priv->window;
 
@@ -310,7 +330,8 @@ meta_surface_actor_x11_should_unredirect (MetaSurfaceActor *actor)
 static void
 sync_unredirected (MetaSurfaceActorX11 *self)
 {
-  MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
+  MetaSurfaceActorX11Private *priv =
+    meta_surface_actor_x11_get_instance_private (self);
   MetaDisplay *display = priv->display;
   Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
   Window xwindow = meta_window_x11_get_toplevel_xwindow (priv->window);
@@ -335,7 +356,8 @@ meta_surface_actor_x11_set_unredirected (MetaSurfaceActor *actor,
                                          gboolean          unredirected)
 {
   MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (actor);
-  MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
+  MetaSurfaceActorX11Private *priv =
+    meta_surface_actor_x11_get_instance_private (self);
 
   if (priv->unredirected == unredirected)
     return;
@@ -348,7 +370,8 @@ static gboolean
 meta_surface_actor_x11_is_unredirected (MetaSurfaceActor *actor)
 {
   MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (actor);
-  MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
+  MetaSurfaceActorX11Private *priv =
+    meta_surface_actor_x11_get_instance_private (self);
 
   return priv->unredirected;
 }
@@ -367,7 +390,8 @@ meta_surface_actor_x11_dispose (GObject *object)
 static MetaWindow *
 meta_surface_actor_x11_get_window (MetaSurfaceActor *actor)
 {
-  MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (META_SURFACE_ACTOR_X11 
(actor));
+  MetaSurfaceActorX11Private *priv =
+    meta_surface_actor_x11_get_instance_private (META_SURFACE_ACTOR_X11 (actor));
 
   return priv->window;
 }
@@ -384,8 +408,10 @@ meta_surface_actor_x11_class_init (MetaSurfaceActorX11Class *klass)
   surface_actor_class->pre_paint = meta_surface_actor_x11_pre_paint;
   surface_actor_class->is_visible = meta_surface_actor_x11_is_visible;
 
-  surface_actor_class->should_unredirect = meta_surface_actor_x11_should_unredirect;
-  surface_actor_class->set_unredirected = meta_surface_actor_x11_set_unredirected;
+  surface_actor_class->should_unredirect =
+    meta_surface_actor_x11_should_unredirect;
+  surface_actor_class->set_unredirected =
+    meta_surface_actor_x11_set_unredirected;
   surface_actor_class->is_unredirected = meta_surface_actor_x11_is_unredirected;
 
   surface_actor_class->get_window = meta_surface_actor_x11_get_window;
@@ -394,7 +420,8 @@ meta_surface_actor_x11_class_init (MetaSurfaceActorX11Class *klass)
 static void
 meta_surface_actor_x11_init (MetaSurfaceActorX11 *self)
 {
-  MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
+  MetaSurfaceActorX11Private *priv =
+    meta_surface_actor_x11_get_instance_private (self);
 
   priv->last_width = -1;
   priv->last_height = -1;
@@ -403,8 +430,10 @@ meta_surface_actor_x11_init (MetaSurfaceActorX11 *self)
 static void
 create_damage (MetaSurfaceActorX11 *self)
 {
-  MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
-  Display *xdisplay = meta_x11_display_get_xdisplay (priv->display->x11_display);
+  MetaSurfaceActorX11Private *priv =
+    meta_surface_actor_x11_get_instance_private (self);
+  Display *xdisplay =
+    meta_x11_display_get_xdisplay (priv->display->x11_display);
   Window xwindow = meta_window_x11_get_toplevel_xwindow (priv->window);
 
   priv->damage = XDamageCreate (xdisplay, xwindow, XDamageReportBoundingBox);
@@ -425,8 +454,10 @@ window_decorated_notify (MetaWindow *window,
 static void
 reset_texture (MetaSurfaceActorX11 *self)
 {
-  MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
-  MetaShapedTexture *stex = meta_surface_actor_get_texture (META_SURFACE_ACTOR (self));
+  MetaSurfaceActorX11Private *priv =
+    meta_surface_actor_x11_get_instance_private (self);
+  MetaShapedTexture *stex =
+    meta_surface_actor_get_texture (META_SURFACE_ACTOR (self));
 
   if (!priv->texture)
     return;
@@ -442,7 +473,8 @@ MetaSurfaceActor *
 meta_surface_actor_x11_new (MetaWindow *window)
 {
   MetaSurfaceActorX11 *self = g_object_new (META_TYPE_SURFACE_ACTOR_X11, NULL);
-  MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
+  MetaSurfaceActorX11Private *priv =
+    meta_surface_actor_x11_get_instance_private (self);
   MetaDisplay *display = meta_window_get_display (window);
 
   g_assert (!meta_is_wayland_compositor ());
@@ -468,8 +500,10 @@ void
 meta_surface_actor_x11_set_size (MetaSurfaceActorX11 *self,
                                  int width, int height)
 {
-  MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
-  MetaShapedTexture *stex = meta_surface_actor_get_texture (META_SURFACE_ACTOR (self));
+  MetaSurfaceActorX11Private *priv =
+    meta_surface_actor_x11_get_instance_private (self);
+  MetaShapedTexture *stex =
+    meta_surface_actor_get_texture (META_SURFACE_ACTOR (self));
 
   if (priv->last_width == width &&
       priv->last_height == height)
diff --git a/src/compositor/meta-surface-actor.c b/src/compositor/meta-surface-actor.c
index 256215373..67ae5e61a 100644
--- a/src/compositor/meta-surface-actor.c
+++ b/src/compositor/meta-surface-actor.c
@@ -31,11 +31,14 @@ struct _MetaSurfaceActorPrivate
 
 static void cullable_iface_init (MetaCullableInterface *iface);
 
-G_DEFINE_ABSTRACT_TYPE_WITH_CODE (MetaSurfaceActor, meta_surface_actor, CLUTTER_TYPE_ACTOR,
+G_DEFINE_ABSTRACT_TYPE_WITH_CODE (MetaSurfaceActor, meta_surface_actor,
+                                  CLUTTER_TYPE_ACTOR,
                                   G_ADD_PRIVATE (MetaSurfaceActor)
-                                  G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE, cullable_iface_init));
+                                  G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE,
+                                                         cullable_iface_init));
 
-enum {
+enum
+{
   REPAINT_SCHEDULED,
   SIZE_CHANGED,
 
@@ -88,7 +91,8 @@ meta_surface_actor_pick (ClutterActor       *actor,
       ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
       fb = cogl_get_draw_framebuffer ();
 
-      cogl_color_init_from_4ub (&cogl_color, color->red, color->green, color->blue, color->alpha);
+      cogl_color_init_from_4ub (&cogl_color, color->red, color->green,
+                                color->blue, color->alpha);
 
       pipeline = cogl_pipeline_new (ctx);
       cogl_pipeline_set_color (pipeline, &cogl_color);
@@ -277,7 +281,10 @@ meta_surface_actor_process_damage (MetaSurfaceActor *self,
        * any drawing done to the window is always immediately reflected in the
        * texture regardless of damage event handling.
        */
-      cairo_rectangle_int_t rect = { .x = x, .y = y, .width = width, .height = height };
+      cairo_rectangle_int_t rect =
+      {
+        .x = x, .y = y, .width = width, .height = height
+      };
 
       if (!priv->pending_damage)
         priv->pending_damage = cairo_region_create_rectangle (&rect);
@@ -286,7 +293,8 @@ meta_surface_actor_process_damage (MetaSurfaceActor *self,
       return;
     }
 
-  META_SURFACE_ACTOR_GET_CLASS (self)->process_damage (self, x, y, width, height);
+  META_SURFACE_ACTOR_GET_CLASS (self)->process_damage (self, x, y, width,
+                                                       height);
 
   if (meta_surface_actor_is_visible (self))
     meta_surface_actor_update_area (self, x, y, width, height);
@@ -348,7 +356,8 @@ meta_surface_actor_set_frozen (MetaSurfaceActor *self,
       int i, n_rects = cairo_region_num_rectangles (priv->pending_damage);
       cairo_rectangle_int_t rect;
 
-      /* Since we ignore damage events while a window is frozen for certain effects
+      /* Since we ignore damage events while a window is frozen for certain
+       * effects
        * we need to apply the tracked damage now. */
 
       for (i = 0; i < n_rects; i++)
diff --git a/src/compositor/meta-sync-ring.c b/src/compositor/meta-sync-ring.c
index c354992cf..7cd3e827f 100644
--- a/src/compositor/meta-sync-ring.c
+++ b/src/compositor/meta-sync-ring.c
@@ -104,23 +104,23 @@ static MetaSyncRing meta_sync_ring = { 0 };
 static XSyncValue SYNC_VALUE_ZERO;
 static XSyncValue SYNC_VALUE_ONE;
 
-static const char*      (*meta_gl_get_string) (GLenum name);
-static void             (*meta_gl_get_integerv) (GLenum  pname,
-                                                 GLint  *params);
-static const char*      (*meta_gl_get_stringi) (GLenum name,
-                                                GLuint index);
-static void             (*meta_gl_delete_sync) (GLsync sync);
-static GLenum           (*meta_gl_client_wait_sync) (GLsync sync,
-                                                     GLbitfield flags,
-                                                     GLuint64 timeout);
-static void             (*meta_gl_wait_sync) (GLsync sync,
-                                              GLbitfield flags,
-                                              GLuint64 timeout);
-static GLsync           (*meta_gl_import_sync) (GLenum external_sync_type,
-                                                GLintptr external_sync,
-                                                GLbitfield flags);
-static GLsync           (*meta_gl_fence_sync) (GLenum condition,
-                                               GLbitfield flags);
+static const char *      (*meta_gl_get_string) (GLenum name);
+static void (*meta_gl_get_integerv) (GLenum pname,
+                                     GLint *params);
+static const char *      (*meta_gl_get_stringi) (GLenum name,
+                                                 GLuint index);
+static void (*meta_gl_delete_sync) (GLsync sync);
+static GLenum (*meta_gl_client_wait_sync) (GLsync     sync,
+                                           GLbitfield flags,
+                                           GLuint64   timeout);
+static void (*meta_gl_wait_sync) (GLsync     sync,
+                                  GLbitfield flags,
+                                  GLuint64   timeout);
+static GLsync (*meta_gl_import_sync) (GLenum     external_sync_type,
+                                      GLintptr   external_sync,
+                                      GLbitfield flags);
+static GLsync (*meta_gl_fence_sync) (GLenum     condition,
+                                     GLbitfield flags);
 
 static MetaSyncRing *
 meta_sync_ring_get (void)
@@ -132,13 +132,14 @@ meta_sync_ring_get (void)
 }
 
 static gboolean
-load_gl_symbol (const char  *name,
-                void       **func)
+load_gl_symbol (const char *name,
+                void      **func)
 {
   *func = cogl_get_proc_address (name);
   if (!*func)
     {
-      meta_verbose ("MetaSyncRing: failed to resolve required GL symbol \"%s\"\n", name);
+      meta_verbose (
+        "MetaSyncRing: failed to resolve required GL symbol \"%s\"\n", name);
       return FALSE;
     }
   return TRUE;
@@ -160,32 +161,32 @@ check_gl_extensions (void)
   switch (cogl_renderer_get_driver (cogl_renderer))
     {
     case COGL_DRIVER_GL3:
-      {
-        int num_extensions, i;
-        gboolean arb_sync = FALSE;
-        gboolean x11_sync_object = FALSE;
+    {
+      int num_extensions, i;
+      gboolean arb_sync = FALSE;
+      gboolean x11_sync_object = FALSE;
 
-        meta_gl_get_integerv (GL_NUM_EXTENSIONS, &num_extensions);
+      meta_gl_get_integerv (GL_NUM_EXTENSIONS, &num_extensions);
 
-        for (i = 0; i < num_extensions; ++i)
-          {
-            const char *ext = meta_gl_get_stringi (GL_EXTENSIONS, i);
+      for (i = 0; i < num_extensions; ++i)
+        {
+          const char *ext = meta_gl_get_stringi (GL_EXTENSIONS, i);
 
-            if (g_strcmp0 ("GL_ARB_sync", ext) == 0)
-              arb_sync = TRUE;
-            else if (g_strcmp0 ("GL_EXT_x11_sync_object", ext) == 0)
-              x11_sync_object = TRUE;
-          }
+          if (g_strcmp0 ("GL_ARB_sync", ext) == 0)
+            arb_sync = TRUE;
+          else if (g_strcmp0 ("GL_EXT_x11_sync_object", ext) == 0)
+            x11_sync_object = TRUE;
+        }
 
-        return arb_sync && x11_sync_object;
-      }
+      return arb_sync && x11_sync_object;
+    }
     case COGL_DRIVER_GL:
-      {
-        const char *extensions = meta_gl_get_string (GL_EXTENSIONS);
-        return (extensions != NULL &&
-                strstr (extensions, "GL_ARB_sync") != NULL &&
-                strstr (extensions, "GL_EXT_x11_sync_object") != NULL);
-      }
+    {
+      const char *extensions = meta_gl_get_string (GL_EXTENSIONS);
+      return (extensions != NULL &&
+              strstr (extensions, "GL_ARB_sync") != NULL &&
+              strstr (extensions, "GL_EXT_x11_sync_object") != NULL);
+    }
     default:
       break;
     }
@@ -231,7 +232,7 @@ load_required_symbols (void)
     goto out;
 
   success = TRUE;
- out:
+out:
   return success;
 }
 
@@ -321,7 +322,8 @@ meta_sync_new (Display *xdisplay)
 
   self->xdisplay = xdisplay;
 
-  self->xfence = XSyncCreateFence (xdisplay, DefaultRootWindow (xdisplay), FALSE);
+  self->xfence =
+    XSyncCreateFence (xdisplay, DefaultRootWindow (xdisplay), FALSE);
   self->gl_x11_sync = 0;
   self->gpu_fence = 0;
 
@@ -351,13 +353,14 @@ static void
 meta_sync_import (MetaSync *self)
 {
   g_return_if_fail (self->gl_x11_sync == 0);
-  self->gl_x11_sync = meta_gl_import_sync (GL_SYNC_X11_FENCE_EXT, self->xfence, 0);
+  self->gl_x11_sync = meta_gl_import_sync (GL_SYNC_X11_FENCE_EXT, self->xfence,
+                                           0);
 }
 
 static Bool
-alarm_event_predicate (Display  *dpy,
-                       XEvent   *event,
-                       XPointer  data)
+alarm_event_predicate (Display *dpy,
+                       XEvent  *event,
+                       XPointer data)
 {
   MetaSyncRing *ring = meta_sync_ring_get ();
 
@@ -366,7 +369,8 @@ alarm_event_predicate (Display  *dpy,
 
   if (event->type == ring->xsync_event_base + XSyncAlarmNotify)
     {
-      if (((MetaSync *) data)->xalarm == ((XSyncAlarmNotifyEvent *) event)->alarm)
+      if (((MetaSync *) data)->xalarm ==
+          ((XSyncAlarmNotifyEvent *) event)->alarm)
         return True;
     }
   return False;
@@ -389,12 +393,12 @@ meta_sync_free (MetaSync *self)
       /* nothing to do */
       break;
     case META_SYNC_STATE_RESET_PENDING:
-      {
-        XEvent event;
-        XIfEvent (self->xdisplay, &event, alarm_event_predicate, (XPointer) self);
-        meta_sync_handle_event (self, (XSyncAlarmNotifyEvent *) &event);
-      }
-      /* fall through */
+    {
+      XEvent event;
+      XIfEvent (self->xdisplay, &event, alarm_event_predicate, (XPointer) self);
+      meta_sync_handle_event (self, (XSyncAlarmNotifyEvent *) &event);
+    }
+    /* fall through */
     case META_SYNC_STATE_READY:
       XSyncTriggerFence (self->xdisplay, self->xfence);
       XFlush (self->xdisplay);
@@ -427,7 +431,8 @@ meta_sync_ring_init (Display *xdisplay)
   if (!load_required_symbols ())
     return FALSE;
 
-  if (!XSyncQueryExtension (xdisplay, &ring->xsync_event_base, &ring->xsync_error_base) ||
+  if (!XSyncQueryExtension (xdisplay, &ring->xsync_event_base,
+                            &ring->xsync_error_base) ||
       !XSyncInitialize (xdisplay, &major, &minor))
     return FALSE;
 
@@ -516,14 +521,17 @@ meta_sync_ring_after_frame (void)
 
   if (ring->warmup_syncs >= NUM_SYNCS / 2)
     {
-      guint reset_sync_idx = (ring->current_sync_idx + NUM_SYNCS - (NUM_SYNCS / 2)) % NUM_SYNCS;
+      guint reset_sync_idx =
+        (ring->current_sync_idx + NUM_SYNCS - (NUM_SYNCS / 2)) % NUM_SYNCS;
       MetaSync *sync_to_reset = ring->syncs_array[reset_sync_idx];
 
       GLenum status = meta_sync_check_update_finished (sync_to_reset, 0);
       if (status == GL_TIMEOUT_EXPIRED)
         {
-          meta_warning ("MetaSyncRing: We should never wait for a sync -- add more syncs?\n");
-          status = meta_sync_check_update_finished (sync_to_reset, MAX_SYNC_WAIT_TIME);
+          meta_warning (
+            "MetaSyncRing: We should never wait for a sync -- add more syncs?\n");
+          status = meta_sync_check_update_finished (sync_to_reset,
+                                                    MAX_SYNC_WAIT_TIME);
         }
 
       if (status != GL_ALREADY_SIGNALED && status != GL_CONDITION_SATISFIED)
@@ -559,7 +567,8 @@ meta_sync_ring_insert_wait (void)
 
   if (ring->current_sync->state != META_SYNC_STATE_READY)
     {
-      meta_warning ("MetaSyncRing: Sync object is not ready -- were events handled properly?\n");
+      meta_warning (
+        "MetaSyncRing: Sync object is not ready -- were events handled properly?\n");
       if (!meta_sync_ring_reboot (ring->xdisplay))
         return FALSE;
     }
diff --git a/src/compositor/meta-texture-rectangle.c b/src/compositor/meta-texture-rectangle.c
index 6a01ed002..cf962898f 100644
--- a/src/compositor/meta-texture-rectangle.c
+++ b/src/compositor/meta-texture-rectangle.c
@@ -30,7 +30,7 @@ static void
 texture_rectangle_check_cb (CoglTexture *sub_texture,
                             const float *sub_texture_coords,
                             const float *meta_coords,
-                            void *user_data)
+                            void        *user_data)
 {
   gboolean *result = user_data;
 
diff --git a/src/compositor/meta-texture-tower.c b/src/compositor/meta-texture-tower.c
index a41cdc89d..df084dc4c 100644
--- a/src/compositor/meta-texture-tower.c
+++ b/src/compositor/meta-texture-tower.c
@@ -154,8 +154,10 @@ meta_texture_tower_set_base_texture (MetaTextureTower *tower,
       width = cogl_texture_get_width (tower->textures[0]);
       height = cogl_texture_get_height (tower->textures[0]);
 
-      tower->n_levels = 1 + MAX ((int)(M_LOG2E * log (width)), (int)(M_LOG2E * log (height)));
-      tower->n_levels = MIN(tower->n_levels, MAX_TEXTURE_LEVELS);
+      tower->n_levels = 1 +
+                        MAX ((int) (M_LOG2E * log (width)),
+                             (int) (M_LOG2E * log (height)));
+      tower->n_levels = MIN (tower->n_levels, MAX_TEXTURE_LEVELS);
 
       meta_texture_tower_update_area (tower, 0, 0, width, height);
     }
@@ -290,41 +292,42 @@ get_paint_level (int width, int height)
 
   /* We'll simplify the equations below for a bit of micro-optimization.
    * The commented out code is the unsimplified version.
-
-  // Partial derivates of window coordinates:
-  //
-  //  x_w = 0.5 * viewport_width * x_c / w_c + viewport_center_x
-  //  y_w = 0.5 * viewport_height * y_c / w_c + viewport_center_y
-  //
-  // with respect to u, v, using
-  // d(a/b)/dx = da/dx * (1/b) - a * db/dx / (b^2)
-
-  dxdu = 0.5 * viewport_width * (pm.xx - pm.wx * (xc/wc)) / wc;
-  dxdv = 0.5 * viewport_width * (pm.xy - pm.wy * (xc/wc)) / wc;
-  dydu = 0.5 * viewport_height * (pm.yx - pm.wx * (yc/wc)) / wc;
-  dydv = 0.5 * viewport_height * (pm.yy - pm.wy * (yc/wc)) / wc;
-
-  // Compute the inverse partials as the matrix inverse
-  det = dxdu * dydv - dxdv * dydu;
-
-  dudx =   dydv / det;
-  dudy = - dxdv / det;
-  dvdx = - dydu / det;
-  dvdy =   dvdu / det;
-
-  // Scale factor; maximum of the distance in texels for a change of 1 pixel
-  // in the X direction or 1 pixel in the Y direction
-  rho = MAX (sqrt (dudx * dudx + dvdx * dvdx), sqrt(dudy * dudy + dvdy * dvdy));
-
-  // Level of detail
-  lambda = log2 (rho) + LOD_BIAS;
-  */
+   *
+   *  // Partial derivates of window coordinates:
+   *  //
+   *  //  x_w = 0.5 * viewport_width * x_c / w_c + viewport_center_x
+   *  //  y_w = 0.5 * viewport_height * y_c / w_c + viewport_center_y
+   *  //
+   *  // with respect to u, v, using
+   *  // d(a/b)/dx = da/dx * (1/b) - a * db/dx / (b^2)
+   *
+   *  dxdu = 0.5 * viewport_width * (pm.xx - pm.wx * (xc/wc)) / wc;
+   *  dxdv = 0.5 * viewport_width * (pm.xy - pm.wy * (xc/wc)) / wc;
+   *  dydu = 0.5 * viewport_height * (pm.yx - pm.wx * (yc/wc)) / wc;
+   *  dydv = 0.5 * viewport_height * (pm.yy - pm.wy * (yc/wc)) / wc;
+   *
+   *  // Compute the inverse partials as the matrix inverse
+   *  det = dxdu * dydv - dxdv * dydu;
+   *
+   *  dudx =   dydv / det;
+   *  dudy = - dxdv / det;
+   *  dvdx = - dydu / det;
+   *  dvdy =   dvdu / det;
+   *
+   *  // Scale factor; maximum of the distance in texels for a change of 1 pixel
+   *  // in the X direction or 1 pixel in the Y direction
+   *  rho = MAX (sqrt (dudx * dudx + dvdx * dvdx), sqrt(dudy * dudy + dvdy *
+   *dvdy));
+   *
+   *  // Level of detail
+   *  lambda = log2 (rho) + LOD_BIAS;
+   */
 
   /* dxdu * wc, etc */
-  dxdu_ = 0.5 * viewport_width * (pm.xx - pm.wx * (xc/wc));
-  dxdv_ = 0.5 * viewport_width * (pm.xy - pm.wy * (xc/wc));
-  dydu_ = 0.5 * viewport_height * (pm.yx - pm.wx * (yc/wc));
-  dydv_ = 0.5 * viewport_height * (pm.yy - pm.wy * (yc/wc));
+  dxdu_ = 0.5 * viewport_width * (pm.xx - pm.wx * (xc / wc));
+  dxdv_ = 0.5 * viewport_width * (pm.xy - pm.wy * (xc / wc));
+  dydu_ = 0.5 * viewport_height * (pm.yx - pm.wx * (yc / wc));
+  dydv_ = 0.5 * viewport_height * (pm.yy - pm.wy * (yc / wc));
 
   /* det * wc^2 */
   det_ = dxdu_ * dydv_ - dxdv_ * dydu_;
@@ -337,13 +340,14 @@ get_paint_level (int width, int height)
   lambda = 0.5 * M_LOG2E * log (rho_sq * wc * wc / det_sq) + LOD_BIAS;
 
 #if 0
-  g_print ("%g %g %g\n", 0.5 * viewport_width * pm.xx / pm.ww, 0.5 * viewport_height * pm.yy / pm.ww, 
lambda);
+  g_print ("%g %g %g\n", 0.5 * viewport_width * pm.xx / pm.ww,
+           0.5 * viewport_height * pm.yy / pm.ww, lambda);
 #endif
 
   if (lambda <= 0.)
     return 0;
   else
-    return (int)(0.5 + lambda);
+    return (int) (0.5 + lambda);
 }
 
 static gboolean
@@ -365,7 +369,8 @@ texture_tower_create_texture (MetaTextureTower *tower,
       CoglContext *context = clutter_backend_get_cogl_context (backend);
       CoglTextureRectangle *texture_rectangle;
 
-      texture_rectangle = cogl_texture_rectangle_new_with_size (context, width, height);
+      texture_rectangle = cogl_texture_rectangle_new_with_size (context, width,
+                                                                height);
       tower->textures[level] = COGL_TEXTURE (texture_rectangle);
     }
   else
@@ -407,14 +412,16 @@ texture_tower_revalidate (MetaTextureTower *tower,
       return;
     }
 
-  cogl_framebuffer_orthographic (fb, 0, 0, dest_texture_width, dest_texture_height, -1., 1.);
+  cogl_framebuffer_orthographic (fb, 0, 0, dest_texture_width,
+                                 dest_texture_height, -1., 1.);
 
   if (!tower->pipeline_template)
     {
       CoglContext *ctx =
         clutter_backend_get_cogl_context (clutter_get_default_backend ());
       tower->pipeline_template = cogl_pipeline_new (ctx);
-      cogl_pipeline_set_blend (tower->pipeline_template, "RGBA = ADD (SRC_COLOR, 0)", NULL);
+      cogl_pipeline_set_blend (tower->pipeline_template,
+                               "RGBA = ADD (SRC_COLOR, 0)", NULL);
     }
 
   pipeline = cogl_pipeline_copy (tower->pipeline_template);
@@ -426,7 +433,8 @@ texture_tower_revalidate (MetaTextureTower *tower,
                                             (2. * invalid->x1) / source_texture_width,
                                             (2. * invalid->y1) / source_texture_height,
                                             (2. * invalid->x2) / source_texture_width,
-                                            (2. * invalid->y2) / source_texture_height);
+                                            (2. * invalid->y2) /
+                                            source_texture_height);
 
   cogl_object_unref (pipeline);
 
@@ -461,7 +469,7 @@ meta_texture_tower_get_paint_texture (MetaTextureTower *tower)
   texture_width = cogl_texture_get_width (tower->textures[0]);
   texture_height = cogl_texture_get_height (tower->textures[0]);
 
-  level = get_paint_level(texture_width, texture_height);
+  level = get_paint_level (texture_width, texture_height);
   if (level < 0) /* singular paint matrix, scaled to nothing */
     return NULL;
   level = MIN (level, tower->n_levels - 1);
@@ -473,22 +481,24 @@ meta_texture_tower_get_paint_texture (MetaTextureTower *tower)
       int i;
 
       for (i = 1; i <= level; i++)
-       {
-         /* Use "floor" convention here to be consistent with the NPOT texture extension */
-         texture_width = MAX (1, texture_width / 2);
-         texture_height = MAX (1, texture_height / 2);
-
-         if (tower->textures[i] == NULL)
-           texture_tower_create_texture (tower, i, texture_width, texture_height);
-       }
+        {
+          /* Use "floor" convention here to be consistent with the NPOT texture
+           * extension */
+          texture_width = MAX (1, texture_width / 2);
+          texture_height = MAX (1, texture_height / 2);
+
+          if (tower->textures[i] == NULL)
+            texture_tower_create_texture (tower, i, texture_width,
+                                          texture_height);
+        }
 
       for (i = 1; i <= level; i++)
-       {
-         if (tower->invalid[level].x2 != tower->invalid[level].x1 &&
-             tower->invalid[level].y2 != tower->invalid[level].y1)
-           texture_tower_revalidate (tower, i);
-       }
-   }
+        {
+          if (tower->invalid[level].x2 != tower->invalid[level].x1 &&
+              tower->invalid[level].y2 != tower->invalid[level].y1)
+            texture_tower_revalidate (tower, i);
+        }
+    }
 
   return tower->textures[level];
 }
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index 219226b19..ed58b5175 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -3,7 +3,8 @@
 /**
  * SECTION:meta-window-actor
  * @title: MetaWindowActor
- * @short_description: An actor representing a top-level window in the scene graph
+ * @short_description: An actor representing a top-level window in the scene
+ *graph
  */
 
 #include "config.h"
@@ -40,7 +41,8 @@
 #include "wayland/meta-wayland-surface.h"
 #endif
 
-typedef enum {
+typedef enum
+{
   INITIALLY_FROZEN,
   DRAWING_FIRST_FRAME,
   EMITTED_FIRST_FRAME
@@ -64,68 +66,70 @@ struct _MetaWindowActorPrivate
    * size-invariant window shape, we'll often find that the new shadow
    * is the same as the old shadow.
    */
-  MetaShadow       *focused_shadow;
-  MetaShadow       *unfocused_shadow;
+  MetaShadow *focused_shadow;
+  MetaShadow *unfocused_shadow;
 
   /* A region that matches the shape of the window, including frame bounds */
-  cairo_region_t   *shape_region;
+  cairo_region_t *shape_region;
   /* The region we should clip to when painting the shadow */
-  cairo_region_t   *shadow_clip;
+  cairo_region_t *shadow_clip;
 
   /* Extracted size-invariant shape used for shadows */
-  MetaWindowShape  *shadow_shape;
-  char *            shadow_class;
+  MetaWindowShape *shadow_shape;
+  char *shadow_class;
 
-  MetaShadowMode    shadow_mode;
+  MetaShadowMode shadow_mode;
 
-  guint             send_frame_messages_timer;
-  gint64            frame_drawn_time;
+  guint send_frame_messages_timer;
+  gint64 frame_drawn_time;
 
-  guint             repaint_scheduled_id;
-  guint             size_changed_id;
+  guint repaint_scheduled_id;
+  guint size_changed_id;
 
   /*
    * These need to be counters rather than flags, since more plugins
    * can implement same effect; the practicality of stacking effects
    * might be dubious, but we have to at least handle it correctly.
    */
-  gint              minimize_in_progress;
-  gint              unminimize_in_progress;
-  gint              size_change_in_progress;
-  gint              map_in_progress;
-  gint              destroy_in_progress;
+  gint minimize_in_progress;
+  gint unminimize_in_progress;
+  gint size_change_in_progress;
+  gint map_in_progress;
+  gint destroy_in_progress;
 
   /* List of FrameData for recent frames */
-  GList            *frames;
-  guint             freeze_count;
+  GList *frames;
+  guint freeze_count;
 
-  guint                    visible                : 1;
-  guint                    disposed               : 1;
+  guint visible                : 1;
+  guint disposed               : 1;
 
   /* If set, the client needs to be sent a _NET_WM_FRAME_DRAWN
    * client message for one or more messages in ->frames */
-  guint             needs_frame_drawn      : 1;
-  guint             repaint_scheduled      : 1;
+  guint needs_frame_drawn      : 1;
+  guint repaint_scheduled      : 1;
 
-  guint             needs_reshape          : 1;
-  guint             recompute_focused_shadow   : 1;
-  guint             recompute_unfocused_shadow : 1;
+  guint needs_reshape          : 1;
+  guint recompute_focused_shadow   : 1;
+  guint recompute_unfocused_shadow : 1;
 
-  guint                    needs_destroy          : 1;
+  guint needs_destroy          : 1;
 
-  guint             updates_frozen         : 1;
-  guint             first_frame_state      : 2; /* FirstFrameState */
+  guint updates_frozen         : 1;
+  guint first_frame_state      : 2;             /* FirstFrameState */
 };
 
 typedef struct _FrameData FrameData;
 
-/* Each time the application updates the sync request counter to a new even value
+/* Each time the application updates the sync request counter to a new even
+ * value
  * value, we queue a frame into the windows list of frames. Once we're painting
  * an update "in response" to the window, we fill in frame_counter with the
  * Cogl counter for that frame, and send _NET_WM_FRAME_DRAWN at the end of the
  * frame. _NET_WM_FRAME_TIMINGS is sent when we get a frame_complete callback.
  *
- * As an exception, if a window is completely obscured, we try to throttle drawning
+ * As an exception, if a window is completely obscured, we try to throttle
+ *drawning
  * to a slower frame rate. In this case, frame_counter stays -1 until
  * send_frame_message_timeout() runs, at which point we send both the
  * _NET_WM_FRAME_DRAWN and _NET_WM_FRAME_TIMINGS messages.
@@ -154,17 +158,17 @@ enum
   PROP_SHADOW_CLASS
 };
 
-static void meta_window_actor_dispose    (GObject *object);
-static void meta_window_actor_finalize   (GObject *object);
+static void meta_window_actor_dispose (GObject *object);
+static void meta_window_actor_finalize (GObject *object);
 static void meta_window_actor_constructed (GObject *object);
-static void meta_window_actor_set_property (GObject       *object,
+static void meta_window_actor_set_property (GObject      *object,
                                             guint         prop_id,
                                             const GValue *value,
                                             GParamSpec   *pspec);
-static void meta_window_actor_get_property (GObject      *object,
-                                            guint         prop_id,
-                                            GValue       *value,
-                                            GParamSpec   *pspec);
+static void meta_window_actor_get_property (GObject    *object,
+                                            guint       prop_id,
+                                            GValue     *value,
+                                            GParamSpec *pspec);
 
 static void meta_window_actor_paint (ClutterActor *actor);
 
@@ -179,8 +183,8 @@ static void meta_window_actor_handle_updates (MetaWindowActor *self);
 static void check_needs_reshape (MetaWindowActor *self);
 
 static void do_send_frame_drawn (MetaWindowActor *self, FrameData *frame);
-static void do_send_frame_timings (MetaWindowActor  *self,
-                                   FrameData        *frame,
+static void do_send_frame_timings (MetaWindowActor *self,
+                                   FrameData       *frame,
                                    gint             refresh_interval,
                                    gint64           presentation_time);
 
@@ -188,7 +192,8 @@ static void cullable_iface_init (MetaCullableInterface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (MetaWindowActor, meta_window_actor, CLUTTER_TYPE_ACTOR,
                          G_ADD_PRIVATE (MetaWindowActor)
-                         G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE, cullable_iface_init));
+                         G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE,
+                                                cullable_iface_init));
 
 static void
 frame_data_free (FrameData *frame)
@@ -201,13 +206,13 @@ meta_window_actor_class_init (MetaWindowActorClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
   ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
-  GParamSpec   *pspec;
+  GParamSpec *pspec;
 
-  object_class->dispose      = meta_window_actor_dispose;
-  object_class->finalize     = meta_window_actor_finalize;
+  object_class->dispose = meta_window_actor_dispose;
+  object_class->finalize = meta_window_actor_finalize;
   object_class->set_property = meta_window_actor_set_property;
   object_class->get_property = meta_window_actor_get_property;
-  object_class->constructed  = meta_window_actor_constructed;
+  object_class->constructed = meta_window_actor_constructed;
 
   actor_class->paint = meta_window_actor_paint;
   actor_class->get_paint_volume = meta_window_actor_get_paint_volume;
@@ -290,8 +295,8 @@ meta_window_actor_init (MetaWindowActor *self)
   MetaWindowActorPrivate *priv;
 
   priv = self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
-                                                  META_TYPE_WINDOW_ACTOR,
-                                                  MetaWindowActorPrivate);
+                                                   META_TYPE_WINDOW_ACTOR,
+                                                   MetaWindowActorPrivate);
   priv->shadow_class = NULL;
 }
 
@@ -328,9 +333,9 @@ is_argb32 (MetaWindowActor *self)
   MetaWindowActorPrivate *priv = self->priv;
 
   /* assume we're argb until we get the window (because
-     in practice we're drawing nothing, so we're fully
-     transparent)
-  */
+   *  in practice we're drawing nothing, so we're fully
+   *  transparent)
+   */
   if (priv->surface)
     return meta_surface_actor_is_argb32 (priv->surface);
   else
@@ -362,7 +367,7 @@ meta_window_actor_freeze (MetaWindowActor *self)
   if (priv->freeze_count == 0 && priv->surface)
     meta_surface_actor_set_frozen (priv->surface, TRUE);
 
-  priv->freeze_count ++;
+  priv->freeze_count++;
 }
 
 static void
@@ -414,7 +419,8 @@ set_surface (MetaWindowActor  *self,
       g_signal_handler_disconnect (priv->surface, priv->repaint_scheduled_id);
       g_signal_handler_disconnect (priv->surface, priv->size_changed_id);
       priv->repaint_scheduled_id = 0;
-      clutter_actor_remove_child (CLUTTER_ACTOR (self), CLUTTER_ACTOR (priv->surface));
+      clutter_actor_remove_child (CLUTTER_ACTOR (self),
+                                  CLUTTER_ACTOR (priv->surface));
       g_object_unref (priv->surface);
     }
 
@@ -423,11 +429,16 @@ set_surface (MetaWindowActor  *self,
   if (priv->surface)
     {
       g_object_ref_sink (priv->surface);
-      priv->repaint_scheduled_id = g_signal_connect (priv->surface, "repaint-scheduled",
-                                                     G_CALLBACK (surface_repaint_scheduled), self);
+      priv->repaint_scheduled_id = g_signal_connect (priv->surface,
+                                                     "repaint-scheduled",
+                                                     G_CALLBACK (
+                                                       surface_repaint_scheduled),
+                                                     self);
       priv->size_changed_id = g_signal_connect (priv->surface, "size-changed",
-                                                G_CALLBACK (surface_size_changed), self);
-      clutter_actor_add_child (CLUTTER_ACTOR (self), CLUTTER_ACTOR (priv->surface));
+                                                G_CALLBACK (
+                                                  surface_size_changed), self);
+      clutter_actor_add_child (CLUTTER_ACTOR (self),
+                               CLUTTER_ACTOR (priv->surface));
 
       meta_window_actor_update_shape (self);
 
@@ -502,7 +513,8 @@ meta_window_actor_dispose (GObject *object)
   g_clear_pointer (&priv->unfocused_shadow, meta_shadow_unref);
   g_clear_pointer (&priv->shadow_shape, meta_window_shape_unref);
 
-  compositor->windows = g_list_remove (compositor->windows, (gconstpointer) self);
+  compositor->windows =
+    g_list_remove (compositor->windows, (gconstpointer) self);
 
   g_clear_object (&priv->window);
 
@@ -514,7 +526,7 @@ meta_window_actor_dispose (GObject *object)
 static void
 meta_window_actor_finalize (GObject *object)
 {
-  MetaWindowActor        *self = META_WINDOW_ACTOR (object);
+  MetaWindowActor *self = META_WINDOW_ACTOR (object);
   MetaWindowActorPrivate *priv = self->priv;
 
   g_list_free_full (priv->frames, (GDestroyNotify) frame_data_free);
@@ -528,7 +540,7 @@ meta_window_actor_set_property (GObject      *object,
                                 const GValue *value,
                                 GParamSpec   *pspec)
 {
-  MetaWindowActor        *self   = META_WINDOW_ACTOR (object);
+  MetaWindowActor *self = META_WINDOW_ACTOR (object);
   MetaWindowActorPrivate *priv = self->priv;
 
   switch (prop_id)
@@ -536,33 +548,34 @@ meta_window_actor_set_property (GObject      *object,
     case PROP_META_WINDOW:
       priv->window = g_value_dup_object (value);
       g_signal_connect_object (priv->window, "notify::appears-focused",
-                               G_CALLBACK (window_appears_focused_notify), self, 0);
+                               G_CALLBACK (
+                                 window_appears_focused_notify), self, 0);
       break;
     case PROP_SHADOW_MODE:
-      {
-        MetaShadowMode newv = g_value_get_enum (value);
+    {
+      MetaShadowMode newv = g_value_get_enum (value);
 
-        if (newv == priv->shadow_mode)
-          return;
+      if (newv == priv->shadow_mode)
+        return;
 
-        priv->shadow_mode = newv;
+      priv->shadow_mode = newv;
 
-        meta_window_actor_invalidate_shadow (self);
-      }
-      break;
+      meta_window_actor_invalidate_shadow (self);
+    }
+    break;
     case PROP_SHADOW_CLASS:
-      {
-        const char *newv = g_value_get_string (value);
+    {
+      const char *newv = g_value_get_string (value);
 
-        if (g_strcmp0 (newv, priv->shadow_class) == 0)
-          return;
+      if (g_strcmp0 (newv, priv->shadow_class) == 0)
+        return;
 
-        g_free (priv->shadow_class);
-        priv->shadow_class = g_strdup (newv);
+      g_free (priv->shadow_class);
+      priv->shadow_class = g_strdup (newv);
 
-        meta_window_actor_invalidate_shadow (self);
-      }
-      break;
+      meta_window_actor_invalidate_shadow (self);
+    }
+    break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -570,10 +583,10 @@ meta_window_actor_set_property (GObject      *object,
 }
 
 static void
-meta_window_actor_get_property (GObject      *object,
-                                guint         prop_id,
-                                GValue       *value,
-                                GParamSpec   *pspec)
+meta_window_actor_get_property (GObject    *object,
+                                guint       prop_id,
+                                GValue     *value,
+                                GParamSpec *pspec)
 {
   MetaWindowActorPrivate *priv = META_WINDOW_ACTOR (object)->priv;
 
@@ -613,10 +626,10 @@ meta_window_actor_get_shadow_class (MetaWindowActor *self)
         case META_WINDOW_POPUP_MENU:
           return "popup-menu";
         default:
-          {
-            MetaFrameType frame_type = meta_window_get_frame_type (priv->window);
-            return meta_frame_type_to_string (frame_type);
-          }
+        {
+          MetaFrameType frame_type = meta_window_get_frame_type (priv->window);
+          return meta_frame_type_to_string (frame_type);
+        }
         }
     }
 }
@@ -648,7 +661,8 @@ meta_window_actor_get_shadow_bounds (MetaWindowActor       *self,
                                      cairo_rectangle_int_t *bounds)
 {
   MetaWindowActorPrivate *priv = self->priv;
-  MetaShadow *shadow = appears_focused ? priv->focused_shadow : priv->unfocused_shadow;
+  MetaShadow *shadow =
+    appears_focused ? priv->focused_shadow : priv->unfocused_shadow;
   cairo_rectangle_int_t shape_bounds;
   MetaShadowParams params;
 
@@ -712,12 +726,13 @@ meta_window_actor_paint (ClutterActor *actor)
   MetaWindowActor *self = META_WINDOW_ACTOR (actor);
   MetaWindowActorPrivate *priv = self->priv;
   gboolean appears_focused = meta_window_appears_focused (priv->window);
-  MetaShadow *shadow = appears_focused ? priv->focused_shadow : priv->unfocused_shadow;
+  MetaShadow *shadow =
+    appears_focused ? priv->focused_shadow : priv->unfocused_shadow;
 
- /* This window got damage when obscured; we set up a timer
-  * to send frame completion events, but since we're drawing
-  * the window now (for some other reason) cancel the timer
-  * and send the completion events normally */
+  /* This window got damage when obscured; we set up a timer
+   * to send frame completion events, but since we're drawing
+   * the window now (for some other reason) cancel the timer
+   * and send the completion events normally */
   if (priv->send_frame_messages_timer != 0)
     {
       g_source_remove (priv->send_frame_messages_timer);
@@ -741,7 +756,8 @@ meta_window_actor_paint (ClutterActor *actor)
        */
       if (!clip && clip_shadow_under_window (self))
         {
-          cairo_region_t *frame_bounds = meta_window_get_frame_bounds (priv->window);
+          cairo_region_t *frame_bounds = meta_window_get_frame_bounds (
+            priv->window);
           cairo_rectangle_int_t bounds;
 
           meta_window_actor_get_shadow_bounds (self, appears_focused, &bounds);
@@ -755,9 +771,12 @@ meta_window_actor_paint (ClutterActor *actor)
                          params.y_offset + shape_bounds.y,
                          shape_bounds.width,
                          shape_bounds.height,
-                         (clutter_actor_get_paint_opacity (actor) * params.opacity * window->opacity) / (255 
* 255),
+                         (clutter_actor_get_paint_opacity (actor) *
+                          params.opacity * window->opacity) / (255 * 255),
                          clip,
-                         clip_shadow_under_window (self)); /* clip_strictly - not just as an optimization */
+                         clip_shadow_under_window (self)); /* clip_strictly -
+                                                            * not just as an
+                                                            * optimization */
 
       if (clip && clip != priv->shadow_clip)
         cairo_region_destroy (clip);
@@ -790,7 +809,8 @@ meta_window_actor_get_paint_volume (ClutterActor       *actor,
        * at all.
        */
 
-      meta_window_actor_get_shadow_bounds (self, appears_focused, &shadow_bounds);
+      meta_window_actor_get_shadow_bounds (self, appears_focused,
+                                           &shadow_bounds);
       shadow_box.x1 = shadow_bounds.x;
       shadow_box.x2 = shadow_bounds.x + shadow_bounds.width;
       shadow_box.y1 = shadow_bounds.y;
@@ -803,7 +823,9 @@ meta_window_actor_get_paint_volume (ClutterActor       *actor,
     {
       const ClutterPaintVolume *child_volume;
 
-      child_volume = clutter_actor_get_transformed_paint_volume (CLUTTER_ACTOR (priv->surface), actor);
+      child_volume =
+        clutter_actor_get_transformed_paint_volume (CLUTTER_ACTOR (
+                                                      priv->surface), actor);
       if (!child_volume)
         return FALSE;
 
@@ -989,15 +1011,21 @@ queue_send_frame_messages_timeout (MetaWindowActor *self)
   current_time =
     meta_compositor_monotonic_time_to_server_time (display,
                                                    g_get_monotonic_time ());
-  interval = (int)(1000000 / refresh_rate) * 6;
+  interval = (int) (1000000 / refresh_rate) * 6;
   offset = MAX (0, priv->frame_drawn_time + interval - current_time) / 1000;
 
- /* The clutter master clock source has already been added with META_PRIORITY_REDRAW,
-  * so the timer will run *after* the clutter frame handling, if a frame is ready
-  * to be drawn when the timer expires.
-  */
-  priv->send_frame_messages_timer = g_timeout_add_full (META_PRIORITY_REDRAW, offset, 
send_frame_messages_timeout, self, NULL);
-  g_source_set_name_by_id (priv->send_frame_messages_timer, "[mutter] send_frame_messages_timeout");
+  /* The clutter master clock source has already been added with
+   * META_PRIORITY_REDRAW,
+   * so the timer will run *after* the clutter frame handling, if a frame is
+   *ready
+   * to be drawn when the timer expires.
+   */
+  priv->send_frame_messages_timer = g_timeout_add_full (META_PRIORITY_REDRAW,
+                                                        offset,
+                                                        send_frame_messages_timeout, self,
+                                                        NULL);
+  g_source_set_name_by_id (priv->send_frame_messages_timer,
+                           "[mutter] send_frame_messages_timeout");
 }
 
 void
@@ -1051,7 +1079,8 @@ meta_window_actor_queue_frame_drawn (MetaWindowActor *self,
           if (priv->surface)
             {
               const cairo_rectangle_int_t clip = { 0, 0, 1, 1 };
-              clutter_actor_queue_redraw_with_clip (CLUTTER_ACTOR (priv->surface), &clip);
+              clutter_actor_queue_redraw_with_clip (CLUTTER_ACTOR (
+                                                      priv->surface), &clip);
               priv->repaint_scheduled = TRUE;
             }
         }
@@ -1062,28 +1091,28 @@ gboolean
 meta_window_actor_effect_in_progress (MetaWindowActor *self)
 {
   return (self->priv->minimize_in_progress ||
-         self->priv->size_change_in_progress ||
-         self->priv->map_in_progress ||
-         self->priv->destroy_in_progress);
+          self->priv->size_change_in_progress ||
+          self->priv->map_in_progress ||
+          self->priv->destroy_in_progress);
 }
 
 static gboolean
 is_freeze_thaw_effect (MetaPluginEffect event)
 {
   switch (event)
-  {
-  case META_PLUGIN_DESTROY:
-  case META_PLUGIN_SIZE_CHANGE:
-    return TRUE;
-    break;
-  default:
-    return FALSE;
-  }
+    {
+    case META_PLUGIN_DESTROY:
+    case META_PLUGIN_SIZE_CHANGE:
+      return TRUE;
+      break;
+    default:
+      return FALSE;
+    }
 }
 
 static gboolean
-start_simple_effect (MetaWindowActor  *self,
-                     MetaPluginEffect  event)
+start_simple_effect (MetaWindowActor *self,
+                     MetaPluginEffect event)
 {
   MetaWindowActorPrivate *priv = self->priv;
   MetaCompositor *compositor = priv->compositor;
@@ -1093,26 +1122,26 @@ start_simple_effect (MetaWindowActor  *self,
   g_assert (compositor->plugin_mgr != NULL);
 
   switch (event)
-  {
-  case META_PLUGIN_NONE:
-    return FALSE;
-  case META_PLUGIN_MINIMIZE:
-    counter = &priv->minimize_in_progress;
-    break;
-  case META_PLUGIN_UNMINIMIZE:
-    counter = &priv->unminimize_in_progress;
-    break;
-  case META_PLUGIN_MAP:
-    counter = &priv->map_in_progress;
-    break;
-  case META_PLUGIN_DESTROY:
-    counter = &priv->destroy_in_progress;
-    break;
-  case META_PLUGIN_SIZE_CHANGE:
-  case META_PLUGIN_SWITCH_WORKSPACE:
-    g_assert_not_reached ();
-    break;
-  }
+    {
+    case META_PLUGIN_NONE:
+      return FALSE;
+    case META_PLUGIN_MINIMIZE:
+      counter = &priv->minimize_in_progress;
+      break;
+    case META_PLUGIN_UNMINIMIZE:
+      counter = &priv->unminimize_in_progress;
+      break;
+    case META_PLUGIN_MAP:
+      counter = &priv->map_in_progress;
+      break;
+    case META_PLUGIN_DESTROY:
+      counter = &priv->destroy_in_progress;
+      break;
+    case META_PLUGIN_SIZE_CHANGE:
+    case META_PLUGIN_SWITCH_WORKSPACE:
+      g_assert_not_reached ();
+      break;
+    }
 
   g_assert (counter);
 
@@ -1151,10 +1180,10 @@ meta_window_actor_after_effects (MetaWindowActor *self)
 }
 
 void
-meta_window_actor_effect_completed (MetaWindowActor  *self,
-                                    MetaPluginEffect  event)
+meta_window_actor_effect_completed (MetaWindowActor *self,
+                                    MetaPluginEffect event)
 {
-  MetaWindowActorPrivate *priv   = self->priv;
+  MetaWindowActorPrivate *priv = self->priv;
   gboolean inconsistent = FALSE;
 
   /* NB: Keep in mind that when effects get completed it possible
@@ -1162,68 +1191,68 @@ meta_window_actor_effect_completed (MetaWindowActor  *self,
    * In this case priv->window will == NULL */
 
   switch (event)
-  {
-  case META_PLUGIN_NONE:
-    break;
-  case META_PLUGIN_MINIMIZE:
+    {
+    case META_PLUGIN_NONE:
+      break;
+    case META_PLUGIN_MINIMIZE:
     {
       priv->minimize_in_progress--;
       if (priv->minimize_in_progress < 0)
-       {
-         g_warning ("Error in minimize accounting.");
-         priv->minimize_in_progress = 0;
+        {
+          g_warning ("Error in minimize accounting.");
+          priv->minimize_in_progress = 0;
           inconsistent = TRUE;
-       }
+        }
     }
     break;
-  case META_PLUGIN_UNMINIMIZE:
+    case META_PLUGIN_UNMINIMIZE:
     {
       priv->unminimize_in_progress--;
       if (priv->unminimize_in_progress < 0)
-       {
-         g_warning ("Error in unminimize accounting.");
-         priv->unminimize_in_progress = 0;
-         inconsistent = TRUE;
-       }
+        {
+          g_warning ("Error in unminimize accounting.");
+          priv->unminimize_in_progress = 0;
+          inconsistent = TRUE;
+        }
     }
     break;
-  case META_PLUGIN_MAP:
-    /*
-     * Make sure that the actor is at the correct place in case
-     * the plugin fscked.
-     */
-    priv->map_in_progress--;
-
-    if (priv->map_in_progress < 0)
-      {
-       g_warning ("Error in map accounting.");
-       priv->map_in_progress = 0;
-        inconsistent = TRUE;
-      }
-    break;
-  case META_PLUGIN_DESTROY:
-    priv->destroy_in_progress--;
-
-    if (priv->destroy_in_progress < 0)
-      {
-       g_warning ("Error in destroy accounting.");
-       priv->destroy_in_progress = 0;
-        inconsistent = TRUE;
-      }
-    break;
-  case META_PLUGIN_SIZE_CHANGE:
-    priv->size_change_in_progress--;
-    if (priv->size_change_in_progress < 0)
-      {
-       g_warning ("Error in size change accounting.");
-       priv->size_change_in_progress = 0;
-        inconsistent = TRUE;
-      }
-    break;
-  case META_PLUGIN_SWITCH_WORKSPACE:
-    g_assert_not_reached ();
-    break;
-  }
+    case META_PLUGIN_MAP:
+      /*
+       * Make sure that the actor is at the correct place in case
+       * the plugin fscked.
+       */
+      priv->map_in_progress--;
+
+      if (priv->map_in_progress < 0)
+        {
+          g_warning ("Error in map accounting.");
+          priv->map_in_progress = 0;
+          inconsistent = TRUE;
+        }
+      break;
+    case META_PLUGIN_DESTROY:
+      priv->destroy_in_progress--;
+
+      if (priv->destroy_in_progress < 0)
+        {
+          g_warning ("Error in destroy accounting.");
+          priv->destroy_in_progress = 0;
+          inconsistent = TRUE;
+        }
+      break;
+    case META_PLUGIN_SIZE_CHANGE:
+      priv->size_change_in_progress--;
+      if (priv->size_change_in_progress < 0)
+        {
+          g_warning ("Error in size change accounting.");
+          priv->size_change_in_progress = 0;
+          inconsistent = TRUE;
+        }
+      break;
+    case META_PLUGIN_SWITCH_WORKSPACE:
+      g_assert_not_reached ();
+      break;
+    }
 
   if (is_freeze_thaw_effect (event) && !inconsistent)
     meta_window_actor_thaw (self);
@@ -1248,7 +1277,7 @@ meta_window_actor_set_unredirected (MetaWindowActor *self,
 {
   MetaWindowActorPrivate *priv = self->priv;
 
-  g_assert(priv->surface); /* because otherwise should_unredirect() is FALSE */
+  g_assert (priv->surface); /* because otherwise should_unredirect() is FALSE */
   meta_surface_actor_set_unredirected (priv->surface, unredirected);
 }
 
@@ -1323,8 +1352,8 @@ meta_window_actor_sync_actor_geometry (MetaWindowActor *self,
 }
 
 void
-meta_window_actor_show (MetaWindowActor   *self,
-                        MetaCompEffect     effect)
+meta_window_actor_show (MetaWindowActor *self,
+                        MetaCompEffect   effect)
 {
   MetaWindowActorPrivate *priv = self->priv;
   MetaCompositor *compositor = priv->compositor;
@@ -1346,7 +1375,7 @@ meta_window_actor_show (MetaWindowActor   *self,
       event = META_PLUGIN_NONE;
       break;
     default:
-      g_assert_not_reached();
+      g_assert_not_reached ();
     }
 
   if (compositor->switch_workspace_in_progress ||
@@ -1387,7 +1416,7 @@ meta_window_actor_hide (MetaWindowActor *self,
       event = META_PLUGIN_NONE;
       break;
     default:
-      g_assert_not_reached();
+      g_assert_not_reached ();
     }
 
   if (!start_simple_effect (self, event))
@@ -1395,10 +1424,10 @@ meta_window_actor_hide (MetaWindowActor *self,
 }
 
 void
-meta_window_actor_size_change (MetaWindowActor    *self,
-                               MetaSizeChange      which_change,
-                               MetaRectangle      *old_frame_rect,
-                               MetaRectangle      *old_buffer_rect)
+meta_window_actor_size_change (MetaWindowActor *self,
+                               MetaSizeChange   which_change,
+                               MetaRectangle   *old_frame_rect,
+                               MetaRectangle   *old_buffer_rect)
 {
   MetaWindowActorPrivate *priv = self->priv;
   MetaCompositor *compositor = priv->compositor;
@@ -1407,7 +1436,8 @@ meta_window_actor_size_change (MetaWindowActor    *self,
   meta_window_actor_freeze (self);
 
   if (!meta_plugin_manager_event_size_change (compositor->plugin_mgr, self,
-                                              which_change, old_frame_rect, old_buffer_rect))
+                                              which_change, old_frame_rect,
+                                              old_buffer_rect))
     {
       self->priv->size_change_in_progress--;
       meta_window_actor_thaw (self);
@@ -1419,9 +1449,9 @@ meta_window_actor_new (MetaWindow *window)
 {
   MetaDisplay *display = meta_window_get_display (window);
   MetaCompositor *compositor = display->compositor;
-  MetaWindowActor        *self;
+  MetaWindowActor *self;
   MetaWindowActorPrivate *priv;
-  ClutterActor           *window_group;
+  ClutterActor *window_group;
 
   self = g_object_new (META_TYPE_WINDOW_ACTOR,
                        "meta-window", window,
@@ -1493,7 +1523,8 @@ see_region (cairo_region_t *region,
             int             height,
             char           *filename)
 {
-  cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_A8, width, height);
+  cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_A8, width,
+                                                         height);
   cairo_t *cr = cairo_create (surface);
 
   gdk_cairo_region (cr, region);
@@ -1534,7 +1565,8 @@ meta_window_actor_set_clip_region_beneath (MetaWindowActor *self,
 
           if (clip_shadow_under_window (self))
             {
-              cairo_region_t *frame_bounds = meta_window_get_frame_bounds (priv->window);
+              cairo_region_t *frame_bounds = meta_window_get_frame_bounds (
+                priv->window);
               cairo_region_subtract (priv->shadow_clip, frame_bounds);
             }
         }
@@ -1626,8 +1658,10 @@ check_needs_shadow (MetaWindowActor *self)
       meta_window_actor_get_shape_bounds (self, &shape_bounds);
       *shadow_location = meta_shadow_factory_get_shadow (factory,
                                                          priv->shadow_shape,
-                                                         shape_bounds.width, shape_bounds.height,
-                                                         shadow_class, appears_focused);
+                                                         shape_bounds.width,
+                                                         shape_bounds.height,
+                                                         shadow_class,
+                                                         appears_focused);
     }
 
   if (old_shadow != NULL)
@@ -1684,7 +1718,8 @@ scan_visible_region (guchar         *mask_data,
           for (x = rect.x; x < (rect.x + rect.width); x++)
             {
               int x2 = x;
-              while (mask_data[y * stride + x2] == 255 && x2 < (rect.x + rect.width))
+              while (mask_data[y * stride + x2] == 255 &&
+                     x2 < (rect.x + rect.width))
                 x2++;
 
               if (x2 > x)
@@ -1757,7 +1792,8 @@ build_and_scan_frame_mask (MetaWindowActor       *self,
       meta_frame_get_mask (priv->window->frame, cr);
 
       cairo_surface_flush (surface);
-      scanned_region = scan_visible_region (mask_data, stride, frame_paint_region);
+      scanned_region = scan_visible_region (mask_data, stride,
+                                            frame_paint_region);
       cairo_region_union (shape_region, scanned_region);
       cairo_region_destroy (scanned_region);
       cairo_region_destroy (frame_paint_region);
@@ -1768,7 +1804,9 @@ build_and_scan_frame_mask (MetaWindowActor       *self,
 
   if (meta_texture_rectangle_check (paint_tex))
     {
-      mask_texture = COGL_TEXTURE (cogl_texture_rectangle_new_with_size (ctx, tex_width, tex_height));
+      mask_texture =
+        COGL_TEXTURE (cogl_texture_rectangle_new_with_size (ctx, tex_width,
+                                                            tex_height));
       cogl_texture_set_components (mask_texture, COGL_TEXTURE_COMPONENTS_A);
       cogl_texture_set_region (mask_texture,
                                0, 0, /* src_x/y */
@@ -1782,9 +1820,11 @@ build_and_scan_frame_mask (MetaWindowActor       *self,
     {
       CoglError *error = NULL;
 
-      mask_texture = COGL_TEXTURE (cogl_texture_2d_new_from_data (ctx, tex_width, tex_height,
-                                                                  COGL_PIXEL_FORMAT_A_8,
-                                                                  stride, mask_data, &error));
+      mask_texture =
+        COGL_TEXTURE (cogl_texture_2d_new_from_data (ctx, tex_width, tex_height,
+                                                     COGL_PIXEL_FORMAT_A_8,
+                                                     stride,
+                                                     mask_data, &error));
 
       if (error)
         {
@@ -1972,21 +2012,22 @@ do_send_frame_drawn (MetaWindowActor *self, FrameData *frame)
 
   XClientMessageEvent ev = { 0, };
 
-  frame->frame_drawn_time = meta_compositor_monotonic_time_to_server_time (display,
-                                                                           g_get_monotonic_time ());
+  frame->frame_drawn_time = meta_compositor_monotonic_time_to_server_time (
+    display,
+    g_get_monotonic_time ());
   priv->frame_drawn_time = frame->frame_drawn_time;
 
   ev.type = ClientMessage;
   ev.window = meta_window_get_xwindow (priv->window);
   ev.message_type = display->x11_display->atom__NET_WM_FRAME_DRAWN;
   ev.format = 32;
-  ev.data.l[0] = frame->sync_request_serial & G_GUINT64_CONSTANT(0xffffffff);
+  ev.data.l[0] = frame->sync_request_serial & G_GUINT64_CONSTANT (0xffffffff);
   ev.data.l[1] = frame->sync_request_serial >> 32;
-  ev.data.l[2] = frame->frame_drawn_time & G_GUINT64_CONSTANT(0xffffffff);
+  ev.data.l[2] = frame->frame_drawn_time & G_GUINT64_CONSTANT (0xffffffff);
   ev.data.l[3] = frame->frame_drawn_time >> 32;
 
   meta_x11_error_trap_push (display->x11_display);
-  XSendEvent (xdisplay, ev.window, False, 0, (XEvent*) &ev);
+  XSendEvent (xdisplay, ev.window, False, 0, (XEvent *) &ev);
   XFlush (xdisplay);
   meta_x11_error_trap_pop (display->x11_display);
 }
@@ -2029,8 +2070,8 @@ meta_window_actor_post_paint (MetaWindowActor *self)
 }
 
 static void
-do_send_frame_timings (MetaWindowActor  *self,
-                       FrameData        *frame,
+do_send_frame_timings (MetaWindowActor *self,
+                       FrameData       *frame,
                        gint             refresh_interval,
                        gint64           presentation_time)
 {
@@ -2044,18 +2085,20 @@ do_send_frame_timings (MetaWindowActor  *self,
   ev.window = meta_window_get_xwindow (priv->window);
   ev.message_type = display->x11_display->atom__NET_WM_FRAME_TIMINGS;
   ev.format = 32;
-  ev.data.l[0] = frame->sync_request_serial & G_GUINT64_CONSTANT(0xffffffff);
+  ev.data.l[0] = frame->sync_request_serial & G_GUINT64_CONSTANT (0xffffffff);
   ev.data.l[1] = frame->sync_request_serial >> 32;
 
   if (presentation_time != 0)
     {
-      gint64 presentation_time_server = meta_compositor_monotonic_time_to_server_time (display,
-                                                                                       presentation_time);
-      gint64 presentation_time_offset = presentation_time_server - frame->frame_drawn_time;
+      gint64 presentation_time_server =
+        meta_compositor_monotonic_time_to_server_time (display,
+                                                       presentation_time);
+      gint64 presentation_time_offset = presentation_time_server -
+                                        frame->frame_drawn_time;
       if (presentation_time_offset == 0)
         presentation_time_offset = 1;
 
-      if ((gint32)presentation_time_offset == presentation_time_offset)
+      if ((gint32) presentation_time_offset == presentation_time_offset)
         ev.data.l[2] = presentation_time_offset;
     }
 
@@ -2063,7 +2106,7 @@ do_send_frame_timings (MetaWindowActor  *self,
   ev.data.l[4] = 1000 * META_SYNC_DELAY;
 
   meta_x11_error_trap_push (display->x11_display);
-  XSendEvent (xdisplay, ev.window, False, 0, (XEvent*) &ev);
+  XSendEvent (xdisplay, ev.window, False, 0, (XEvent *) &ev);
   XFlush (xdisplay);
   meta_x11_error_trap_pop (display->x11_display);
 }
@@ -2107,11 +2150,13 @@ meta_window_actor_frame_complete (MetaWindowActor  *self,
       if (frame->frame_counter != -1 && frame->frame_counter <= frame_counter)
         {
           if (G_UNLIKELY (frame->frame_drawn_time == 0))
-            g_warning ("%s: Frame has assigned frame counter but no frame drawn time",
-                       priv->window->desc);
+            g_warning (
+              "%s: Frame has assigned frame counter but no frame drawn time",
+              priv->window->desc);
           if (G_UNLIKELY (frame->frame_counter < frame_counter))
-            g_warning ("%s: frame_complete callback never occurred for frame %" G_GINT64_FORMAT,
-                       priv->window->desc, frame->frame_counter);
+            g_warning (
+              "%s: frame_complete callback never occurred for frame %" G_GINT64_FORMAT,
+              priv->window->desc, frame->frame_counter);
 
           priv->frames = g_list_delete_link (priv->frames, l);
           send_frame_timings (self, frame, frame_info, presentation_time);
@@ -2170,7 +2215,8 @@ meta_window_actor_sync_updates_frozen (MetaWindowActor *self)
   MetaWindowActorPrivate *priv = self->priv;
   MetaWindow *window = priv->window;
 
-  meta_window_actor_set_updates_frozen (self, meta_window_updates_are_frozen (window));
+  meta_window_actor_set_updates_frozen (self,
+                                        meta_window_updates_are_frozen (window));
 }
 
 MetaWindowActor *
diff --git a/src/compositor/meta-window-group.c b/src/compositor/meta-window-group.c
index 44058feea..ef5ae9b27 100644
--- a/src/compositor/meta-window-group.c
+++ b/src/compositor/meta-window-group.c
@@ -28,7 +28,8 @@ struct _MetaWindowGroup
 static void cullable_iface_init (MetaCullableInterface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (MetaWindowGroup, meta_window_group, CLUTTER_TYPE_ACTOR,
-                         G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE, cullable_iface_init));
+                         G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE,
+                                                cullable_iface_init));
 
 static void
 meta_window_group_cull_out (MetaCullable   *cullable,
@@ -115,7 +116,8 @@ meta_window_group_paint (ClutterActor *actor)
 
   cairo_region_translate (clip_region, -paint_x_origin, -paint_y_origin);
 
-  meta_cullable_cull_out (META_CULLABLE (window_group), unobscured_region, clip_region);
+  meta_cullable_cull_out (META_CULLABLE (
+                            window_group), unobscured_region, clip_region);
 
   cairo_region_destroy (unobscured_region);
   cairo_region_destroy (clip_region);
diff --git a/src/compositor/meta-window-shape.c b/src/compositor/meta-window-shape.c
index 1b4767567..5710ed8a0 100644
--- a/src/compositor/meta-window-shape.c
+++ b/src/compositor/meta-window-shape.c
@@ -144,9 +144,11 @@ meta_window_shape_new (cairo_region_t *region)
 
 #if 0
       g_print ("%d: +%d+%dx%dx%d => +%d+%dx%dx%d\n",
-               iter.i, iter.rectangle.x, iter.rectangle.y, iter.rectangle.width, iter.rectangle.height,
+               iter.i, iter.rectangle.x, iter.rectangle.y, iter.rectangle.width,
+               iter.rectangle.height,
                shape->rectangles[iter.i].x, shape->rectangles[iter.i].y,
-               hape->rectangles[iter.i].width, shape->rectangles[iter.i].height);
+               hape->rectangles[iter.i].width,
+               shape->rectangles[iter.i].height);
 #endif
 
       hash = hash * 31 + x1 * 17 + x2 * 27 + y1 * 37 + y2 * 43;
@@ -155,7 +157,8 @@ meta_window_shape_new (cairo_region_t *region)
   shape->hash = hash;
 
 #if 0
-  g_print ("%d %d %d %d: %#x\n\n", shape->top, shape->right, shape->bottom, shape->left, shape->hash);
+  g_print ("%d %d %d %d: %#x\n\n", shape->top, shape->right, shape->bottom,
+           shape->left, shape->hash);
 #endif
 
   return shape;
diff --git a/src/compositor/plugins/default.c b/src/compositor/plugins/default.c
index 3dd0b07ec..5526f4a9a 100644
--- a/src/compositor/plugins/default.c
+++ b/src/compositor/plugins/default.c
@@ -44,17 +44,26 @@
 #define DISPLAY_TILE_PREVIEW_DATA_KEY "MCCP-Default-display-tile-preview-data"
 
 #define META_TYPE_DEFAULT_PLUGIN            (meta_default_plugin_get_type ())
-#define META_DEFAULT_PLUGIN(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_DEFAULT_PLUGIN, 
MetaDefaultPlugin))
-#define META_DEFAULT_PLUGIN_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  META_TYPE_DEFAULT_PLUGIN, 
MetaDefaultPluginClass))
-#define META_IS_DEFAULT_PLUGIN(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_DEFAULT_PLUGIN_TYPE))
-#define META_IS_DEFAULT_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  META_TYPE_DEFAULT_PLUGIN))
-#define META_DEFAULT_PLUGIN_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  META_TYPE_DEFAULT_PLUGIN, 
MetaDefaultPluginClass))
+#define META_DEFAULT_PLUGIN(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+                                                                         META_TYPE_DEFAULT_PLUGIN, \
+                                                                         MetaDefaultPlugin))
+#define META_DEFAULT_PLUGIN_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), \
+                                                                      META_TYPE_DEFAULT_PLUGIN, \
+                                                                      MetaDefaultPluginClass))
+#define META_IS_DEFAULT_PLUGIN(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+                                                                         META_DEFAULT_PLUGIN_TYPE))
+#define META_IS_DEFAULT_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+                                                                      META_TYPE_DEFAULT_PLUGIN))
+#define META_DEFAULT_PLUGIN_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+                                                                        META_TYPE_DEFAULT_PLUGIN, \
+                                                                        MetaDefaultPluginClass))
 
 #define META_DEFAULT_PLUGIN_GET_PRIVATE(obj) \
-(G_TYPE_INSTANCE_GET_PRIVATE ((obj), META_TYPE_DEFAULT_PLUGIN, MetaDefaultPluginPrivate))
+  (G_TYPE_INSTANCE_GET_PRIVATE ((obj), META_TYPE_DEFAULT_PLUGIN, \
+                                MetaDefaultPluginPrivate))
 
-typedef struct _MetaDefaultPlugin        MetaDefaultPlugin;
-typedef struct _MetaDefaultPluginClass   MetaDefaultPluginClass;
+typedef struct _MetaDefaultPlugin MetaDefaultPlugin;
+typedef struct _MetaDefaultPluginClass MetaDefaultPluginClass;
 typedef struct _MetaDefaultPluginPrivate MetaDefaultPluginPrivate;
 
 struct _MetaDefaultPlugin
@@ -72,32 +81,32 @@ struct _MetaDefaultPluginClass
 static GQuark actor_data_quark = 0;
 static GQuark display_tile_preview_data_quark = 0;
 
-static void start      (MetaPlugin      *plugin);
-static void minimize   (MetaPlugin      *plugin,
-                        MetaWindowActor *actor);
-static void map        (MetaPlugin      *plugin,
-                        MetaWindowActor *actor);
-static void destroy    (MetaPlugin      *plugin,
-                        MetaWindowActor *actor);
-
-static void switch_workspace (MetaPlugin          *plugin,
-                              gint                 from,
-                              gint                 to,
-                              MetaMotionDirection  direction);
-
-static void kill_window_effects   (MetaPlugin      *plugin,
-                                   MetaWindowActor *actor);
-static void kill_switch_workspace (MetaPlugin      *plugin);
-
-static void show_tile_preview (MetaPlugin      *plugin,
-                               MetaWindow      *window,
-                               MetaRectangle   *tile_rect,
-                               int              tile_monitor_number);
-static void hide_tile_preview (MetaPlugin      *plugin);
+static void start (MetaPlugin *plugin);
+static void minimize (MetaPlugin      *plugin,
+                      MetaWindowActor *actor);
+static void map (MetaPlugin      *plugin,
+                 MetaWindowActor *actor);
+static void destroy (MetaPlugin      *plugin,
+                     MetaWindowActor *actor);
+
+static void switch_workspace (MetaPlugin         *plugin,
+                              gint                from,
+                              gint                to,
+                              MetaMotionDirection direction);
+
+static void kill_window_effects (MetaPlugin      *plugin,
+                                 MetaWindowActor *actor);
+static void kill_switch_workspace (MetaPlugin *plugin);
+
+static void show_tile_preview (MetaPlugin    *plugin,
+                               MetaWindow    *window,
+                               MetaRectangle *tile_rect,
+                               int            tile_monitor_number);
+static void hide_tile_preview (MetaPlugin *plugin);
 
 static void confirm_display_change (MetaPlugin *plugin);
 
-static const MetaPluginInfo * plugin_info (MetaPlugin *plugin);
+static const MetaPluginInfo *plugin_info (MetaPlugin *plugin);
 
 /*
  * Plugin private data that we store in the .plugin_private member.
@@ -105,14 +114,14 @@ static const MetaPluginInfo * plugin_info (MetaPlugin *plugin);
 struct _MetaDefaultPluginPrivate
 {
   /* Valid only when switch_workspace effect is in progress */
-  ClutterTimeline       *tml_switch_workspace1;
-  ClutterTimeline       *tml_switch_workspace2;
-  ClutterActor          *desktop1;
-  ClutterActor          *desktop2;
+  ClutterTimeline *tml_switch_workspace1;
+  ClutterTimeline *tml_switch_workspace2;
+  ClutterActor *desktop1;
+  ClutterActor *desktop2;
 
-  ClutterActor          *background_group;
+  ClutterActor *background_group;
 
-  MetaPluginInfo         info;
+  MetaPluginInfo info;
 };
 
 META_PLUGIN_DECLARE_WITH_CODE (MetaDefaultPlugin, meta_default_plugin,
@@ -140,18 +149,18 @@ typedef struct
 
 typedef struct _DisplayTilePreview
 {
-  ClutterActor   *actor;
+  ClutterActor *actor;
 
-  GdkRGBA        *preview_color;
+  GdkRGBA *preview_color;
 
-  MetaRectangle   tile_rect;
+  MetaRectangle tile_rect;
 } DisplayTilePreview;
 
 static void
 meta_default_plugin_dispose (GObject *object)
 {
   /* MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (object)->priv;
-  */
+   */
   G_OBJECT_CLASS (meta_default_plugin_parent_class)->dispose (object);
 }
 
@@ -163,9 +172,9 @@ meta_default_plugin_finalize (GObject *object)
 
 static void
 meta_default_plugin_set_property (GObject      *object,
-                           guint         prop_id,
-                           const GValue *value,
-                           GParamSpec   *pspec)
+                                  guint         prop_id,
+                                  const GValue *value,
+                                  GParamSpec   *pspec)
 {
   switch (prop_id)
     {
@@ -177,9 +186,9 @@ meta_default_plugin_set_property (GObject      *object,
 
 static void
 meta_default_plugin_get_property (GObject    *object,
-                           guint       prop_id,
-                           GValue     *value,
-                           GParamSpec *pspec)
+                                  guint       prop_id,
+                                  GValue     *value,
+                                  GParamSpec *pspec)
 {
   switch (prop_id)
     {
@@ -192,23 +201,23 @@ meta_default_plugin_get_property (GObject    *object,
 static void
 meta_default_plugin_class_init (MetaDefaultPluginClass *klass)
 {
-  GObjectClass      *gobject_class = G_OBJECT_CLASS (klass);
-  MetaPluginClass *plugin_class  = META_PLUGIN_CLASS (klass);
+  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+  MetaPluginClass *plugin_class = META_PLUGIN_CLASS (klass);
 
-  gobject_class->finalize        = meta_default_plugin_finalize;
-  gobject_class->dispose         = meta_default_plugin_dispose;
-  gobject_class->set_property    = meta_default_plugin_set_property;
-  gobject_class->get_property    = meta_default_plugin_get_property;
+  gobject_class->finalize = meta_default_plugin_finalize;
+  gobject_class->dispose = meta_default_plugin_dispose;
+  gobject_class->set_property = meta_default_plugin_set_property;
+  gobject_class->get_property = meta_default_plugin_get_property;
 
-  plugin_class->start            = start;
-  plugin_class->map              = map;
-  plugin_class->minimize         = minimize;
-  plugin_class->destroy          = destroy;
+  plugin_class->start = start;
+  plugin_class->map = map;
+  plugin_class->minimize = minimize;
+  plugin_class->destroy = destroy;
   plugin_class->switch_workspace = switch_workspace;
   plugin_class->show_tile_preview = show_tile_preview;
   plugin_class->hide_tile_preview = hide_tile_preview;
-  plugin_class->plugin_info      = plugin_info;
-  plugin_class->kill_window_effects   = kill_window_effects;
+  plugin_class->plugin_info = plugin_info;
+  plugin_class->kill_window_effects = kill_window_effects;
   plugin_class->kill_switch_workspace = kill_switch_workspace;
   plugin_class->confirm_display_change = confirm_display_change;
 }
@@ -220,10 +229,10 @@ meta_default_plugin_init (MetaDefaultPlugin *self)
 
   self->priv = priv = META_DEFAULT_PLUGIN_GET_PRIVATE (self);
 
-  priv->info.name        = "Default Effects";
-  priv->info.version     = "0.1";
-  priv->info.author      = "Intel Corp.";
-  priv->info.license     = "GPL";
+  priv->info.name = "Default Effects";
+  priv->info.version = "0.1";
+  priv->info.author = "Intel Corp.";
+  priv->info.license = "GPL";
   priv->info.description = "This is an example of a plugin implementation.";
 }
 
@@ -258,10 +267,10 @@ get_actor_private (MetaWindowActor *actor)
 }
 
 static ClutterTimeline *
-actor_animate (ClutterActor         *actor,
-               ClutterAnimationMode  mode,
-               guint                 duration,
-               const gchar          *first_property,
+actor_animate (ClutterActor        *actor,
+               ClutterAnimationMode mode,
+               guint                duration,
+               const gchar         *first_property,
                ...)
 {
   va_list args;
@@ -285,7 +294,7 @@ actor_animate (ClutterActor         *actor,
 static void
 on_switch_workspace_effect_complete (ClutterTimeline *timeline, gpointer data)
 {
-  MetaPlugin               *plugin  = META_PLUGIN (data);
+  MetaPlugin *plugin = META_PLUGIN (data);
   MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (plugin)->priv;
   MetaDisplay *display = meta_plugin_get_display (plugin);
   GList *l = meta_get_window_actors (display);
@@ -347,9 +356,9 @@ on_monitors_changed (MetaMonitorManager *monitor_manager,
       clutter_actor_set_size (background_actor, rect.width, rect.height);
 
       /* Don't use rand() here, mesa calls srand() internally when
-         parsing the driconf XML, but it's nice if the colors are
-         reproducible.
-      */
+       *  parsing the driconf XML, but it's nice if the colors are
+       *  reproducible.
+       */
       clutter_color_init (&color,
                           g_rand_int_range (rand, 0, 255),
                           g_rand_int_range (rand, 0, 255),
@@ -358,10 +367,12 @@ on_monitors_changed (MetaMonitorManager *monitor_manager,
 
       background = meta_background_new (display);
       meta_background_set_color (background, &color);
-      meta_background_actor_set_background (META_BACKGROUND_ACTOR (background_actor), background);
+      meta_background_actor_set_background (META_BACKGROUND_ACTOR (
+                                              background_actor), background);
       g_object_unref (background);
 
-      meta_background_actor_set_vignette (META_BACKGROUND_ACTOR (background_actor),
+      meta_background_actor_set_vignette (META_BACKGROUND_ACTOR (
+                                            background_actor),
                                           TRUE,
                                           0.5,
                                           0.5);
@@ -398,11 +409,11 @@ switch_workspace (MetaPlugin *plugin,
 {
   MetaDisplay *display;
   MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (plugin)->priv;
-  GList        *l;
-  ClutterActor *workspace0  = clutter_actor_new ();
-  ClutterActor *workspace1  = clutter_actor_new ();
+  GList *l;
+  ClutterActor *workspace0 = clutter_actor_new ();
+  ClutterActor *workspace1 = clutter_actor_new ();
   ClutterActor *stage;
-  int           screen_width, screen_height;
+  int screen_width, screen_height;
 
   display = meta_plugin_get_display (plugin);
   stage = meta_get_stage_for_display (display);
@@ -432,12 +443,14 @@ switch_workspace (MetaPlugin *plugin,
   while (l)
     {
       MetaWindowActor *window_actor = l->data;
-      ActorPrivate    *apriv       = get_actor_private (window_actor);
-      ClutterActor    *actor       = CLUTTER_ACTOR (window_actor);
-      MetaWorkspace   *workspace;
-      gint             win_workspace;
+      ActorPrivate *apriv = get_actor_private (window_actor);
+      ClutterActor *actor = CLUTTER_ACTOR (window_actor);
+      MetaWorkspace *workspace;
+      gint win_workspace;
 
-      workspace = meta_window_get_workspace (meta_window_actor_get_meta_window (window_actor));
+      workspace =
+        meta_window_get_workspace (meta_window_actor_get_meta_window (
+                                     window_actor));
       win_workspace = meta_workspace_index (workspace);
 
       if (win_workspace == to || win_workspace == from)
@@ -493,7 +506,8 @@ switch_workspace (MetaPlugin *plugin,
  * calls the manager callback function.
  */
 static void
-on_minimize_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data)
+on_minimize_effect_complete (ClutterTimeline    *timeline,
+                             EffectCompleteData *data)
 {
   /*
    * Must reverse the effect of the effect; must hide it first to ensure
@@ -528,12 +542,12 @@ minimize (MetaPlugin *plugin, MetaWindowActor *window_actor)
   MetaWindowType type;
   MetaRectangle icon_geometry;
   MetaWindow *meta_window = meta_window_actor_get_meta_window (window_actor);
-  ClutterActor *actor  = CLUTTER_ACTOR (window_actor);
+  ClutterActor *actor = CLUTTER_ACTOR (window_actor);
 
 
   type = meta_window_get_window_type (meta_window);
 
-  if (!meta_window_get_icon_geometry(meta_window, &icon_geometry))
+  if (!meta_window_get_icon_geometry (meta_window, &icon_geometry))
     {
       icon_geometry.x = 0;
       icon_geometry.y = 0;
@@ -549,15 +563,14 @@ minimize (MetaPlugin *plugin, MetaWindowActor *window_actor)
                                            MINIMIZE_TIMEOUT,
                                            "scale-x", 0.0,
                                            "scale-y", 0.0,
-                                           "x", (double)icon_geometry.x,
-                                           "y", (double)icon_geometry.y,
+                                           "x", (double) icon_geometry.x,
+                                           "y", (double) icon_geometry.y,
                                            NULL);
       data->plugin = plugin;
       data->actor = actor;
       g_signal_connect (apriv->tml_minimize, "completed",
                         G_CALLBACK (on_minimize_effect_complete),
                         data);
-
     }
   else
     meta_plugin_minimize_completed (plugin, window_actor);
@@ -570,8 +583,8 @@ on_map_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data)
    * Must reverse the effect of the effect.
    */
   MetaPlugin *plugin = data->plugin;
-  MetaWindowActor  *window_actor = META_WINDOW_ACTOR (data->actor);
-  ActorPrivate  *apriv = get_actor_private (window_actor);
+  MetaWindowActor *window_actor = META_WINDOW_ACTOR (data->actor);
+  ActorPrivate *apriv = get_actor_private (window_actor);
 
   apriv->tml_map = NULL;
 
@@ -679,19 +692,23 @@ free_display_tile_preview (gpointer data)
 {
   DisplayTilePreview *preview = data;
 
-  if (G_LIKELY (preview != NULL)) {
-    clutter_actor_destroy (preview->actor);
-    g_slice_free (DisplayTilePreview, preview);
-  }
+  if (G_LIKELY (preview != NULL))
+    {
+      clutter_actor_destroy (preview->actor);
+      g_slice_free (DisplayTilePreview, preview);
+    }
 }
 
 static DisplayTilePreview *
 get_display_tile_preview (MetaDisplay *display)
 {
-  DisplayTilePreview *preview = g_object_get_qdata (G_OBJECT (display), display_tile_preview_data_quark);
+  DisplayTilePreview *preview = g_object_get_qdata (G_OBJECT (
+                                                      display),
+                                                    display_tile_preview_data_quark);
 
   if (G_UNLIKELY (display_tile_preview_data_quark == 0))
-    display_tile_preview_data_quark = g_quark_from_static_string (DISPLAY_TILE_PREVIEW_DATA_KEY);
+    display_tile_preview_data_quark = g_quark_from_static_string (
+      DISPLAY_TILE_PREVIEW_DATA_KEY);
 
   if (G_UNLIKELY (!preview))
     {
@@ -701,7 +718,8 @@ get_display_tile_preview (MetaDisplay *display)
       clutter_actor_set_background_color (preview->actor, CLUTTER_COLOR_Blue);
       clutter_actor_set_opacity (preview->actor, 100);
 
-      clutter_actor_add_child (meta_get_window_group_for_display (display), preview->actor);
+      clutter_actor_add_child (meta_get_window_group_for_display (
+                                 display), preview->actor);
       g_object_set_qdata_full (G_OBJECT (display),
                                display_tile_preview_data_quark, preview,
                                free_display_tile_preview);
@@ -733,7 +751,8 @@ show_tile_preview (MetaPlugin    *plugin,
   clutter_actor_show (preview->actor);
 
   window_actor = CLUTTER_ACTOR (meta_window_get_compositor_private (window));
-  clutter_actor_set_child_below_sibling (clutter_actor_get_parent (preview->actor),
+  clutter_actor_set_child_below_sibling (clutter_actor_get_parent (preview->
+                                                                   actor),
                                          preview->actor,
                                          window_actor);
 
@@ -750,7 +769,7 @@ hide_tile_preview (MetaPlugin *plugin)
 }
 
 static void
-kill_switch_workspace (MetaPlugin     *plugin)
+kill_switch_workspace (MetaPlugin *plugin)
 {
   MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (plugin)->priv;
 
diff --git a/src/compositor/region-utils.c b/src/compositor/region-utils.c
index b268fd346..5655e8d33 100644
--- a/src/compositor/region-utils.c
+++ b/src/compositor/region-utils.c
@@ -30,17 +30,20 @@
  * that are unsorted or overlap; unioning such a set of rectangles 1-by-1
  * using cairo_region_union_rectangle() produces O(N^2) behavior (if the union
  * adds or removes rectangles in the middle of the region, then it has to
- * move all the rectangles after that.) To avoid this behavior, MetaRegionBuilder
+ * move all the rectangles after that.) To avoid this behavior,
+ *MetaRegionBuilder
  * creates regions for small groups of rectangles and merges them together in
  * a binary tree.
  *
- * Possible improvement: From a glance at the code, accumulating all the rectangles
+ * Possible improvement: From a glance at the code, accumulating all the
+ *rectangles
  *  into a flat array and then calling the (not usefully documented)
  *  cairo_region_create_rectangles() would have the same behavior and would be
  *  simpler and a bit more efficient.
  */
 
-/* Optimium performance seems to be with MAX_CHUNK_RECTANGLES=4; 8 is about 10% slower.
+/* Optimium performance seems to be with MAX_CHUNK_RECTANGLES=4; 8 is about 10%
+ * slower.
  * But using 8 may be more robust to systems with slow malloc(). */
 #define MAX_CHUNK_RECTANGLES 8
 
@@ -112,7 +115,7 @@ meta_region_builder_finish (MetaRegionBuilder *builder)
             result = builder->levels[i];
           else
             {
-              cairo_region_union(result, builder->levels[i]);
+              cairo_region_union (result, builder->levels[i]);
               cairo_region_destroy (builder->levels[i]);
             }
         }
@@ -165,7 +168,8 @@ meta_region_iterator_next (MetaRegionIterator *iter)
 
   if (iter->i + 1 < iter->n_rectangles)
     {
-      cairo_region_get_rectangle (iter->region, iter->i + 1, &iter->next_rectangle);
+      cairo_region_get_rectangle (iter->region, iter->i + 1,
+                                  &iter->next_rectangle);
       iter->line_end = iter->next_rectangle.y != iter->rectangle.y;
     }
   else
@@ -175,9 +179,9 @@ meta_region_iterator_next (MetaRegionIterator *iter)
 }
 
 cairo_region_t *
-meta_region_scale_double (cairo_region_t       *region,
-                          double                scale,
-                          MetaRoundingStrategy  rounding_strategy)
+meta_region_scale_double (cairo_region_t      *region,
+                          double               scale,
+                          MetaRoundingStrategy rounding_strategy)
 {
   int n_rects, i;
   cairo_rectangle_int_t *rects;
@@ -190,7 +194,7 @@ meta_region_scale_double (cairo_region_t       *region,
 
   n_rects = cairo_region_num_rectangles (region);
 
-  rects = g_malloc (sizeof(cairo_rectangle_int_t) * n_rects);
+  rects = g_malloc (sizeof (cairo_rectangle_int_t) * n_rects);
   for (i = 0; i < n_rects; i++)
     {
       cairo_region_get_rectangle (region, i, &rects[i]);
@@ -231,7 +235,7 @@ meta_region_scale (cairo_region_t *region, int scale)
 
   n_rects = cairo_region_num_rectangles (region);
 
-  rects = g_malloc (sizeof(cairo_rectangle_int_t) * n_rects);
+  rects = g_malloc (sizeof (cairo_rectangle_int_t) * n_rects);
   for (i = 0; i < n_rects; i++)
     {
       cairo_region_get_rectangle (region, i, &rects[i]);
@@ -249,23 +253,25 @@ meta_region_scale (cairo_region_t *region, int scale)
 }
 
 static void
-add_expanded_rect (MetaRegionBuilder  *builder,
-                   int                 x,
-                   int                 y,
-                   int                 width,
-                   int                 height,
-                   int                 x_amount,
-                   int                 y_amount,
-                   gboolean            flip)
+add_expanded_rect (MetaRegionBuilder *builder,
+                   int                x,
+                   int                y,
+                   int                width,
+                   int                height,
+                   int                x_amount,
+                   int                y_amount,
+                   gboolean           flip)
 {
   if (flip)
     meta_region_builder_add_rectangle (builder,
                                        y - y_amount, x - x_amount,
-                                       height + 2 * y_amount, width + 2 * x_amount);
+                                       height + 2 * y_amount,
+                                       width + 2 * x_amount);
   else
     meta_region_builder_add_rectangle (builder,
                                        x - x_amount, y - y_amount,
-                                       width + 2 * x_amount, height + 2 * y_amount);
+                                       width + 2 * x_amount,
+                                       height + 2 * y_amount);
 }
 
 static cairo_region_t *
@@ -337,10 +343,14 @@ expand_region_inverse (cairo_region_t *region,
 
       if (iter.line_end)
         {
-          if (extents.x + extents.width > iter.rectangle.x + iter.rectangle.width)
+          if (extents.x + extents.width >
+              iter.rectangle.x + iter.rectangle.width)
             add_expanded_rect (&builder,
-                               iter.rectangle.x + iter.rectangle.width, iter.rectangle.y,
-                               (extents.x + extents.width) - (iter.rectangle.x + iter.rectangle.width), 
iter.rectangle.height,
+                               iter.rectangle.x + iter.rectangle.width,
+                               iter.rectangle.y,
+                               (extents.x + extents.width) -
+                               (iter.rectangle.x + iter.rectangle.width),
+                               iter.rectangle.height,
                                x_amount, y_amount, flip);
           last_x = extents.x;
         }
diff --git a/src/core/bell.c b/src/core/bell.c
index a4b049145..9ef2f5a9c 100644
--- a/src/core/bell.c
+++ b/src/core/bell.c
@@ -191,7 +191,7 @@ bell_flash_window_frame (MetaWindow *window)
    * flashed state, no matter how loaded we are.
    */
   id = g_timeout_add_full (META_PRIORITY_REDRAW, 100,
-        bell_unflash_frame, window->frame, NULL);
+                           bell_unflash_frame, window->frame, NULL);
   g_source_set_name_by_id (id, "[mutter] bell_unflash_frame");
 }
 
@@ -260,9 +260,11 @@ bell_audible_notify (MetaDisplay *display,
   if (window)
     {
       ca_proplist_sets (p, CA_PROP_WINDOW_NAME, window->title);
-      ca_proplist_setf (p, CA_PROP_WINDOW_X11_XID, "%lu", (unsigned long)window->xwindow);
+      ca_proplist_setf (p, CA_PROP_WINDOW_X11_XID, "%lu",
+                        (unsigned long) window->xwindow);
       ca_proplist_sets (p, CA_PROP_APPLICATION_NAME, window->res_name);
-      ca_proplist_setf (p, CA_PROP_APPLICATION_PROCESS_ID, "%d", window->net_wm_pid);
+      ca_proplist_setf (p, CA_PROP_APPLICATION_PROCESS_ID, "%d",
+                        window->net_wm_pid);
     }
 
   res = ca_context_play_full (ca_gtk_context_get (), 1, p, NULL, NULL);
diff --git a/src/core/boxes.c b/src/core/boxes.c
index 2725dfcbe..69697e814 100644
--- a/src/core/boxes.c
+++ b/src/core/boxes.c
@@ -59,13 +59,15 @@ meta_rectangle_get_type (void)
   static GType type_id = 0;
 
   if (!type_id)
-    type_id = g_boxed_type_register_static (g_intern_static_string ("MetaRectangle"),
-                                           (GBoxedCopyFunc) meta_rectangle_copy,
-                                           (GBoxedFreeFunc) meta_rectangle_free);
+    type_id =
+      g_boxed_type_register_static (g_intern_static_string (
+                                      "MetaRectangle"),
+                                    (GBoxedCopyFunc) meta_rectangle_copy,
+                                    (GBoxedFreeFunc) meta_rectangle_free);
   return type_id;
 }
 
-char*
+char *
 meta_rectangle_to_string (const MetaRectangle *rect,
                           char                *output)
 {
@@ -79,7 +81,7 @@ meta_rectangle_to_string (const MetaRectangle *rect,
   return output;
 }
 
-char*
+char *
 meta_rectangle_region_to_string (GList      *region,
                                  const char *separator_string,
                                  char       *output)
@@ -111,7 +113,7 @@ meta_rectangle_region_to_string (GList      *region,
   return output;
 }
 
-char*
+char *
 meta_rectangle_edge_to_string (const MetaEdge *edge,
                                char           *output)
 {
@@ -129,7 +131,7 @@ meta_rectangle_edge_to_string (const MetaEdge *edge,
   return output;
 }
 
-char*
+char *
 meta_rectangle_edge_list_to_string (GList      *edge_list,
                                     const char *separator_string,
                                     char       *output)
@@ -152,7 +154,7 @@ meta_rectangle_edge_list_to_string (GList      *edge_list,
 
   while (tmp)
     {
-      MetaEdge      *edge = tmp->data;
+      MetaEdge *edge = tmp->data;
       MetaRectangle *rect = &edge->rect;
       g_snprintf (rect_string, EDGE_LENGTH, "([%d,%d +%d,%d], %2d, %2d)",
                   rect->x, rect->y, rect->width, rect->height,
@@ -172,7 +174,7 @@ meta_rect (int x, int y, int width, int height)
   MetaRectangle temporary;
   temporary.x = x;
   temporary.y = y;
-  temporary.width  = width;
+  temporary.width = width;
   temporary.height = height;
 
   return temporary;
@@ -197,8 +199,8 @@ meta_rectangle_area (const MetaRectangle *rect)
  */
 gboolean
 meta_rectangle_intersect (const MetaRectangle *src1,
-                         const MetaRectangle *src2,
-                         MetaRectangle *dest)
+                          const MetaRectangle *src2,
+                          MetaRectangle       *dest)
 {
   int dest_x, dest_y;
   int dest_w, dest_h;
@@ -290,8 +292,8 @@ meta_rectangle_overlap (const MetaRectangle *rect1,
   g_return_val_if_fail (rect1 != NULL, FALSE);
   g_return_val_if_fail (rect2 != NULL, FALSE);
 
-  return !((rect1->x + rect1->width  <= rect2->x) ||
-           (rect2->x + rect2->width  <= rect1->x) ||
+  return !((rect1->x + rect1->width <= rect2->x) ||
+           (rect2->x + rect2->width <= rect1->x) ||
            (rect1->y + rect1->height <= rect2->y) ||
            (rect2->y + rect2->height <= rect1->y));
 }
@@ -316,7 +318,7 @@ gboolean
 meta_rectangle_could_fit_rect (const MetaRectangle *outer_rect,
                                const MetaRectangle *inner_rect)
 {
-  return (outer_rect->width  >= inner_rect->width &&
+  return (outer_rect->width >= inner_rect->width &&
           outer_rect->height >= inner_rect->height);
 }
 
@@ -325,9 +327,9 @@ meta_rectangle_contains_rect  (const MetaRectangle *outer_rect,
                                const MetaRectangle *inner_rect)
 {
   return
-    inner_rect->x                      >= outer_rect->x &&
-    inner_rect->y                      >= outer_rect->y &&
-    inner_rect->x + inner_rect->width  <= outer_rect->x + outer_rect->width &&
+    inner_rect->x >= outer_rect->x &&
+    inner_rect->y >= outer_rect->y &&
+    inner_rect->x + inner_rect->width <= outer_rect->x + outer_rect->width &&
     inner_rect->y + inner_rect->height <= outer_rect->y + outer_rect->height;
 }
 
@@ -378,7 +380,7 @@ meta_rectangle_resize_with_gravity (const MetaRectangle *old_rect,
        * would cause drift.
        */
       new_width -= (old_rect->width - new_width) % 2;
-      rect->x = old_rect->x + (old_rect->width - new_width)/2;
+      rect->x = old_rect->x + (old_rect->width - new_width) / 2;
       break;
 
     case NorthEastGravity:
@@ -410,7 +412,7 @@ meta_rectangle_resize_with_gravity (const MetaRectangle *old_rect,
        * would cause drift.
        */
       new_height -= (old_rect->height - new_height) % 2;
-      rect->y = old_rect->y + (old_rect->height - new_height)/2;
+      rect->y = old_rect->y + (old_rect->height - new_height) / 2;
       break;
 
     case SouthWestGravity:
@@ -428,7 +430,7 @@ meta_rectangle_resize_with_gravity (const MetaRectangle *old_rect,
 }
 
 /* Not so simple helper function for get_minimal_spanning_set_for_region() */
-static GList*
+static GList *
 merge_spanning_rects_in_region (GList *region)
 {
   /* NOTE FOR ANY OPTIMIZATION PEOPLE OUT THERE: Please see the
@@ -436,7 +438,7 @@ merge_spanning_rects_in_region (GList *region)
    * considerations that also apply to this function.
    */
 
-  GList* compare;
+  GList *compare;
   compare = region;
 
   if (region == NULL)
@@ -528,7 +530,6 @@ merge_spanning_rects_in_region (GList *region)
               g_free (delete_me->data);
               region = g_list_delete_link (region, delete_me);
             }
-
         }
 
       compare = compare->next;
@@ -590,10 +591,10 @@ check_strut_align (MetaStrut *strut, const MetaRectangle *rect)
  *
  * Returns: (transfer full) (element-type Meta.Rectangle): Minimal spanning set
  */
-GList*
+GList *
 meta_rectangle_get_minimal_spanning_set_for_region (
   const MetaRectangle *basic_rect,
-  const GSList  *all_struts)
+  const GSList        *all_struts)
 {
   /* NOTE FOR OPTIMIZERS: This function *might* be somewhat slow,
    * especially due to the call to merge_spanning_rects_in_region() (which
@@ -631,9 +632,9 @@ meta_rectangle_get_minimal_spanning_set_for_region (
    *     URL splitting.)
    */
 
-  GList         *ret;
-  GList         *tmp_list;
-  const GSList  *strut_iter;
+  GList *ret;
+  GList *tmp_list;
+  const GSList *strut_iter;
   MetaRectangle *temp_rect;
 
   /* The algorithm is basically as follows:
@@ -654,7 +655,7 @@ meta_rectangle_get_minimal_spanning_set_for_region (
   for (strut_iter = all_struts; strut_iter; strut_iter = strut_iter->next)
     {
       GList *rect_iter;
-      MetaStrut *strut = (MetaStrut*)strut_iter->data;
+      MetaStrut *strut = (MetaStrut *) strut_iter->data;
       MetaRectangle *strut_rect = &strut->rect;
 
       tmp_list = ret;
@@ -662,7 +663,7 @@ meta_rectangle_get_minimal_spanning_set_for_region (
       rect_iter = tmp_list;
       while (rect_iter)
         {
-          MetaRectangle *rect = (MetaRectangle*) rect_iter->data;
+          MetaRectangle *rect = (MetaRectangle *) rect_iter->data;
 
           if (!meta_rectangle_overlap (strut_rect, rect) ||
               !check_strut_align (strut, basic_rect))
@@ -684,7 +685,7 @@ meta_rectangle_get_minimal_spanning_set_for_region (
                   temp_rect = g_new (MetaRectangle, 1);
                   *temp_rect = *rect;
                   new_x = BOX_RIGHT (*strut_rect);
-                  temp_rect->width = BOX_RIGHT(*rect) - new_x;
+                  temp_rect->width = BOX_RIGHT (*rect) - new_x;
                   temp_rect->x = new_x;
                   ret = g_list_prepend (ret, temp_rect);
                 }
@@ -727,12 +728,12 @@ meta_rectangle_get_minimal_spanning_set_for_region (
  * meta_rectangle_expand_region: (skip)
  *
  */
-GList*
-meta_rectangle_expand_region (GList     *region,
-                              const int  left_expand,
-                              const int  right_expand,
-                              const int  top_expand,
-                              const int  bottom_expand)
+GList *
+meta_rectangle_expand_region (GList    *region,
+                              const int left_expand,
+                              const int right_expand,
+                              const int top_expand,
+                              const int bottom_expand)
 {
   return meta_rectangle_expand_region_conditionally (region,
                                                      left_expand,
@@ -747,27 +748,27 @@ meta_rectangle_expand_region (GList     *region,
  * meta_rectangle_expand_region_conditionally: (skip)
  *
  */
-GList*
-meta_rectangle_expand_region_conditionally (GList     *region,
-                                            const int  left_expand,
-                                            const int  right_expand,
-                                            const int  top_expand,
-                                            const int  bottom_expand,
-                                            const int  min_x,
-                                            const int  min_y)
+GList *
+meta_rectangle_expand_region_conditionally (GList    *region,
+                                            const int left_expand,
+                                            const int right_expand,
+                                            const int top_expand,
+                                            const int bottom_expand,
+                                            const int min_x,
+                                            const int min_y)
 {
   GList *tmp_list = region;
   while (tmp_list)
     {
-      MetaRectangle *rect = (MetaRectangle*) tmp_list->data;
+      MetaRectangle *rect = (MetaRectangle *) tmp_list->data;
       if (rect->width >= min_x)
         {
-          rect->x      -= left_expand;
-          rect->width  += (left_expand + right_expand);
+          rect->x -= left_expand;
+          rect->width += (left_expand + right_expand);
         }
       if (rect->height >= min_y)
         {
-          rect->y      -= top_expand;
+          rect->y -= top_expand;
           rect->height += (top_expand + bottom_expand);
         }
       tmp_list = tmp_list->next;
@@ -790,16 +791,16 @@ meta_rectangle_expand_to_avoiding_struts (MetaRectangle       *rect,
    * horizontal directions (exclusive-)or both vertical directions.
    */
   g_assert ((direction == META_DIRECTION_HORIZONTAL) ^
-            (direction == META_DIRECTION_VERTICAL  ));
+            (direction == META_DIRECTION_VERTICAL));
 
   if (direction == META_DIRECTION_HORIZONTAL)
     {
-      rect->x      = expand_to->x;
-      rect->width  = expand_to->width;
+      rect->x = expand_to->x;
+      rect->width = expand_to->width;
     }
   else
     {
-      rect->y      = expand_to->y;
+      rect->y = expand_to->y;
       rect->height = expand_to->height;
     }
 
@@ -807,7 +808,7 @@ meta_rectangle_expand_to_avoiding_struts (MetaRectangle       *rect,
   /* Run over all struts */
   for (strut_iter = all_struts; strut_iter; strut_iter = strut_iter->next)
     {
-      MetaStrut *strut = (MetaStrut*) strut_iter->data;
+      MetaStrut *strut = (MetaStrut *) strut_iter->data;
 
       /* Skip struts that don't overlap */
       if (!meta_rectangle_overlap (&strut->rect, rect))
@@ -817,13 +818,13 @@ meta_rectangle_expand_to_avoiding_struts (MetaRectangle       *rect,
         {
           if (strut->side == META_SIDE_LEFT)
             {
-              int offset = BOX_RIGHT(strut->rect) - BOX_LEFT(*rect);
-              rect->x     += offset;
+              int offset = BOX_RIGHT (strut->rect) - BOX_LEFT (*rect);
+              rect->x += offset;
               rect->width -= offset;
             }
           else if (strut->side == META_SIDE_RIGHT)
             {
-              int offset = BOX_RIGHT (*rect) - BOX_LEFT(strut->rect);
+              int offset = BOX_RIGHT (*rect) - BOX_LEFT (strut->rect);
               rect->width -= offset;
             }
           /* else ignore the strut */
@@ -832,13 +833,13 @@ meta_rectangle_expand_to_avoiding_struts (MetaRectangle       *rect,
         {
           if (strut->side == META_SIDE_TOP)
             {
-              int offset = BOX_BOTTOM(strut->rect) - BOX_TOP(*rect);
-              rect->y      += offset;
+              int offset = BOX_BOTTOM (strut->rect) - BOX_TOP (*rect);
+              rect->y += offset;
               rect->height -= offset;
             }
           else if (strut->side == META_SIDE_BOTTOM)
             {
-              int offset = BOX_BOTTOM(*rect) - BOX_TOP(strut->rect);
+              int offset = BOX_BOTTOM (*rect) - BOX_TOP (strut->rect);
               rect->height -= offset;
             }
           /* else ignore the strut */
@@ -850,7 +851,7 @@ void
 meta_rectangle_free_list_and_elements (GList *filled_list)
 {
   g_list_foreach (filled_list,
-                  (void (*)(gpointer,gpointer))&g_free, /* ew, for ugly */
+                  (void (*)(gpointer, gpointer)) & g_free, /* ew, for ugly */
                   NULL);
   g_list_free (filled_list);
 }
@@ -860,7 +861,7 @@ meta_rectangle_could_fit_in_region (const GList         *spanning_rects,
                                     const MetaRectangle *rect)
 {
   const GList *temp;
-  gboolean     could_fit;
+  gboolean could_fit;
 
   temp = spanning_rects;
   could_fit = FALSE;
@@ -878,7 +879,7 @@ meta_rectangle_contained_in_region (const GList         *spanning_rects,
                                     const MetaRectangle *rect)
 {
   const GList *temp;
-  gboolean     contained;
+  gboolean contained;
 
   temp = spanning_rects;
   contained = FALSE;
@@ -896,7 +897,7 @@ meta_rectangle_overlaps_with_region (const GList         *spanning_rects,
                                      const MetaRectangle *rect)
 {
   const GList *temp;
-  gboolean     overlaps;
+  gboolean overlaps;
 
   temp = spanning_rects;
   overlaps = FALSE;
@@ -918,7 +919,7 @@ meta_rectangle_clamp_to_fit_into_region (const GList         *spanning_rects,
 {
   const GList *temp;
   const MetaRectangle *best_rect = NULL;
-  int                  best_overlap = 0;
+  int best_overlap = 0;
 
   /* First, find best rectangle from spanning_rects to which we can clamp
    * rect to fit into.
@@ -926,7 +927,7 @@ meta_rectangle_clamp_to_fit_into_region (const GList         *spanning_rects,
   for (temp = spanning_rects; temp; temp = temp->next)
     {
       MetaRectangle *compare_rect = temp->data;
-      int            maximal_overlap_amount_for_compare;
+      int maximal_overlap_amount_for_compare;
 
       /* If x is fixed and the entire width of rect doesn't fit in compare,
        * skip this rectangle.
@@ -945,19 +946,19 @@ meta_rectangle_clamp_to_fit_into_region (const GList         *spanning_rects,
         continue;
 
       /* If compare can't hold the min_size window, skip this rectangle. */
-      if (compare_rect->width  < min_size->width ||
+      if (compare_rect->width < min_size->width ||
           compare_rect->height < min_size->height)
         continue;
 
       /* Determine maximal overlap amount */
       maximal_overlap_amount_for_compare =
-        MIN (rect->width,  compare_rect->width) *
+        MIN (rect->width, compare_rect->width) *
         MIN (rect->height, compare_rect->height);
 
       /* See if this is the best rect so far */
       if (maximal_overlap_amount_for_compare > best_overlap)
         {
-          best_rect    = compare_rect;
+          best_rect = compare_rect;
           best_overlap = maximal_overlap_amount_for_compare;
         }
     }
@@ -969,25 +970,25 @@ meta_rectangle_clamp_to_fit_into_region (const GList         *spanning_rects,
 
       /* If it doesn't fit, at least make it no bigger than it has to be */
       if (!(fixed_directions & FIXED_DIRECTION_X))
-        rect->width  = min_size->width;
+        rect->width = min_size->width;
       if (!(fixed_directions & FIXED_DIRECTION_Y))
         rect->height = min_size->height;
     }
   else
     {
-      rect->width  = MIN (rect->width,  best_rect->width);
+      rect->width = MIN (rect->width, best_rect->width);
       rect->height = MIN (rect->height, best_rect->height);
     }
 }
 
 void
-meta_rectangle_clip_to_region (const GList         *spanning_rects,
-                               FixedDirections      fixed_directions,
-                               MetaRectangle       *rect)
+meta_rectangle_clip_to_region (const GList    *spanning_rects,
+                               FixedDirections fixed_directions,
+                               MetaRectangle  *rect)
 {
   const GList *temp;
   const MetaRectangle *best_rect = NULL;
-  int                  best_overlap = 0;
+  int best_overlap = 0;
 
   /* First, find best rectangle from spanning_rects to which we will clip
    * rect into.
@@ -995,8 +996,8 @@ meta_rectangle_clip_to_region (const GList         *spanning_rects,
   for (temp = spanning_rects; temp; temp = temp->next)
     {
       MetaRectangle *compare_rect = temp->data;
-      MetaRectangle  overlap;
-      int            maximal_overlap_amount_for_compare;
+      MetaRectangle overlap;
+      int maximal_overlap_amount_for_compare;
 
       /* If x is fixed and the entire width of rect doesn't fit in compare,
        * skip the rectangle.
@@ -1021,7 +1022,7 @@ meta_rectangle_clip_to_region (const GList         *spanning_rects,
       /* See if this is the best rect so far */
       if (maximal_overlap_amount_for_compare > best_overlap)
         {
-          best_rect    = compare_rect;
+          best_rect = compare_rect;
           best_overlap = maximal_overlap_amount_for_compare;
         }
     }
@@ -1040,7 +1041,7 @@ meta_rectangle_clip_to_region (const GList         *spanning_rects,
         {
           /* Find the new left and right */
           int new_x = MAX (rect->x, best_rect->x);
-          rect->width = MIN ((rect->x + rect->width)           - new_x,
+          rect->width = MIN ((rect->x + rect->width) - new_x,
                              (best_rect->x + best_rect->width) - new_x);
           rect->x = new_x;
         }
@@ -1052,7 +1053,7 @@ meta_rectangle_clip_to_region (const GList         *spanning_rects,
         {
           /* Clip the top, if needed */
           int new_y = MAX (rect->y, best_rect->y);
-          rect->height = MIN ((rect->y + rect->height)           - new_y,
+          rect->height = MIN ((rect->y + rect->height) - new_y,
                               (best_rect->y + best_rect->height) - new_y);
           rect->y = new_y;
         }
@@ -1060,14 +1061,14 @@ meta_rectangle_clip_to_region (const GList         *spanning_rects,
 }
 
 void
-meta_rectangle_shove_into_region (const GList         *spanning_rects,
-                                  FixedDirections      fixed_directions,
-                                  MetaRectangle       *rect)
+meta_rectangle_shove_into_region (const GList    *spanning_rects,
+                                  FixedDirections fixed_directions,
+                                  MetaRectangle  *rect)
 {
   const GList *temp;
   const MetaRectangle *best_rect = NULL;
-  int                  best_overlap = 0;
-  int                  shortest_distance = G_MAXINT;
+  int best_overlap = 0;
+  int shortest_distance = G_MAXINT;
 
   /* First, find best rectangle from spanning_rects to which we will shove
    * rect into.
@@ -1076,8 +1077,8 @@ meta_rectangle_shove_into_region (const GList         *spanning_rects,
   for (temp = spanning_rects; temp; temp = temp->next)
     {
       MetaRectangle *compare_rect = temp->data;
-      int            maximal_overlap_amount_for_compare;
-      int            dist_to_compare;
+      int maximal_overlap_amount_for_compare;
+      int dist_to_compare;
 
       /* If x is fixed and the entire width of rect doesn't fit in compare,
        * skip this rectangle.
@@ -1097,7 +1098,7 @@ meta_rectangle_shove_into_region (const GList         *spanning_rects,
 
       /* Determine maximal overlap amount between rect & compare_rect */
       maximal_overlap_amount_for_compare =
-        MIN (rect->width,  compare_rect->width) *
+        MIN (rect->width, compare_rect->width) *
         MIN (rect->height, compare_rect->height);
 
       /* Determine distance necessary to put rect into compare_rect */
@@ -1116,10 +1117,10 @@ meta_rectangle_shove_into_region (const GList         *spanning_rects,
       /* See if this is the best rect so far */
       if ((maximal_overlap_amount_for_compare > best_overlap) ||
           (maximal_overlap_amount_for_compare == best_overlap &&
-           dist_to_compare                    <  shortest_distance))
+           dist_to_compare < shortest_distance))
         {
-          best_rect         = compare_rect;
-          best_overlap      = maximal_overlap_amount_for_compare;
+          best_rect = compare_rect;
+          best_overlap = maximal_overlap_amount_for_compare;
           shortest_distance = dist_to_compare;
         }
     }
@@ -1162,12 +1163,12 @@ meta_rectangle_shove_into_region (const GList         *spanning_rects,
 }
 
 void
-meta_rectangle_find_linepoint_closest_to_point (double x1,
-                                                double y1,
-                                                double x2,
-                                                double y2,
-                                                double px,
-                                                double py,
+meta_rectangle_find_linepoint_closest_to_point (double  x1,
+                                                double  y1,
+                                                double  x2,
+                                                double  y2,
+                                                double  px,
+                                                double  py,
                                                 double *valx,
                                                 double *valy)
 {
@@ -1237,18 +1238,18 @@ meta_rectangle_edge_aligns (const MetaRectangle *rect, const MetaEdge *edge)
     {
     case META_SIDE_LEFT:
     case META_SIDE_RIGHT:
-      return BOX_TOP (*rect)      <= BOX_BOTTOM (edge->rect) &&
+      return BOX_TOP (*rect) <= BOX_BOTTOM (edge->rect) &&
              BOX_TOP (edge->rect) <= BOX_BOTTOM (*rect);
     case META_SIDE_TOP:
     case META_SIDE_BOTTOM:
-      return BOX_LEFT (*rect)      <= BOX_RIGHT (edge->rect) &&
+      return BOX_LEFT (*rect) <= BOX_RIGHT (edge->rect) &&
              BOX_LEFT (edge->rect) <= BOX_RIGHT (*rect);
     default:
       g_assert_not_reached ();
     }
 }
 
-static GList*
+static GList *
 get_rect_minus_overlap (const GList   *rect_in_list,
                         MetaRectangle *overlap)
 {
@@ -1274,18 +1275,18 @@ get_rect_minus_overlap (const GList   *rect_in_list,
   if (BOX_TOP (*rect) < BOX_TOP (*overlap))
     {
       temp = g_new (MetaRectangle, 1);
-      temp->x      = overlap->x;
-      temp->width  = overlap->width;
-      temp->y      = BOX_TOP (*rect);
+      temp->x = overlap->x;
+      temp->width = overlap->width;
+      temp->y = BOX_TOP (*rect);
       temp->height = BOX_TOP (*overlap) - BOX_TOP (*rect);
       ret = g_list_prepend (ret, temp);
     }
   if (BOX_BOTTOM (*rect) > BOX_BOTTOM (*overlap))
     {
       temp = g_new (MetaRectangle, 1);
-      temp->x      = overlap->x;
-      temp->width  = overlap->width;
-      temp->y      = BOX_BOTTOM (*overlap);
+      temp->x = overlap->x;
+      temp->width = overlap->width;
+      temp->y = BOX_BOTTOM (*overlap);
       temp->height = BOX_BOTTOM (*rect) - BOX_BOTTOM (*overlap);
       ret = g_list_prepend (ret, temp);
     }
@@ -1293,7 +1294,7 @@ get_rect_minus_overlap (const GList   *rect_in_list,
   return ret;
 }
 
-static GList*
+static GList *
 replace_rect_with_list (GList *old_element,
                         GList *new_list)
 {
@@ -1334,7 +1335,7 @@ replace_rect_with_list (GList *old_element,
  * that aren't disjoint in a way that the overlapping part is only included
  * once, so it's not really magic...).
  */
-static GList*
+static GList *
 get_disjoint_strut_rect_list_in_region (const GSList        *old_struts,
                                         const MetaRectangle *region)
 {
@@ -1345,7 +1346,7 @@ get_disjoint_strut_rect_list_in_region (const GSList        *old_struts,
   strut_rects = NULL;
   while (old_struts)
     {
-      MetaRectangle *cur = &((MetaStrut*)old_struts->data)->rect;
+      MetaRectangle *cur = &((MetaStrut *) old_struts->data)->rect;
       MetaRectangle *copy = g_new (MetaRectangle, 1);
       *copy = *cur;
       if (meta_rectangle_intersect (copy, region, copy))
@@ -1377,7 +1378,7 @@ get_disjoint_strut_rect_list_in_region (const GSList        *old_struts,
               /* Get a list of rectangles for each strut that don't overlap
                * the intersection region.
                */
-              GList *cur_leftover  = get_rect_minus_overlap (tmp,  &overlap);
+              GList *cur_leftover = get_rect_minus_overlap (tmp, &overlap);
               GList *comp_leftover = get_rect_minus_overlap (compare, &overlap);
 
               /* Add the intersection region to cur_leftover */
@@ -1392,7 +1393,7 @@ get_disjoint_strut_rect_list_in_region (const GSList        *old_struts,
                   tmp = strut_rects;
                 }
               else
-                tmp   = replace_rect_with_list (tmp,     cur_leftover);
+                tmp = replace_rect_with_list (tmp, cur_leftover);
               compare = replace_rect_with_list (compare, comp_leftover);
 
               if (compare == NULL)
@@ -1420,7 +1421,7 @@ meta_rectangle_edge_cmp_ignore_type (gconstpointer a, gconstpointer b)
   /* Edges must be both vertical or both horizontal, or it doesn't make
    * sense to compare them.
    */
-  g_assert ((a_edge_rect->rect.width  == 0 && b_edge_rect->rect.width == 0) ||
+  g_assert ((a_edge_rect->rect.width == 0 && b_edge_rect->rect.width == 0) ||
             (a_edge_rect->rect.height == 0 && b_edge_rect->rect.height == 0));
 
   a_compare = b_compare = 0;  /* gcc-3.4.2 sucks at figuring initialized'ness */
@@ -1498,7 +1499,7 @@ rectangle_and_edge_intersection (const MetaRectangle *rect,
                                  MetaEdge            *overlap,
                                  int                 *handle_type)
 {
-  const MetaRectangle *rect2  = &edge->rect;
+  const MetaRectangle *rect2 = &edge->rect;
   MetaRectangle *result = &overlap->rect;
   gboolean intersect = TRUE;
 
@@ -1509,13 +1510,13 @@ rectangle_and_edge_intersection (const MetaRectangle *rect,
   /* Figure out what the intersection is */
   result->x = MAX (rect->x, rect2->x);
   result->y = MAX (rect->y, rect2->y);
-  result->width  = MIN (BOX_RIGHT (*rect),  BOX_RIGHT (*rect2))  - result->x;
+  result->width = MIN (BOX_RIGHT (*rect), BOX_RIGHT (*rect2)) - result->x;
   result->height = MIN (BOX_BOTTOM (*rect), BOX_BOTTOM (*rect2)) - result->y;
 
   /* Find out if the intersection is empty; have to do it this way since
    * edges have a thickness of 0
    */
-  if ((result->width <  0 || result->height <  0) ||
+  if ((result->width < 0 || result->height < 0) ||
       (result->width == 0 && result->height == 0))
     {
       result->width = 0;
@@ -1576,7 +1577,7 @@ rectangle_and_edge_intersection (const MetaRectangle *rect,
  * rect_is_internal is false, the side types are switched (LEFT<->RIGHT and
  * TOP<->BOTTOM).
  */
-static GList*
+static GList *
 add_edges (GList               *cur_edges,
            const MetaRectangle *rect,
            gboolean             rect_is_internal)
@@ -1584,7 +1585,7 @@ add_edges (GList               *cur_edges,
   MetaEdge *temp_edge;
   int i;
 
-  for (i=0; i<4; i++)
+  for (i = 0; i < 4; i++)
     {
       temp_edge = g_new (MetaEdge, 1);
       temp_edge->rect = *rect;
@@ -1598,8 +1599,8 @@ add_edges (GList               *cur_edges,
         case 1:
           temp_edge->side_type =
             rect_is_internal ? META_SIDE_RIGHT : META_SIDE_LEFT;
-          temp_edge->rect.x     += temp_edge->rect.width;
-          temp_edge->rect.width  = 0;
+          temp_edge->rect.x += temp_edge->rect.width;
+          temp_edge->rect.width = 0;
           break;
         case 2:
           temp_edge->side_type =
@@ -1609,8 +1610,8 @@ add_edges (GList               *cur_edges,
         case 3:
           temp_edge->side_type =
             rect_is_internal ? META_SIDE_BOTTOM : META_SIDE_TOP;
-          temp_edge->rect.y      += temp_edge->rect.height;
-          temp_edge->rect.height  = 0;
+          temp_edge->rect.y += temp_edge->rect.height;
+          temp_edge->rect.height = 0;
           break;
         }
       temp_edge->edge_type = META_EDGE_SCREEN;
@@ -1623,8 +1624,8 @@ add_edges (GList               *cur_edges,
 /* Remove any part of old_edge that intersects remove and add any resulting
  * edges to cur_list.  Return cur_list when finished.
  */
-static GList*
-split_edge (GList *cur_list,
+static GList *
+split_edge (GList          *cur_list,
             const MetaEdge *old_edge,
             const MetaEdge *remove)
 {
@@ -1634,42 +1635,42 @@ split_edge (GList *cur_list,
     case META_SIDE_LEFT:
     case META_SIDE_RIGHT:
       g_assert (meta_rectangle_vert_overlap (&old_edge->rect, &remove->rect));
-      if (BOX_TOP (old_edge->rect)  < BOX_TOP (remove->rect))
+      if (BOX_TOP (old_edge->rect) < BOX_TOP (remove->rect))
         {
           temp_edge = g_new (MetaEdge, 1);
           *temp_edge = *old_edge;
           temp_edge->rect.height = BOX_TOP (remove->rect)
-                                 - BOX_TOP (old_edge->rect);
+                                   - BOX_TOP (old_edge->rect);
           cur_list = g_list_prepend (cur_list, temp_edge);
         }
       if (BOX_BOTTOM (old_edge->rect) > BOX_BOTTOM (remove->rect))
         {
           temp_edge = g_new (MetaEdge, 1);
           *temp_edge = *old_edge;
-          temp_edge->rect.y      = BOX_BOTTOM (remove->rect);
+          temp_edge->rect.y = BOX_BOTTOM (remove->rect);
           temp_edge->rect.height = BOX_BOTTOM (old_edge->rect)
-                                 - BOX_BOTTOM (remove->rect);
+                                   - BOX_BOTTOM (remove->rect);
           cur_list = g_list_prepend (cur_list, temp_edge);
         }
       break;
     case META_SIDE_TOP:
     case META_SIDE_BOTTOM:
       g_assert (meta_rectangle_horiz_overlap (&old_edge->rect, &remove->rect));
-      if (BOX_LEFT (old_edge->rect)  < BOX_LEFT (remove->rect))
+      if (BOX_LEFT (old_edge->rect) < BOX_LEFT (remove->rect))
         {
           temp_edge = g_new (MetaEdge, 1);
           *temp_edge = *old_edge;
           temp_edge->rect.width = BOX_LEFT (remove->rect)
-                                - BOX_LEFT (old_edge->rect);
+                                  - BOX_LEFT (old_edge->rect);
           cur_list = g_list_prepend (cur_list, temp_edge);
         }
       if (BOX_RIGHT (old_edge->rect) > BOX_RIGHT (remove->rect))
         {
           temp_edge = g_new (MetaEdge, 1);
           *temp_edge = *old_edge;
-          temp_edge->rect.x     = BOX_RIGHT (remove->rect);
+          temp_edge->rect.x = BOX_RIGHT (remove->rect);
           temp_edge->rect.width = BOX_RIGHT (old_edge->rect)
-                                - BOX_RIGHT (remove->rect);
+                                  - BOX_RIGHT (remove->rect);
           cur_list = g_list_prepend (cur_list, temp_edge);
         }
       break;
@@ -1684,12 +1685,12 @@ split_edge (GList *cur_list,
  * if and how rect and edge intersect.
  */
 static void
-fix_up_edges (MetaRectangle *rect,         MetaEdge *edge,
-              GList         **strut_edges, GList    **edge_splits,
-              gboolean      *edge_needs_removal)
+fix_up_edges (MetaRectangle *rect, MetaEdge *edge,
+              GList **strut_edges, GList **edge_splits,
+              gboolean *edge_needs_removal)
 {
   MetaEdge overlap;
-  int      handle_type;
+  int handle_type;
 
   if (!rectangle_and_edge_intersection (rect, edge, &overlap, &handle_type))
     return;
@@ -1734,10 +1735,9 @@ fix_up_edges (MetaRectangle *rect,         MetaEdge *edge,
  * This function removes intersections of edges with the rectangles from the
  * list of edges.
  */
-GList*
-meta_rectangle_remove_intersections_with_boxes_from_edges (
-  GList        *edges,
-  const GSList *rectangles)
+GList *
+meta_rectangle_remove_intersections_with_boxes_from_edges (GList        *edges,
+                                                           const GSList *rectangles)
 {
   const GSList *rect_iter;
   const int opposing = 1;
@@ -1752,13 +1752,12 @@ meta_rectangle_remove_intersections_with_boxes_from_edges (
         {
           MetaEdge *edge = edge_iter->data;
           MetaEdge overlap;
-          int      handle;
+          int handle;
           gboolean edge_iter_advanced = FALSE;
 
           /* If this edge overlaps with this rect... */
           if (rectangle_and_edge_intersection (rect, edge, &overlap, &handle))
             {
-
               /* "Intersections" where the edges touch but are opposite
                * sides (e.g. a left edge against the right edge) should not
                * be split.  Note that the comments in
@@ -1802,14 +1801,14 @@ meta_rectangle_remove_intersections_with_boxes_from_edges (
  *
  * This function is trying to find all the edges of an onscreen region.
  */
-GList*
+GList *
 meta_rectangle_find_onscreen_edges (const MetaRectangle *basic_rect,
                                     const GSList        *all_struts)
 {
-  GList        *ret;
-  GList        *fixed_strut_rects;
-  GList        *edge_iter;
-  const GList  *strut_rect_iter;
+  GList *ret;
+  GList *fixed_strut_rects;
+  GList *edge_iter;
+  const GList *strut_rect_iter;
 
   /* The algorithm is basically as follows:
    *   Make sure the struts are disjoint
@@ -1836,7 +1835,7 @@ meta_rectangle_find_onscreen_edges (const MetaRectangle *basic_rect,
   strut_rect_iter = fixed_strut_rects;
   while (strut_rect_iter)
     {
-      MetaRectangle *strut_rect = (MetaRectangle*) strut_rect_iter->data;
+      MetaRectangle *strut_rect = (MetaRectangle *) strut_rect_iter->data;
 
       /* Get the new possible edges we may need to add from the strut */
       GList *new_strut_edges = add_edges (NULL, strut_rect, FALSE);
@@ -1848,7 +1847,7 @@ meta_rectangle_find_onscreen_edges (const MetaRectangle *basic_rect,
           GList *splits_of_cur_edge = NULL;
           gboolean edge_needs_removal = FALSE;
 
-          fix_up_edges (strut_rect,       cur_edge,
+          fix_up_edges (strut_rect, cur_edge,
                         &new_strut_edges, &splits_of_cur_edge,
                         &edge_needs_removal);
 
@@ -1888,10 +1887,9 @@ meta_rectangle_find_onscreen_edges (const MetaRectangle *basic_rect,
  * meta_rectangle_find_nonintersected_monitor_edges: (skip)
  *
  */
-GList*
-meta_rectangle_find_nonintersected_monitor_edges (
-                                    const GList         *monitor_rects,
-                                    const GSList        *all_struts)
+GList *
+meta_rectangle_find_nonintersected_monitor_edges (const GList  *monitor_rects,
+                                                  const GSList *all_struts)
 {
   /* This function cannot easily be merged with
    * meta_rectangle_find_onscreen_edges() because real screen edges
@@ -1899,7 +1897,7 @@ meta_rectangle_find_nonintersected_monitor_edges (
    * immediately on the other side"; monitor edges are different.
    */
   GList *ret;
-  const GList  *cur;
+  const GList *cur;
   GSList *temp_rects;
 
   /* Initialize the return list to be empty */
@@ -1918,16 +1916,16 @@ meta_rectangle_find_nonintersected_monitor_edges (
           MetaRectangle *compare_rect = compare->data;
 
           /* Check if cur might be horizontally adjacent to compare */
-          if (meta_rectangle_vert_overlap(cur_rect, compare_rect))
+          if (meta_rectangle_vert_overlap (cur_rect, compare_rect))
             {
               MetaSide side_type;
-              int y      = MAX (cur_rect->y, compare_rect->y);
+              int y = MAX (cur_rect->y, compare_rect->y);
               int height = MIN (BOX_BOTTOM (*cur_rect) - y,
                                 BOX_BOTTOM (*compare_rect) - y);
-              int width  = 0;
+              int width = 0;
               int x;
 
-              if (BOX_LEFT (*cur_rect)  == BOX_RIGHT (*compare_rect))
+              if (BOX_LEFT (*cur_rect) == BOX_RIGHT (*compare_rect))
                 {
                   /* compare_rect is to the left of cur_rect */
                   x = BOX_LEFT (*cur_rect);
@@ -1950,7 +1948,7 @@ meta_rectangle_find_nonintersected_monitor_edges (
                    * a right edge for the monitor on the left.  Just fill
                    * up the edges and stick 'em on the list.
                    */
-                  MetaEdge *new_edge  = g_new (MetaEdge, 1);
+                  MetaEdge *new_edge = g_new (MetaEdge, 1);
 
                   new_edge->rect = meta_rect (x, y, width, height);
                   new_edge->side_type = side_type;
@@ -1961,16 +1959,16 @@ meta_rectangle_find_nonintersected_monitor_edges (
             }
 
           /* Check if cur might be vertically adjacent to compare */
-          if (meta_rectangle_horiz_overlap(cur_rect, compare_rect))
+          if (meta_rectangle_horiz_overlap (cur_rect, compare_rect))
             {
               MetaSide side_type;
-              int x      = MAX (cur_rect->x, compare_rect->x);
-              int width  = MIN (BOX_RIGHT (*cur_rect) - x,
-                                BOX_RIGHT (*compare_rect) - x);
+              int x = MAX (cur_rect->x, compare_rect->x);
+              int width = MIN (BOX_RIGHT (*cur_rect) - x,
+                               BOX_RIGHT (*compare_rect) - x);
               int height = 0;
               int y;
 
-              if (BOX_TOP (*cur_rect)  == BOX_BOTTOM (*compare_rect))
+              if (BOX_TOP (*cur_rect) == BOX_BOTTOM (*compare_rect))
                 {
                   /* compare_rect is to the top of cur_rect */
                   y = BOX_TOP (*cur_rect);
@@ -2011,7 +2009,7 @@ meta_rectangle_find_nonintersected_monitor_edges (
   temp_rects = NULL;
   for (; all_struts; all_struts = all_struts->next)
     temp_rects = g_slist_prepend (temp_rects,
-                                  &((MetaStrut*)all_struts->data)->rect);
+                                  &((MetaStrut *) all_struts->data)->rect);
   ret = meta_rectangle_remove_intersections_with_boxes_from_edges (ret,
                                                                    temp_rects);
   g_slist_free (temp_rects);
diff --git a/src/core/constraints.c b/src/core/constraints.c
index 078dbc063..9ef280940 100644
--- a/src/core/constraints.c
+++ b/src/core/constraints.c
@@ -38,66 +38,67 @@
 #include "meta/prefs.h"
 
 #if 0
- // This is the short and sweet version of how to hack on this file; see
- // doc/how-constraints-works.txt for the gory details.  The basics of
- // understanding this file can be shown by the steps needed to add a new
- // constraint, which are:
- //   1) Add a new entry in the ConstraintPriority enum; higher values
- //      have higher priority
- //   2) Write a new function following the format of the example below,
- //      "constrain_whatever".
- //   3) Add your function to the all_constraints and all_constraint_names
- //      arrays (the latter of which is for debugging purposes)
- //
- // An example constraint function, constrain_whatever:
- //
- // /* constrain_whatever does the following:
- //  *   Quits (returning true) if priority is higher than PRIORITY_WHATEVER
- //  *   If check_only is TRUE
- //  *     Returns whether the constraint is satisfied or not
- //  *   otherwise
- //  *     Enforces the constraint
- //  * Note that the value of PRIORITY_WHATEVER is centralized with the
- //  * priorities of other constraints in the definition of ConstrainPriority
- //  * for easier maintenance and shuffling of priorities.
- //  */
- // static gboolean
- // constrain_whatever (MetaWindow         *window,
- //                     ConstraintInfo     *info,
- //                     ConstraintPriority  priority,
- //                     gboolean            check_only)
- // {
- //   if (priority > PRIORITY_WHATEVER)
- //     return TRUE;
- //
- //   /* Determine whether constraint applies; note that if the constraint
- //    * cannot possibly be satisfied, constraint_applies should be set to
- //    * false.  If we don't do this, all constraints with a lesser priority
- //    * will be dropped along with this one, and we'd rather apply as many as
- //    * possible.
- //    */
- //   if (!constraint_applies)
- //     return TRUE;
- //
- //   /* Determine whether constraint is already satisfied; if we're only
- //    * checking the status of whether the constraint is satisfied, we end
- //    * here.
- //    */
- //   if (check_only || constraint_already_satisfied)
- //     return constraint_already_satisfied;
- //
- //   /* Enforce constraints */
- //   return TRUE;  /* Note that we exited early if check_only is FALSE; also,
- //                  * we know we can return TRUE here because we exited early
- //                  * if the constraint could not be satisfied; not that the
- //                  * return value is heeded in this case...
- //                  */
- // }
+/* This is the short and sweet version of how to hack on this file; see */
+/* doc/how-constraints-works.txt for the gory details.  The basics of */
+/* understanding this file can be shown by the steps needed to add a new */
+/* constraint, which are: */
+/*   1) Add a new entry in the ConstraintPriority enum; higher values */
+/*      have higher priority */
+/*   2) Write a new function following the format of the example below, */
+/*      "constrain_whatever". */
+/*   3) Add your function to the all_constraints and all_constraint_names */
+/*      arrays (the latter of which is for debugging purposes) */
+/* */
+/* An example constraint function, constrain_whatever: */
+/* */
+/* / * constrain_whatever does the following: */
+/*  *   Quits (returning true) if priority is higher than PRIORITY_WHATEVER */
+/*  *   If check_only is TRUE */
+/*  *     Returns whether the constraint is satisfied or not */
+/*  *   otherwise */
+/*  *     Enforces the constraint */
+/*  * Note that the value of PRIORITY_WHATEVER is centralized with the */
+/*  * priorities of other constraints in the definition of ConstrainPriority */
+/*  * for easier maintenance and shuffling of priorities. */
+/*  * / */
+/* static gboolean */
+/* constrain_whatever (MetaWindow         *window, */
+/*                     ConstraintInfo     *info, */
+/*                     ConstraintPriority  priority, */
+/*                     gboolean            check_only) */
+/* { */
+/*   if (priority > PRIORITY_WHATEVER) */
+/*     return TRUE; */
+/* */
+/*   / * Determine whether constraint applies; note that if the constraint */
+/*    * cannot possibly be satisfied, constraint_applies should be set to */
+/*    * false.  If we don't do this, all constraints with a lesser priority */
+/*    * will be dropped along with this one, and we'd rather apply as many as */
+/*    * possible. */
+/*    * / */
+/*   if (!constraint_applies) */
+/*     return TRUE; */
+/* */
+/*   / * Determine whether constraint is already satisfied; if we're only */
+/*    * checking the status of whether the constraint is satisfied, we end */
+/*    * here. */
+/*    * / */
+/*   if (check_only || constraint_already_satisfied) */
+/*     return constraint_already_satisfied; */
+/* */
+/*   / * Enforce constraints * / */
+/*   return TRUE;  / * Note that we exited early if check_only is FALSE; also, */
+/*                  * we know we can return TRUE here because we exited early */
+/*                  * if the constraint could not be satisfied; not that the */
+/*                  * return value is heeded in this case... */
+/*                  * / */
+/* } */
 #endif
 
 typedef enum
 {
-  PRIORITY_MINIMUM = 0, /* Dummy value used for loop start = min(all priorities) */
+  PRIORITY_MINIMUM = 0, /* Dummy value used for loop start = min(all priorities)
+                         * */
   PRIORITY_ASPECT_RATIO = 0,
   PRIORITY_ENTIRELY_VISIBLE_ON_SINGLE_MONITOR = 0,
   PRIORITY_ENTIRELY_VISIBLE_ON_WORKAREA = 1,
@@ -121,137 +122,140 @@ typedef enum
 
 typedef struct
 {
-  MetaRectangle        orig;
-  MetaRectangle        current;
-  ActionType           action_type;
-  gboolean             is_user_action;
+  MetaRectangle orig;
+  MetaRectangle current;
+  ActionType action_type;
+  gboolean is_user_action;
 
   /* I know that these two things probably look similar at first, but they
    * have much different uses.  See doc/how-constraints-works.txt for for
    * explanation of the differences and similarity between resize_gravity
    * and fixed_directions
    */
-  int                  resize_gravity;
-  FixedDirections      fixed_directions;
+  int resize_gravity;
+  FixedDirections fixed_directions;
 
   /* work_area_monitor - current monitor region minus struts
    * entire_monitor    - current monitor, including strut regions
    */
-  MetaRectangle        work_area_monitor;
-  MetaRectangle        entire_monitor;
+  MetaRectangle work_area_monitor;
+  MetaRectangle entire_monitor;
 
   /* Spanning rectangles for the non-covered (by struts) region of the
    * screen and also for just the current monitor
    */
-  GList  *usable_screen_region;
-  GList  *usable_monitor_region;
+  GList *usable_screen_region;
+  GList *usable_monitor_region;
 } ConstraintInfo;
 
-static gboolean do_screen_and_monitor_relative_constraints (MetaWindow     *window,
-                                                            GList          *region_spanning_rectangles,
-                                                            ConstraintInfo *info,
-                                                            gboolean        check_only);
-static gboolean constrain_custom_rule        (MetaWindow         *window,
-                                              ConstraintInfo     *info,
-                                              ConstraintPriority  priority,
-                                              gboolean            check_only);
-static gboolean constrain_modal_dialog       (MetaWindow         *window,
-                                              ConstraintInfo     *info,
-                                              ConstraintPriority  priority,
-                                              gboolean            check_only);
-static gboolean constrain_maximization       (MetaWindow         *window,
-                                              ConstraintInfo     *info,
-                                              ConstraintPriority  priority,
-                                              gboolean            check_only);
-static gboolean constrain_tiling             (MetaWindow         *window,
-                                              ConstraintInfo     *info,
-                                              ConstraintPriority  priority,
-                                              gboolean            check_only);
-static gboolean constrain_fullscreen         (MetaWindow         *window,
-                                              ConstraintInfo     *info,
-                                              ConstraintPriority  priority,
-                                              gboolean            check_only);
-static gboolean constrain_size_increments    (MetaWindow         *window,
-                                              ConstraintInfo     *info,
-                                              ConstraintPriority  priority,
-                                              gboolean            check_only);
-static gboolean constrain_size_limits        (MetaWindow         *window,
-                                              ConstraintInfo     *info,
-                                              ConstraintPriority  priority,
-                                              gboolean            check_only);
-static gboolean constrain_aspect_ratio       (MetaWindow         *window,
-                                              ConstraintInfo     *info,
-                                              ConstraintPriority  priority,
-                                              gboolean            check_only);
-static gboolean constrain_to_single_monitor  (MetaWindow         *window,
-                                              ConstraintInfo     *info,
-                                              ConstraintPriority  priority,
-                                              gboolean            check_only);
-static gboolean constrain_fully_onscreen     (MetaWindow         *window,
-                                              ConstraintInfo     *info,
-                                              ConstraintPriority  priority,
-                                              gboolean            check_only);
-static gboolean constrain_titlebar_visible   (MetaWindow         *window,
-                                              ConstraintInfo     *info,
-                                              ConstraintPriority  priority,
-                                              gboolean            check_only);
-static gboolean constrain_partially_onscreen (MetaWindow         *window,
-                                              ConstraintInfo     *info,
-                                              ConstraintPriority  priority,
-                                              gboolean            check_only);
-
-static void setup_constraint_info        (ConstraintInfo      *info,
-                                          MetaWindow          *window,
-                                          MetaMoveResizeFlags  flags,
-                                          int                  resize_gravity,
-                                          const MetaRectangle *orig,
-                                          MetaRectangle       *new);
-static void place_window_if_needed       (MetaWindow     *window,
-                                          ConstraintInfo *info);
+static gboolean do_screen_and_monitor_relative_constraints (
+  MetaWindow     *window,
+  GList          *region_spanning_rectangles,
+  ConstraintInfo *info,
+  gboolean        check_only);
+static gboolean constrain_custom_rule (MetaWindow        *window,
+                                       ConstraintInfo    *info,
+                                       ConstraintPriority priority,
+                                       gboolean           check_only);
+static gboolean constrain_modal_dialog (MetaWindow        *window,
+                                        ConstraintInfo    *info,
+                                        ConstraintPriority priority,
+                                        gboolean           check_only);
+static gboolean constrain_maximization (MetaWindow        *window,
+                                        ConstraintInfo    *info,
+                                        ConstraintPriority priority,
+                                        gboolean           check_only);
+static gboolean constrain_tiling (MetaWindow        *window,
+                                  ConstraintInfo    *info,
+                                  ConstraintPriority priority,
+                                  gboolean           check_only);
+static gboolean constrain_fullscreen (MetaWindow        *window,
+                                      ConstraintInfo    *info,
+                                      ConstraintPriority priority,
+                                      gboolean           check_only);
+static gboolean constrain_size_increments (MetaWindow        *window,
+                                           ConstraintInfo    *info,
+                                           ConstraintPriority priority,
+                                           gboolean           check_only);
+static gboolean constrain_size_limits (MetaWindow        *window,
+                                       ConstraintInfo    *info,
+                                       ConstraintPriority priority,
+                                       gboolean           check_only);
+static gboolean constrain_aspect_ratio (MetaWindow        *window,
+                                        ConstraintInfo    *info,
+                                        ConstraintPriority priority,
+                                        gboolean           check_only);
+static gboolean constrain_to_single_monitor (MetaWindow        *window,
+                                             ConstraintInfo    *info,
+                                             ConstraintPriority priority,
+                                             gboolean           check_only);
+static gboolean constrain_fully_onscreen (MetaWindow        *window,
+                                          ConstraintInfo    *info,
+                                          ConstraintPriority priority,
+                                          gboolean           check_only);
+static gboolean constrain_titlebar_visible (MetaWindow        *window,
+                                            ConstraintInfo    *info,
+                                            ConstraintPriority priority,
+                                            gboolean           check_only);
+static gboolean constrain_partially_onscreen (MetaWindow        *window,
+                                              ConstraintInfo    *info,
+                                              ConstraintPriority priority,
+                                              gboolean           check_only);
+
+static void setup_constraint_info (ConstraintInfo      *info,
+                                   MetaWindow          *window,
+                                   MetaMoveResizeFlags  flags,
+                                   int                  resize_gravity,
+                                   const MetaRectangle *orig,
+                                   MetaRectangle       *new);
+static void place_window_if_needed (MetaWindow     *window,
+                                    ConstraintInfo *info);
 static void update_onscreen_requirements (MetaWindow     *window,
                                           ConstraintInfo *info);
 
-typedef gboolean (* ConstraintFunc) (MetaWindow         *window,
-                                     ConstraintInfo     *info,
-                                     ConstraintPriority  priority,
-                                     gboolean            check_only);
+typedef gboolean (*ConstraintFunc) (MetaWindow        *window,
+                                    ConstraintInfo    *info,
+                                    ConstraintPriority priority,
+                                    gboolean           check_only);
 
-typedef struct {
+typedef struct
+{
   ConstraintFunc func;
-  const char* name;
+  const char *name;
 } Constraint;
 
-static const Constraint all_constraints[] = {
-  {constrain_custom_rule,        "constrain_custom_rule"},
-  {constrain_modal_dialog,       "constrain_modal_dialog"},
-  {constrain_maximization,       "constrain_maximization"},
-  {constrain_tiling,             "constrain_tiling"},
-  {constrain_fullscreen,         "constrain_fullscreen"},
-  {constrain_size_increments,    "constrain_size_increments"},
-  {constrain_size_limits,        "constrain_size_limits"},
-  {constrain_aspect_ratio,       "constrain_aspect_ratio"},
-  {constrain_to_single_monitor,  "constrain_to_single_monitor"},
-  {constrain_fully_onscreen,     "constrain_fully_onscreen"},
-  {constrain_titlebar_visible,   "constrain_titlebar_visible"},
+static const Constraint all_constraints[] =
+{
+  {constrain_custom_rule, "constrain_custom_rule"},
+  {constrain_modal_dialog, "constrain_modal_dialog"},
+  {constrain_maximization, "constrain_maximization"},
+  {constrain_tiling, "constrain_tiling"},
+  {constrain_fullscreen, "constrain_fullscreen"},
+  {constrain_size_increments, "constrain_size_increments"},
+  {constrain_size_limits, "constrain_size_limits"},
+  {constrain_aspect_ratio, "constrain_aspect_ratio"},
+  {constrain_to_single_monitor, "constrain_to_single_monitor"},
+  {constrain_fully_onscreen, "constrain_fully_onscreen"},
+  {constrain_titlebar_visible, "constrain_titlebar_visible"},
   {constrain_partially_onscreen, "constrain_partially_onscreen"},
-  {NULL,                         NULL}
+  {NULL, NULL}
 };
 
 static gboolean
-do_all_constraints (MetaWindow         *window,
-                    ConstraintInfo     *info,
-                    ConstraintPriority  priority,
-                    gboolean            check_only)
+do_all_constraints (MetaWindow        *window,
+                    ConstraintInfo    *info,
+                    ConstraintPriority priority,
+                    gboolean           check_only)
 {
   const Constraint *constraint;
-  gboolean          satisfied;
+  gboolean satisfied;
 
   constraint = &all_constraints[0];
   satisfied = TRUE;
   while (constraint->func != NULL)
     {
       satisfied = satisfied &&
-                  (*constraint->func) (window, info, priority, check_only);
+                  (*constraint->func)(window, info, priority, check_only);
 
       if (!check_only)
         {
@@ -291,7 +295,7 @@ meta_window_constrain (MetaWindow          *window,
               "Constraining %s in move from %d,%d %dx%d to %d,%d %dx%d\n",
               window->desc,
               orig->x, orig->y, orig->width, orig->height,
-              new->x,  new->y,  new->width,  new->height);
+              new->x, new->y, new->width, new->height);
 
   setup_constraint_info (&info,
                          window,
@@ -301,20 +305,21 @@ meta_window_constrain (MetaWindow          *window,
                          new);
   place_window_if_needed (window, &info);
 
-  while (!satisfied && priority <= PRIORITY_MAXIMUM) {
-    gboolean check_only = TRUE;
+  while (!satisfied && priority <= PRIORITY_MAXIMUM)
+    {
+      gboolean check_only = TRUE;
 
-    /* Individually enforce all the high-enough priority constraints */
-    do_all_constraints (window, &info, priority, !check_only);
+      /* Individually enforce all the high-enough priority constraints */
+      do_all_constraints (window, &info, priority, !check_only);
 
-    /* Check if all high-enough priority constraints are simultaneously
-     * satisfied
-     */
-    satisfied = do_all_constraints (window, &info, priority, check_only);
+      /* Check if all high-enough priority constraints are simultaneously
+       * satisfied
+       */
+      satisfied = do_all_constraints (window, &info, priority, check_only);
 
-    /* Drop the least important constraints if we can't satisfy them all */
-    priority++;
-  }
+      /* Drop the least important constraints if we can't satisfy them all */
+      priority++;
+    }
 
   /* Make sure we use the constrained position */
   *new = info.current;
@@ -340,7 +345,7 @@ setup_constraint_info (ConstraintInfo      *info,
   MetaLogicalMonitor *logical_monitor;
   MetaWorkspace *cur_workspace;
 
-  info->orig    = *orig;
+  info->orig = *orig;
   info->current = *new;
 
   if (info->current.width < 1)
@@ -348,7 +353,8 @@ setup_constraint_info (ConstraintInfo      *info,
   if (info->current.height < 1)
     info->current.height = 1;
 
-  if (flags & META_MOVE_RESIZE_MOVE_ACTION && flags & META_MOVE_RESIZE_RESIZE_ACTION)
+  if (flags & META_MOVE_RESIZE_MOVE_ACTION &&
+      flags & META_MOVE_RESIZE_RESIZE_ACTION)
     info->action_type = ACTION_MOVE_AND_RESIZE;
   else if (flags & META_MOVE_RESIZE_RESIZE_ACTION)
     info->action_type = ACTION_RESIZE;
@@ -370,14 +376,14 @@ setup_constraint_info (ConstraintInfo      *info,
    */
   info->fixed_directions = FIXED_DIRECTION_NONE;
   /* If x directions don't change but either y direction does */
-  if ( orig->x == new->x && orig->x + orig->width  == new->x + new->width   &&
+  if (orig->x == new->x && orig->x + orig->width == new->x + new->width &&
       (orig->y != new->y || orig->y + orig->height != new->y + new->height))
     {
       info->fixed_directions = FIXED_DIRECTION_X;
     }
   /* If y directions don't change but either x direction does */
-  if ( orig->y == new->y && orig->y + orig->height == new->y + new->height  &&
-      (orig->x != new->x || orig->x + orig->width  != new->x + new->width ))
+  if (orig->y == new->y && orig->y + orig->height == new->y + new->height &&
+      (orig->x != new->x || orig->x + orig->width != new->x + new->width))
     {
       info->fixed_directions = FIXED_DIRECTION_Y;
     }
@@ -416,7 +422,7 @@ setup_constraint_info (ConstraintInfo      *info,
     }
 
   cur_workspace = window->display->workspace_manager->active_workspace;
-  info->usable_screen_region   =
+  info->usable_screen_region =
     meta_workspace_get_onscreen_region (cur_workspace);
   info->usable_monitor_region =
     meta_workspace_get_onmonitor_region (cur_workspace, logical_monitor);
@@ -434,22 +440,22 @@ setup_constraint_info (ConstraintInfo      *info,
               "  entire_monitor   : %d,%d +%d,%d\n",
               info->orig.x, info->orig.y, info->orig.width, info->orig.height,
               info->current.x, info->current.y,
-                info->current.width, info->current.height,
+              info->current.width, info->current.height,
               (info->action_type == ACTION_MOVE) ? "Move" :
-                (info->action_type == ACTION_RESIZE) ? "Resize" :
-                (info->action_type == ACTION_MOVE_AND_RESIZE) ? "Move&Resize" :
-                "Freakin' Invalid Stupid",
+              (info->action_type == ACTION_RESIZE) ? "Resize" :
+              (info->action_type == ACTION_MOVE_AND_RESIZE) ? "Move&Resize" :
+              "Freakin' Invalid Stupid",
               (info->is_user_action) ? "true" : "false",
               meta_gravity_to_string (info->resize_gravity),
               (info->fixed_directions == FIXED_DIRECTION_NONE) ? "None" :
-                (info->fixed_directions == FIXED_DIRECTION_X) ? "X fixed" :
-                (info->fixed_directions == FIXED_DIRECTION_Y) ? "Y fixed" :
-                "Freakin' Invalid Stupid",
+              (info->fixed_directions == FIXED_DIRECTION_X) ? "X fixed" :
+              (info->fixed_directions == FIXED_DIRECTION_Y) ? "Y fixed" :
+              "Freakin' Invalid Stupid",
               info->work_area_monitor.x, info->work_area_monitor.y,
-                info->work_area_monitor.width,
-                info->work_area_monitor.height,
+              info->work_area_monitor.width,
+              info->work_area_monitor.height,
               info->entire_monitor.x, info->entire_monitor.y,
-                info->entire_monitor.width, info->entire_monitor.height);
+              info->entire_monitor.width, info->entire_monitor.height);
 }
 
 static void
@@ -527,13 +533,13 @@ place_window_if_needed(MetaWindow     *window,
             {
               info->current.width = .75 * info->work_area_monitor.width;
               info->current.x = info->work_area_monitor.x +
-                       .125 * info->work_area_monitor.width;
+                                .125 * info->work_area_monitor.width;
             }
           if (info->current.height >= info->work_area_monitor.height)
             {
               info->current.height = .75 * info->work_area_monitor.height;
               info->current.y = info->work_area_monitor.y +
-                       .083 * info->work_area_monitor.height;
+                                .083 * info->work_area_monitor.height;
             }
 
           /* idle_move_resize() uses the unconstrained_rect, so make sure it
@@ -544,10 +550,15 @@ place_window_if_needed(MetaWindow     *window,
           if (window->maximize_horizontally_after_placement ||
               window->maximize_vertically_after_placement)
             meta_window_maximize_internal (window,
-                (window->maximize_horizontally_after_placement ?
-                 META_MAXIMIZE_HORIZONTAL : 0 ) |
-                (window->maximize_vertically_after_placement ?
-                 META_MAXIMIZE_VERTICAL : 0), &info->current);
+                                           (window->
+                                            maximize_horizontally_after_placement
+                                            ?
+                                            META_MAXIMIZE_HORIZONTAL : 0) |
+                                           (window->
+                                            maximize_vertically_after_placement
+                                            ?
+                                            META_MAXIMIZE_VERTICAL : 0),
+                                           &info->current);
 
           window->maximize_horizontally_after_placement = FALSE;
           window->maximize_vertically_after_placement = FALSE;
@@ -657,9 +668,9 @@ get_size_limits (MetaWindow    *window,
    * don't actually use the position of those rects.
    */
   min_size->x = min_size->y = max_size->x = max_size->y = 0;
-  min_size->width  = window->size_hints.min_width;
+  min_size->width = window->size_hints.min_width;
   min_size->height = window->size_hints.min_height;
-  max_size->width  = window->size_hints.max_width;
+  max_size->width = window->size_hints.max_width;
   max_size->height = window->size_hints.max_height;
 
   meta_window_client_rect_to_frame_rect (window, min_size, min_size);
@@ -726,7 +737,7 @@ try_flip_window_position (MetaWindow                       *window,
                           MetaRectangle                    *rect,
                           MetaRectangle                    *intersection)
 {
-  MetaPlacementRule flipped_rule = *placement_rule;;
+  MetaPlacementRule flipped_rule = *placement_rule;
   MetaRectangle flipped_rect;
   MetaRectangle flipped_intersection;
 
@@ -781,10 +792,10 @@ is_custom_rule_satisfied (ConstraintInfo    *info,
 }
 
 static gboolean
-constrain_custom_rule (MetaWindow         *window,
-                       ConstraintInfo     *info,
-                       ConstraintPriority  priority,
-                       gboolean            check_only)
+constrain_custom_rule (MetaWindow        *window,
+                       ConstraintInfo    *info,
+                       ConstraintPriority priority,
+                       gboolean           check_only)
 {
   MetaPlacementRule *placement_rule;
   MetaRectangle intersection;
@@ -904,10 +915,10 @@ done:
 }
 
 static gboolean
-constrain_modal_dialog (MetaWindow         *window,
-                        ConstraintInfo     *info,
-                        ConstraintPriority  priority,
-                        gboolean            check_only)
+constrain_modal_dialog (MetaWindow        *window,
+                        ConstraintInfo    *info,
+                        ConstraintPriority priority,
+                        gboolean           check_only)
 {
   int x, y;
   MetaWindow *parent = meta_window_get_transient_for (window);
@@ -920,21 +931,24 @@ constrain_modal_dialog (MetaWindow         *window,
     return TRUE;
 
   /* We want to center the dialog on the parent, including the decorations
-     for both of them. info->current is in client X window coordinates, so we need
-     to convert them to frame coordinates, apply the centering and then
-     convert back to client.
-  */
+   *  for both of them. info->current is in client X window coordinates, so we
+   * need
+   *  to convert them to frame coordinates, apply the centering and then
+   *  convert back to client.
+   */
 
   child_rect = info->current;
 
   meta_window_get_frame_rect (parent, &parent_rect);
 
-  child_rect.x = parent_rect.x + (parent_rect.width / 2  - child_rect.width / 2);
-  child_rect.y = parent_rect.y + (parent_rect.height / 2 - child_rect.height / 2);
+  child_rect.x = parent_rect.x + (parent_rect.width / 2 - child_rect.width / 2);
+  child_rect.y = parent_rect.y +
+                 (parent_rect.height / 2 - child_rect.height / 2);
   x = child_rect.x;
   y = child_rect.y;
 
-  constraint_already_satisfied = (x == info->current.x) && (y == info->current.y);
+  constraint_already_satisfied = (x == info->current.x) &&
+                                 (y == info->current.y);
 
   if (check_only || constraint_already_satisfied)
     return constraint_already_satisfied;
@@ -950,10 +964,10 @@ constrain_modal_dialog (MetaWindow         *window,
 }
 
 static gboolean
-constrain_maximization (MetaWindow         *window,
-                        ConstraintInfo     *info,
-                        ConstraintPriority  priority,
-                        gboolean            check_only)
+constrain_maximization (MetaWindow        *window,
+                        ConstraintInfo    *info,
+                        ConstraintPriority priority,
+                        gboolean           check_only)
 {
   MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
   MetaRectangle target_size;
@@ -988,8 +1002,8 @@ constrain_maximization (MetaWindow         *window,
        * window is at a vertical position where it could be occluded
        * by that partial strut.
        */
-      MetaDirection  direction;
-      GSList        *active_workspace_struts;
+      MetaDirection direction;
+      GSList *active_workspace_struts;
 
       if (window->maximized_horizontally)
         direction = META_DIRECTION_HORIZONTAL;
@@ -1002,47 +1016,49 @@ constrain_maximization (MetaWindow         *window,
                                                 &info->entire_monitor,
                                                 direction,
                                                 active_workspace_struts);
-   }
+    }
 
   /* Check min size constraints; max size constraints are ignored for maximized
    * windows, as per bug 327543.
    */
   get_size_limits (window, &min_size, &max_size);
-  hminbad = target_size.width < min_size.width && window->maximized_horizontally;
-  vminbad = target_size.height < min_size.height && window->maximized_vertically;
+  hminbad = target_size.width < min_size.width &&
+            window->maximized_horizontally;
+  vminbad = target_size.height < min_size.height &&
+            window->maximized_vertically;
   if (hminbad || vminbad)
     return TRUE;
 
   /* Determine whether constraint is already satisfied; exit if it is */
-  horiz_equal = target_size.x      == info->current.x &&
-                target_size.width  == info->current.width;
-  vert_equal  = target_size.y      == info->current.y &&
-                target_size.height == info->current.height;
+  horiz_equal = target_size.x == info->current.x &&
+                target_size.width == info->current.width;
+  vert_equal = target_size.y == info->current.y &&
+               target_size.height == info->current.height;
   constraint_already_satisfied =
     (horiz_equal || !window->maximized_horizontally) &&
-    (vert_equal  || !window->maximized_vertically);
+    (vert_equal || !window->maximized_vertically);
   if (check_only || constraint_already_satisfied)
     return constraint_already_satisfied;
 
   /*** Enforce constraint ***/
   if (window->maximized_horizontally)
     {
-      info->current.x      = target_size.x;
-      info->current.width  = target_size.width;
+      info->current.x = target_size.x;
+      info->current.width = target_size.width;
     }
   if (window->maximized_vertically)
     {
-      info->current.y      = target_size.y;
+      info->current.y = target_size.y;
       info->current.height = target_size.height;
     }
   return TRUE;
 }
 
 static gboolean
-constrain_tiling (MetaWindow         *window,
-                  ConstraintInfo     *info,
-                  ConstraintPriority  priority,
-                  gboolean            check_only)
+constrain_tiling (MetaWindow        *window,
+                  ConstraintInfo    *info,
+                  ConstraintPriority priority,
+                  gboolean           check_only)
 {
   MetaRectangle target_size;
   MetaRectangle min_size, max_size;
@@ -1072,18 +1088,18 @@ constrain_tiling (MetaWindow         *window,
     return TRUE;
 
   /* Determine whether constraint is already satisfied; exit if it is */
-  horiz_equal = target_size.x      == info->current.x &&
-                target_size.width  == info->current.width;
-  vert_equal  = target_size.y      == info->current.y &&
-                target_size.height == info->current.height;
+  horiz_equal = target_size.x == info->current.x &&
+                target_size.width == info->current.width;
+  vert_equal = target_size.y == info->current.y &&
+               target_size.height == info->current.height;
   constraint_already_satisfied = horiz_equal && vert_equal;
   if (check_only || constraint_already_satisfied)
     return constraint_already_satisfied;
 
   /*** Enforce constraint ***/
-  info->current.x      = target_size.x;
-  info->current.width  = target_size.width;
-  info->current.y      = target_size.y;
+  info->current.x = target_size.x;
+  info->current.width = target_size.width;
+  info->current.y = target_size.y;
   info->current.height = target_size.height;
 
   return TRUE;
@@ -1091,10 +1107,10 @@ constrain_tiling (MetaWindow         *window,
 
 
 static gboolean
-constrain_fullscreen (MetaWindow         *window,
-                      ConstraintInfo     *info,
-                      ConstraintPriority  priority,
-                      gboolean            check_only)
+constrain_fullscreen (MetaWindow        *window,
+                      ConstraintInfo    *info,
+                      ConstraintPriority priority,
+                      gboolean           check_only)
 {
   MetaRectangle min_size, max_size, monitor;
   gboolean too_big, too_small, constraint_already_satisfied;
@@ -1109,7 +1125,7 @@ constrain_fullscreen (MetaWindow         *window,
   monitor = info->entire_monitor;
 
   get_size_limits (window, &min_size, &max_size);
-  too_big =   !meta_rectangle_could_fit_rect (&monitor, &min_size);
+  too_big = !meta_rectangle_could_fit_rect (&monitor, &min_size);
   too_small = !meta_rectangle_could_fit_rect (&max_size, &monitor);
   if (too_big || too_small)
     return TRUE;
@@ -1126,10 +1142,10 @@ constrain_fullscreen (MetaWindow         *window,
 }
 
 static gboolean
-constrain_size_increments (MetaWindow         *window,
-                           ConstraintInfo     *info,
-                           ConstraintPriority  priority,
-                           gboolean            check_only)
+constrain_size_increments (MetaWindow        *window,
+                           ConstraintInfo    *info,
+                           ConstraintPriority priority,
+                           gboolean           check_only)
 {
   int bh, hi, bw, wi, extra_height, extra_width;
   int new_width, new_height;
@@ -1154,7 +1170,7 @@ constrain_size_increments (MetaWindow         *window,
   bw = window->size_hints.base_width;
   wi = window->size_hints.width_inc;
   extra_height = (client_rect.height - bh) % hi;
-  extra_width  = (client_rect.width  - bw) % wi;
+  extra_width = (client_rect.width - bw) % wi;
   /* ignore size increments for maximized windows */
   if (window->maximized_horizontally)
     extra_width *= 0;
@@ -1168,17 +1184,17 @@ constrain_size_increments (MetaWindow         *window,
     return constraint_already_satisfied;
 
   /*** Enforce constraint ***/
-  new_width  = client_rect.width  - extra_width;
+  new_width = client_rect.width - extra_width;
   new_height = client_rect.height - extra_height;
 
   /* Adjusting down instead of up (as done in the above two lines) may
    * violate minimum size constraints; fix the adjustment if this
    * happens.
    */
-  if (new_width  < window->size_hints.min_width)
-    new_width  += ((window->size_hints.min_width  - new_width)/wi  + 1)*wi;
+  if (new_width < window->size_hints.min_width)
+    new_width += ((window->size_hints.min_width - new_width) / wi + 1) * wi;
   if (new_height < window->size_hints.min_height)
-    new_height += ((window->size_hints.min_height - new_height)/hi + 1)*hi;
+    new_height += ((window->size_hints.min_height - new_height) / hi + 1) * hi;
 
   {
     client_rect.width = new_width;
@@ -1206,10 +1222,10 @@ constrain_size_increments (MetaWindow         *window,
 }
 
 static gboolean
-constrain_size_limits (MetaWindow         *window,
-                       ConstraintInfo     *info,
-                       ConstraintPriority  priority,
-                       gboolean            check_only)
+constrain_size_limits (MetaWindow        *window,
+                       ConstraintInfo    *info,
+                       ConstraintPriority priority,
+                       gboolean           check_only)
 {
   MetaRectangle min_size, max_size;
   gboolean too_big, too_small, constraint_already_satisfied;
@@ -1235,13 +1251,13 @@ constrain_size_limits (MetaWindow         *window,
   if (window->maximized_vertically)
     max_size.height = MAX (max_size.height, info->current.height);
   too_small = !meta_rectangle_could_fit_rect (&info->current, &min_size);
-  too_big   = !meta_rectangle_could_fit_rect (&max_size, &info->current);
+  too_big = !meta_rectangle_could_fit_rect (&max_size, &info->current);
   constraint_already_satisfied = !too_big && !too_small;
   if (check_only || constraint_already_satisfied)
     return constraint_already_satisfied;
 
   /*** Enforce constraint ***/
-  new_width  = CLAMP (info->current.width,  min_size.width,  max_size.width);
+  new_width = CLAMP (info->current.width, min_size.width, max_size.width);
   new_height = CLAMP (info->current.height, min_size.height, max_size.height);
 
   /* Figure out what original rect to pass to meta_rectangle_resize_with_gravity
@@ -1261,10 +1277,10 @@ constrain_size_limits (MetaWindow         *window,
 }
 
 static gboolean
-constrain_aspect_ratio (MetaWindow         *window,
-                        ConstraintInfo     *info,
-                        ConstraintPriority  priority,
-                        gboolean            check_only)
+constrain_aspect_ratio (MetaWindow        *window,
+                        ConstraintInfo    *info,
+                        ConstraintPriority priority,
+                        gboolean           check_only)
 {
   double minr, maxr;
   gboolean constraints_are_inconsistent, constraint_already_satisfied;
@@ -1278,10 +1294,10 @@ constrain_aspect_ratio (MetaWindow         *window,
     return TRUE;
 
   /* Determine whether constraint applies; exit if it doesn't. */
-  minr =         window->size_hints.min_aspect.x /
-         (double)window->size_hints.min_aspect.y;
-  maxr =         window->size_hints.max_aspect.x /
-         (double)window->size_hints.max_aspect.y;
+  minr = window->size_hints.min_aspect.x /
+         (double) window->size_hints.min_aspect.y;
+  maxr = window->size_hints.max_aspect.x /
+         (double) window->size_hints.max_aspect.y;
   constraints_are_inconsistent = minr > maxr;
   if (constraints_are_inconsistent ||
       META_WINDOW_MAXIMIZED (window) || window->fullscreen ||
@@ -1328,8 +1344,8 @@ constrain_aspect_ratio (MetaWindow         *window,
   meta_window_frame_rect_to_client_rect (window, &info->current, &client_rect);
 
   constraint_already_satisfied =
-    client_rect.width - (client_rect.height * minr ) > -minr*fudge &&
-    client_rect.width - (client_rect.height * maxr ) <  maxr*fudge;
+    client_rect.width - (client_rect.height * minr) > -minr * fudge &&
+    client_rect.width - (client_rect.height * maxr) < maxr * fudge;
   if (check_only || constraint_already_satisfied)
     return constraint_already_satisfied;
 
@@ -1342,13 +1358,13 @@ constrain_aspect_ratio (MetaWindow         *window,
     case WestGravity:
     case EastGravity:
       /* Yeah, I suck for doing implicit rounding -- sue me */
-      new_height = CLAMP (new_height, new_width / maxr,  new_width / minr);
+      new_height = CLAMP (new_height, new_width / maxr, new_width / minr);
       break;
 
     case NorthGravity:
     case SouthGravity:
       /* Yeah, I suck for doing implicit rounding -- sue me */
-      new_width  = CLAMP (new_width,  new_height * minr, new_height * maxr);
+      new_width = CLAMP (new_width, new_height * minr, new_height * maxr);
       break;
 
     case NorthWestGravity:
@@ -1360,8 +1376,8 @@ constrain_aspect_ratio (MetaWindow         *window,
     default:
       /* Find what width would correspond to new_height, and what height would
        * correspond to new_width */
-      alt_width  = CLAMP (new_width,  new_height * minr, new_height * maxr);
-      alt_height = CLAMP (new_height, new_width / maxr,  new_width / minr);
+      alt_width = CLAMP (new_width, new_height * minr, new_height * maxr);
+      alt_height = CLAMP (new_height, new_width / maxr, new_width / minr);
 
       /* The line connecting the points (alt_width, new_height) and
        * (new_width, alt_height) provide a range of
@@ -1373,10 +1389,11 @@ constrain_aspect_ratio (MetaWindow         *window,
       meta_rectangle_find_linepoint_closest_to_point (alt_width, new_height,
                                                       new_width, alt_height,
                                                       new_width, new_height,
-                                                      &best_width, &best_height);
+                                                      &best_width,
+                                                      &best_height);
 
       /* Yeah, I suck for doing implicit rounding -- sue me */
-      new_width  = best_width;
+      new_width = best_width;
       new_height = best_height;
 
       break;
@@ -1408,11 +1425,10 @@ constrain_aspect_ratio (MetaWindow         *window,
 }
 
 static gboolean
-do_screen_and_monitor_relative_constraints (
-  MetaWindow     *window,
-  GList          *region_spanning_rectangles,
-  ConstraintInfo *info,
-  gboolean        check_only)
+do_screen_and_monitor_relative_constraints (MetaWindow     *window,
+                                            GList          *region_spanning_rectangles,
+                                            ConstraintInfo *info,
+                                            gboolean        check_only)
 {
   gboolean exit_early = FALSE, constraint_satisfied;
   MetaRectangle how_far_it_can_be_smushed, min_size, max_size;
@@ -1424,9 +1440,10 @@ do_screen_and_monitor_relative_constraints (
       char spanning_region[1 + 28 * g_list_length (region_spanning_rectangles)];
 
       meta_topic (META_DEBUG_GEOMETRY,
-             "screen/monitor constraint; region_spanning_rectangles: %s\n",
-             meta_rectangle_region_to_string (region_spanning_rectangles, ", ",
-                                              spanning_region));
+                  "screen/monitor constraint; region_spanning_rectangles: %s\n",
+                  meta_rectangle_region_to_string (region_spanning_rectangles,
+                                                   ", ",
+                                                   spanning_region));
     }
 #endif
 
@@ -1477,10 +1494,10 @@ do_screen_and_monitor_relative_constraints (
 }
 
 static gboolean
-constrain_to_single_monitor (MetaWindow         *window,
-                             ConstraintInfo     *info,
-                             ConstraintPriority  priority,
-                             gboolean            check_only)
+constrain_to_single_monitor (MetaWindow        *window,
+                             ConstraintInfo    *info,
+                             ConstraintPriority priority,
+                             gboolean           check_only)
 {
   MetaBackend *backend = meta_get_backend ();
   MetaMonitorManager *monitor_manager =
@@ -1511,10 +1528,10 @@ constrain_to_single_monitor (MetaWindow         *window,
 }
 
 static gboolean
-constrain_fully_onscreen (MetaWindow         *window,
-                          ConstraintInfo     *info,
-                          ConstraintPriority  priority,
-                          gboolean            check_only)
+constrain_fully_onscreen (MetaWindow        *window,
+                          ConstraintInfo    *info,
+                          ConstraintPriority priority,
+                          gboolean           check_only)
 {
   if (priority > PRIORITY_ENTIRELY_VISIBLE_ON_WORKAREA)
     return TRUE;
@@ -1524,10 +1541,10 @@ constrain_fully_onscreen (MetaWindow         *window,
    * "onscreen" by their own strut).
    */
   if (window->type == META_WINDOW_DESKTOP ||
-      window->type == META_WINDOW_DOCK    ||
-      window->fullscreen                  ||
-      !window->require_fully_onscreen     ||
-      info->is_user_action                ||
+      window->type == META_WINDOW_DOCK ||
+      window->fullscreen ||
+      !window->require_fully_onscreen ||
+      info->is_user_action ||
       meta_window_get_placement_rule (window))
     return TRUE;
 
@@ -1539,16 +1556,16 @@ constrain_fully_onscreen (MetaWindow         *window,
 }
 
 static gboolean
-constrain_titlebar_visible (MetaWindow         *window,
-                            ConstraintInfo     *info,
-                            ConstraintPriority  priority,
-                            gboolean            check_only)
+constrain_titlebar_visible (MetaWindow        *window,
+                            ConstraintInfo    *info,
+                            ConstraintPriority priority,
+                            gboolean           check_only)
 {
   gboolean unconstrained_user_action;
   gboolean retval;
   int bottom_amount;
   int horiz_amount_offscreen, vert_amount_offscreen;
-  int horiz_amount_onscreen,  vert_amount_onscreen;
+  int horiz_amount_onscreen, vert_amount_onscreen;
 
   if (priority > PRIORITY_TITLEBAR_VISIBLE)
     return TRUE;
@@ -1564,10 +1581,10 @@ constrain_titlebar_visible (MetaWindow         *window,
    * "onscreen" by their own strut).
    */
   if (window->type == META_WINDOW_DESKTOP ||
-      window->type == META_WINDOW_DOCK    ||
-      window->fullscreen                  ||
-      !window->require_titlebar_visible   ||
-      unconstrained_user_action           ||
+      window->type == META_WINDOW_DOCK ||
+      window->fullscreen ||
+      !window->require_titlebar_visible ||
+      unconstrained_user_action ||
       meta_window_get_placement_rule (window))
     return TRUE;
 
@@ -1578,14 +1595,14 @@ constrain_titlebar_visible (MetaWindow         *window,
    * Then, the amount that is allowed off is just the window size minus
    * this amount (but no less than 0 for tiny windows).
    */
-  horiz_amount_onscreen = info->current.width  / 4;
-  vert_amount_onscreen  = info->current.height / 4;
+  horiz_amount_onscreen = info->current.width / 4;
+  vert_amount_onscreen = info->current.height / 4;
   horiz_amount_onscreen = CLAMP (horiz_amount_onscreen, 10, 75);
-  vert_amount_onscreen  = CLAMP (vert_amount_onscreen,  10, 75);
+  vert_amount_onscreen = CLAMP (vert_amount_onscreen, 10, 75);
   horiz_amount_offscreen = info->current.width - horiz_amount_onscreen;
-  vert_amount_offscreen  = info->current.height - vert_amount_onscreen;
+  vert_amount_offscreen = info->current.height - vert_amount_onscreen;
   horiz_amount_offscreen = MAX (horiz_amount_offscreen, 0);
-  vert_amount_offscreen  = MAX (vert_amount_offscreen,  0);
+  vert_amount_offscreen = MAX (vert_amount_offscreen, 0);
   /* Allow the titlebar to touch the bottom panel;  If there is no titlebar,
    * require vert_amount to remain on the screen.
    */
@@ -1627,15 +1644,15 @@ constrain_titlebar_visible (MetaWindow         *window,
 }
 
 static gboolean
-constrain_partially_onscreen (MetaWindow         *window,
-                              ConstraintInfo     *info,
-                              ConstraintPriority  priority,
-                              gboolean            check_only)
+constrain_partially_onscreen (MetaWindow        *window,
+                              ConstraintInfo    *info,
+                              ConstraintPriority priority,
+                              gboolean           check_only)
 {
   gboolean retval;
   int top_amount, bottom_amount;
   int horiz_amount_offscreen, vert_amount_offscreen;
-  int horiz_amount_onscreen,  vert_amount_onscreen;
+  int horiz_amount_onscreen, vert_amount_onscreen;
 
   if (priority > PRIORITY_PARTIALLY_VISIBLE_ON_WORKAREA)
     return TRUE;
@@ -1645,7 +1662,7 @@ constrain_partially_onscreen (MetaWindow         *window,
    * "onscreen" by their own strut).
    */
   if (window->type == META_WINDOW_DESKTOP ||
-      window->type == META_WINDOW_DOCK    ||
+      window->type == META_WINDOW_DOCK ||
       meta_window_get_placement_rule (window))
     return TRUE;
 
@@ -1656,14 +1673,14 @@ constrain_partially_onscreen (MetaWindow         *window,
    * Then, the amount that is allowed off is just the window size minus
    * this amount (but no less than 0 for tiny windows).
    */
-  horiz_amount_onscreen = info->current.width  / 4;
-  vert_amount_onscreen  = info->current.height / 4;
+  horiz_amount_onscreen = info->current.width / 4;
+  vert_amount_onscreen = info->current.height / 4;
   horiz_amount_onscreen = CLAMP (horiz_amount_onscreen, 10, 75);
-  vert_amount_onscreen  = CLAMP (vert_amount_onscreen,  10, 75);
+  vert_amount_onscreen = CLAMP (vert_amount_onscreen, 10, 75);
   horiz_amount_offscreen = info->current.width - horiz_amount_onscreen;
-  vert_amount_offscreen  = info->current.height - vert_amount_onscreen;
+  vert_amount_offscreen = info->current.height - vert_amount_onscreen;
   horiz_amount_offscreen = MAX (horiz_amount_offscreen, 0);
-  vert_amount_offscreen  = MAX (vert_amount_offscreen,  0);
+  vert_amount_offscreen = MAX (vert_amount_offscreen, 0);
   top_amount = vert_amount_offscreen;
   /* Allow the titlebar to touch the bottom panel;  If there is no titlebar,
    * require vert_amount to remain on the screen.
diff --git a/src/core/core.c b/src/core/core.c
index f02c35083..99f4ac7a9 100644
--- a/src/core/core.c
+++ b/src/core/core.c
@@ -53,7 +53,8 @@ get_window (Display *xdisplay,
   MetaWindow *window;
 
   display = meta_display_for_x_display (xdisplay);
-  window = meta_x11_display_lookup_x_window (display->x11_display, frame_xwindow);
+  window =
+    meta_x11_display_lookup_x_window (display->x11_display, frame_xwindow);
 
   if (window == NULL || window->frame == NULL)
     {
@@ -76,7 +77,7 @@ meta_core_queue_frame_resize (Display *xdisplay,
 
 static gboolean
 lower_window_and_transients (MetaWindow *window,
-                             gpointer   data)
+                             gpointer    data)
 {
   MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
 
@@ -94,7 +95,7 @@ lower_window_and_transients (MetaWindow *window,
           meta_window_located_on_workspace (window,
                                             workspace_manager->active_workspace))
         {
-          GList* link;
+          GList *link;
           link = g_list_find (workspace_manager->active_workspace->mru_list,
                               window);
           g_assert (link);
@@ -123,10 +124,10 @@ meta_core_user_lower_and_unfocus (Display *xdisplay,
 
   lower_window_and_transients (window, NULL);
 
- /* Rather than try to figure that out whether we just lowered
-  * the focus window, assume that's always the case. (Typically,
-  * this will be invoked via keyboard action or by a mouse action;
-  * in either case the window or a modal child will have been focused.) */
+  /* Rather than try to figure that out whether we just lowered
+   * the focus window, assume that's always the case. (Typically,
+   * this will be invoked via keyboard action or by a mouse action;
+   * in either case the window or a modal child will have been focused.) */
   meta_workspace_focus_default_window (workspace_manager->active_workspace,
                                        NULL,
                                        timestamp);
@@ -134,7 +135,7 @@ meta_core_user_lower_and_unfocus (Display *xdisplay,
 
 void
 meta_core_toggle_maximize_vertically (Display *xdisplay,
-                                     Window   frame_xwindow)
+                                      Window   frame_xwindow)
 {
   MetaWindow *window = get_window (xdisplay, frame_xwindow);
 
@@ -149,7 +150,7 @@ meta_core_toggle_maximize_vertically (Display *xdisplay,
 
 void
 meta_core_toggle_maximize_horizontally (Display *xdisplay,
-                                       Window   frame_xwindow)
+                                        Window   frame_xwindow)
 {
   MetaWindow *window = get_window (xdisplay, frame_xwindow);
 
@@ -178,12 +179,12 @@ meta_core_toggle_maximize (Display *xdisplay,
 }
 
 void
-meta_core_show_window_menu (Display            *xdisplay,
-                            Window              frame_xwindow,
-                            MetaWindowMenuType  menu,
-                            int                 root_x,
-                            int                 root_y,
-                            guint32             timestamp)
+meta_core_show_window_menu (Display           *xdisplay,
+                            Window             frame_xwindow,
+                            MetaWindowMenuType menu,
+                            int                root_x,
+                            int                root_y,
+                            guint32            timestamp)
 {
   MetaWindow *window = get_window (xdisplay, frame_xwindow);
 
@@ -195,11 +196,11 @@ meta_core_show_window_menu (Display            *xdisplay,
 }
 
 void
-meta_core_show_window_menu_for_rect (Display            *xdisplay,
-                                     Window              frame_xwindow,
-                                     MetaWindowMenuType  menu,
-                                     MetaRectangle      *rect,
-                                     guint32             timestamp)
+meta_core_show_window_menu_for_rect (Display           *xdisplay,
+                                     Window             frame_xwindow,
+                                     MetaWindowMenuType menu,
+                                     MetaRectangle     *rect,
+                                     guint32            timestamp)
 {
   MetaWindow *window = get_window (xdisplay, frame_xwindow);
 
@@ -211,16 +212,16 @@ meta_core_show_window_menu_for_rect (Display            *xdisplay,
 }
 
 gboolean
-meta_core_begin_grab_op (Display    *xdisplay,
-                         Window      frame_xwindow,
-                         MetaGrabOp  op,
-                         gboolean    pointer_already_grabbed,
-                         gboolean    frame_action,
-                         int         button,
-                         gulong      modmask,
-                         guint32     timestamp,
-                         int         root_x,
-                         int         root_y)
+meta_core_begin_grab_op (Display   *xdisplay,
+                         Window     frame_xwindow,
+                         MetaGrabOp op,
+                         gboolean   pointer_already_grabbed,
+                         gboolean   frame_action,
+                         int        button,
+                         gulong     modmask,
+                         guint32    timestamp,
+                         int        root_x,
+                         int        root_y)
 {
   MetaWindow *window = get_window (xdisplay, frame_xwindow);
   MetaDisplay *display;
@@ -268,8 +269,8 @@ meta_core_grab_buttons  (Display *xdisplay,
 }
 
 void
-meta_core_set_screen_cursor (Display *xdisplay,
-                             Window   frame_on_screen,
+meta_core_set_screen_cursor (Display   *xdisplay,
+                             Window     frame_on_screen,
                              MetaCursor cursor)
 {
   MetaWindow *window = get_window (xdisplay, frame_on_screen);
diff --git a/src/core/delete.c b/src/core/delete.c
index 28ca63d89..3ac77455e 100644
--- a/src/core/delete.c
+++ b/src/core/delete.c
@@ -33,9 +33,9 @@
 #include "meta/workspace.h"
 
 static void
-close_dialog_response_cb (MetaCloseDialog         *dialog,
-                          MetaCloseDialogResponse  response,
-                          MetaWindow              *window)
+close_dialog_response_cb (MetaCloseDialog        *dialog,
+                          MetaCloseDialogResponse response,
+                          MetaWindow             *window)
 {
   if (response == META_CLOSE_DIALOG_RESPONSE_FORCE_CLOSE)
     meta_window_kill (window);
@@ -50,8 +50,9 @@ meta_window_ensure_close_dialog (MetaWindow *window)
     return;
 
   display = window->display;
-  window->close_dialog = meta_compositor_create_close_dialog (display->compositor,
-                                                              window);
+  window->close_dialog = meta_compositor_create_close_dialog (
+    display->compositor,
+    window);
   g_signal_connect (window->close_dialog, "response",
                     G_CALLBACK (close_dialog_response_cb), window);
 }
@@ -84,8 +85,8 @@ meta_window_check_alive (MetaWindow *window,
 }
 
 void
-meta_window_delete (MetaWindow  *window,
-                    guint32      timestamp)
+meta_window_delete (MetaWindow *window,
+                    guint32     timestamp)
 {
   META_WINDOW_GET_CLASS (window)->delete (window, timestamp);
 
diff --git a/src/core/display.c b/src/core/display.c
index 9a041dcb7..3feb8141c 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -109,11 +109,11 @@
 typedef struct
 {
   MetaWindow *window;
-  guint32     serial;
-  guint       ping_timeout_id;
+  guint32 serial;
+  guint ping_timeout_id;
 } MetaPingData;
 
-G_DEFINE_TYPE(MetaDisplay, meta_display, G_TYPE_OBJECT);
+G_DEFINE_TYPE (MetaDisplay, meta_display, G_TYPE_OBJECT);
 
 /* Signals */
 enum
@@ -151,7 +151,8 @@ enum
   LAST_SIGNAL
 };
 
-enum {
+enum
+{
   PROP_0,
 
   PROP_FOCUS_WINDOW
@@ -170,17 +171,17 @@ static MetaDisplay *the_display = NULL;
 static void on_monitors_changed_internal (MetaMonitorManager *monitor_manager,
                                           MetaDisplay        *display);
 
-static void    prefs_changed_callback    (MetaPreference pref,
-                                          void          *data);
+static void    prefs_changed_callback (MetaPreference pref,
+                                       void          *data);
 
 static int mru_cmp (gconstpointer a,
                     gconstpointer b);
 
 static void
-meta_display_get_property(GObject         *object,
-                          guint            prop_id,
-                          GValue          *value,
-                          GParamSpec      *pspec)
+meta_display_get_property(GObject    *object,
+                          guint       prop_id,
+                          GValue     *value,
+                          GParamSpec *pspec)
 {
   MetaDisplay *display = META_DISPLAY (object);
 
@@ -196,10 +197,10 @@ meta_display_get_property(GObject         *object,
 }
 
 static void
-meta_display_set_property(GObject         *object,
-                          guint            prop_id,
-                          const GValue    *value,
-                          GParamSpec      *pspec)
+meta_display_set_property(GObject      *object,
+                          guint         prop_id,
+                          const GValue *value,
+                          GParamSpec   *pspec)
 {
   switch (prop_id)
     {
@@ -491,7 +492,6 @@ meta_display_class_init (MetaDisplayClass *klass)
                                                         "Currently focused window",
                                                         META_TYPE_WINDOW,
                                                         G_PARAM_READABLE));
-
 }
 
 
@@ -535,7 +535,8 @@ meta_display_remove_pending_pings_for_window (MetaDisplay *display,
     {
       MetaPingData *ping_data = tmp->data;
 
-      display->pending_pings = g_slist_remove (display->pending_pings, ping_data);
+      display->pending_pings =
+        g_slist_remove (display->pending_pings, ping_data);
       ping_data_free (ping_data);
     }
 
@@ -560,7 +561,7 @@ enable_compositor (MetaDisplay *display)
         }
 
       int version = (x11_display->composite_major_version * 10) +
-                     x11_display->composite_minor_version;
+                    x11_display->composite_minor_version;
       if (version < 3)
         {
           meta_warning ("Your version of COMPOSITE is too old.");
@@ -569,7 +570,7 @@ enable_compositor (MetaDisplay *display)
     }
 
   if (!display->compositor)
-      display->compositor = meta_compositor_new (display);
+    display->compositor = meta_compositor_new (display);
 
   meta_compositor_manage (display->compositor);
 }
@@ -620,8 +621,10 @@ gesture_tracker_state_changed (MetaGestureTracker   *tracker,
 
       XIAllowTouchEvents (meta_backend_x11_get_xdisplay (backend),
                           META_VIRTUAL_CORE_POINTER_ID,
-                          clutter_x11_event_sequence_get_touch_detail (sequence),
-                          DefaultRootWindow (display->x11_display->xdisplay), event_mode);
+                          clutter_x11_event_sequence_get_touch_detail (
+                            sequence),
+                          DefaultRootWindow (
+                            display->x11_display->xdisplay), event_mode);
     }
 }
 
@@ -686,7 +689,7 @@ meta_display_open (void)
 
   display->mouse_mode = TRUE; /* Only relevant for mouse or sloppy focus */
   display->allow_terminal_deactivation = TRUE; /* Only relevant for when a
-                                                  terminal has the focus */
+                                                *  terminal has the focus */
 
   i = 0;
   while (i < N_IGNORED_CROSSING_SERIALS)
@@ -783,15 +786,18 @@ meta_display_open (void)
   if (old_active_xwindow != None)
     {
       MetaWindow *old_active_window;
-      old_active_window = meta_x11_display_lookup_x_window (display->x11_display,
-                                                            old_active_xwindow);
+      old_active_window = meta_x11_display_lookup_x_window (
+        display->x11_display,
+        old_active_xwindow);
       if (old_active_window)
         meta_window_focus (old_active_window, timestamp);
       else
-        meta_x11_display_focus_the_no_focus_window (display->x11_display, timestamp);
+        meta_x11_display_focus_the_no_focus_window (display->x11_display,
+                                                    timestamp);
     }
   else if (display->x11_display)
-    meta_x11_display_focus_the_no_focus_window (display->x11_display, timestamp);
+    meta_x11_display_focus_the_no_focus_window (display->x11_display,
+                                                timestamp);
 
   meta_idle_monitor_init_dbus ();
 
@@ -823,9 +829,9 @@ ptrcmp (gconstpointer a, gconstpointer b)
  *
  * Return value: (transfer container): the list of windows.
  */
-GSList*
-meta_display_list_windows (MetaDisplay          *display,
-                           MetaListWindowsFlags  flags)
+GSList *
+meta_display_list_windows (MetaDisplay         *display,
+                           MetaListWindowsFlags flags)
 {
   GSList *winlist;
   GSList *prev;
@@ -992,14 +998,15 @@ meta_display_close (MetaDisplay *display,
  * Returns: The singleton X display, or %NULL if @xdisplay isn't the one
  *          we're managing.
  */
-MetaDisplay*
+MetaDisplay *
 meta_display_for_x_display (Display *xdisplay)
 {
   if (the_display->x11_display->xdisplay == xdisplay)
     return the_display;
 
-  meta_warning ("Could not find display for X display %p, probably going to crash\n",
-                xdisplay);
+  meta_warning (
+    "Could not find display for X display %p, probably going to crash\n",
+    xdisplay);
 
   return NULL;
 }
@@ -1012,7 +1019,7 @@ meta_display_for_x_display (Display *xdisplay)
  * Returns: The only #MetaDisplay there is.  This can be %NULL, but only
  *          during startup.
  */
-MetaDisplay*
+MetaDisplay *
 meta_get_display (void)
 {
   return the_display;
@@ -1048,7 +1055,8 @@ meta_grab_op_is_resizing (MetaGrabOp op)
   if (!grab_op_is_window (op))
     return FALSE;
 
-  return (op & META_GRAB_OP_WINDOW_DIR_MASK) != 0 || op == META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN;
+  return (op & META_GRAB_OP_WINDOW_DIR_MASK) != 0 ||
+         op == META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN;
 }
 
 gboolean
@@ -1097,11 +1105,11 @@ meta_display_windows_are_interactable (MetaDisplay *display)
  * the result.
  */
 gboolean
-meta_display_xserver_time_is_before (MetaDisplay   *display,
-                                     guint32        time1,
-                                     guint32        time2)
+meta_display_xserver_time_is_before (MetaDisplay *display,
+                                     guint32      time1,
+                                     guint32      time2)
 {
-  return XSERVER_TIME_IS_BEFORE(time1, time2);
+  return XSERVER_TIME_IS_BEFORE (time1, time2);
 }
 
 /**
@@ -1151,14 +1159,16 @@ meta_display_add_ignored_crossing_serial (MetaDisplay  *display,
   int i;
 
   /* don't add the same serial more than once */
-  if (display->ignored_crossing_serials[N_IGNORED_CROSSING_SERIALS-1] == serial)
+  if (display->ignored_crossing_serials[N_IGNORED_CROSSING_SERIALS - 1] ==
+      serial)
     return;
 
   /* shift serials to the left */
   i = 0;
   while (i < (N_IGNORED_CROSSING_SERIALS - 1))
     {
-      display->ignored_crossing_serials[i] = display->ignored_crossing_serials[i+1];
+      display->ignored_crossing_serials[i] =
+        display->ignored_crossing_serials[i + 1];
       ++i;
     }
   /* put new one on the end */
@@ -1179,11 +1189,11 @@ window_raise_with_delay_callback (void *data)
   if (meta_stack_get_top (window->display->stack) != window)
     {
       if (meta_window_has_pointer (window))
-       meta_window_raise (window);
+        meta_window_raise (window);
       else
-       meta_topic (META_DEBUG_FOCUS,
-                   "Pointer not inside window, not raising %s\n",
-                   window->desc);
+        meta_topic (META_DEBUG_FOCUS,
+                    "Pointer not inside window, not raising %s\n",
+                    window->desc);
     }
 
   return G_SOURCE_REMOVE;
@@ -1206,7 +1216,8 @@ meta_display_queue_autoraise_callback (MetaDisplay *display,
                         meta_prefs_get_auto_raise_delay (),
                         window_raise_with_delay_callback,
                         window, NULL);
-  g_source_set_name_by_id (display->autoraise_timeout_id, "[mutter] window_raise_with_delay_callback");
+  g_source_set_name_by_id (display->autoraise_timeout_id,
+                           "[mutter] window_raise_with_delay_callback");
   display->autoraise_window = window;
 }
 
@@ -1231,7 +1242,8 @@ meta_display_sync_wayland_input_focus (MetaDisplay *display)
   else if (display->focus_window && display->focus_window->surface)
     focus_window = display->focus_window;
   else
-    meta_topic (META_DEBUG_FOCUS, "Focus change has no effect, because there is no matching wayland 
surface");
+    meta_topic (META_DEBUG_FOCUS,
+                "Focus change has no effect, because there is no matching wayland surface");
 
   meta_stage_set_active (stage, focus_window == NULL);
   meta_wayland_compositor_set_input_focus (compositor, focus_window);
@@ -1335,9 +1347,9 @@ meta_display_unregister_wayland_window (MetaDisplay *display,
   g_hash_table_remove (display->wayland_windows, window);
 }
 
-MetaWindow*
+MetaWindow *
 meta_display_lookup_stamp (MetaDisplay *display,
-                           guint64       stamp)
+                           guint64      stamp)
 {
   return g_hash_table_lookup (display->stamps, &stamp);
 }
@@ -1361,13 +1373,13 @@ meta_display_unregister_stamp (MetaDisplay *display,
   g_hash_table_remove (display->stamps, &stamp);
 }
 
-MetaWindow*
+MetaWindow *
 meta_display_lookup_stack_id (MetaDisplay *display,
                               guint64      stack_id)
 {
   if (META_STACK_ID_IS_X11 (stack_id))
     return meta_x11_display_lookup_x_window (display->x11_display,
-                                             (Window)stack_id);
+                                             (Window) stack_id);
   else
     return meta_display_lookup_stamp (display, stack_id);
 }
@@ -1391,16 +1403,17 @@ meta_display_describe_stack_id (MetaDisplay *display,
   window = meta_display_lookup_stack_id (display, stack_id);
 
   if (window && window->title)
-    snprintf (result, sizeof(buffer[0]), "%#" G_GINT64_MODIFIER "x (%.10s)", stack_id, window->title);
+    snprintf (result, sizeof (buffer[0]), "%#" G_GINT64_MODIFIER "x (%.10s)",
+              stack_id, window->title);
   else
-    snprintf (result, sizeof(buffer[0]), "%#" G_GINT64_MODIFIER "x", stack_id);
+    snprintf (result, sizeof (buffer[0]), "%#" G_GINT64_MODIFIER "x", stack_id);
 
   return result;
 }
 
 void
-meta_display_notify_window_created (MetaDisplay  *display,
-                                    MetaWindow   *window)
+meta_display_notify_window_created (MetaDisplay *display,
+                                    MetaWindow  *window)
 {
   g_signal_emit (display, display_signals[WINDOW_CREATED], 0, window);
 }
@@ -1640,9 +1653,10 @@ meta_display_begin_grab_op (MetaDisplay *display,
 
   if (display->grab_op != META_GRAB_OP_NONE)
     {
-      meta_warning ("Attempt to perform window operation %u on window %s when operation %u on %s already in 
effect\n",
-                    op, window->desc, display->grab_op,
-                    display->grab_window ? display->grab_window->desc : "none");
+      meta_warning (
+        "Attempt to perform window operation %u on window %s when operation %u on %s already in effect\n",
+        op, window->desc, display->grab_op,
+        display->grab_window ? display->grab_window->desc : "none");
       return FALSE;
     }
 
@@ -1685,7 +1699,8 @@ meta_display_begin_grab_op (MetaDisplay *display,
                   timestamp);
   XSync (display->x11_display->xdisplay, False);
 
-  if (meta_backend_grab_device (backend, META_VIRTUAL_CORE_POINTER_ID, timestamp))
+  if (meta_backend_grab_device (backend, META_VIRTUAL_CORE_POINTER_ID,
+                                timestamp))
     display->grab_have_pointer = TRUE;
 
   if (!display->grab_have_pointer && !meta_grab_op_is_keyboard (op))
@@ -1697,12 +1712,15 @@ meta_display_begin_grab_op (MetaDisplay *display,
   /* Grab keys when beginning window ops; see #126497 */
   if (event_route == META_EVENT_ROUTE_WINDOW_OP)
     {
-      display->grab_have_keyboard = meta_window_grab_all_keys (grab_window, timestamp);
+      display->grab_have_keyboard = meta_window_grab_all_keys (grab_window,
+                                                               timestamp);
 
       if (!display->grab_have_keyboard)
         {
-          meta_topic (META_DEBUG_WINDOW_OPS, "grabbing all keys failed, ungrabbing pointer\n");
-          meta_backend_ungrab_device (backend, META_VIRTUAL_CORE_POINTER_ID, timestamp);
+          meta_topic (META_DEBUG_WINDOW_OPS,
+                      "grabbing all keys failed, ungrabbing pointer\n");
+          meta_backend_ungrab_device (backend, META_VIRTUAL_CORE_POINTER_ID,
+                                      timestamp);
           display->grab_have_pointer = FALSE;
           return FALSE;
         }
@@ -1799,7 +1817,8 @@ meta_display_end_grab_op (MetaDisplay *display,
   if (display->grab_have_pointer)
     {
       MetaBackend *backend = meta_get_backend ();
-      meta_backend_ungrab_device (backend, META_VIRTUAL_CORE_POINTER_ID, timestamp);
+      meta_backend_ungrab_device (backend, META_VIRTUAL_CORE_POINTER_ID,
+                                  timestamp);
     }
 
   if (display->grab_have_keyboard)
@@ -1829,7 +1848,7 @@ meta_display_end_grab_op (MetaDisplay *display,
 /**
  * meta_display_get_grab_op:
  * @display: The #MetaDisplay that the window is on
-
+ *
  * Gets the current grab operation, if any.
  *
  * Return value: the current grab operation, or %META_GRAB_OP_NONE if
@@ -1848,7 +1867,8 @@ meta_display_check_threshold_reached (MetaDisplay *display,
                                       int          x,
                                       int          y)
 {
-  /* Don't bother doing the check again if we've already reached the threshold */
+  /* Don't bother doing the check again if we've already reached the threshold
+   * */
   if (meta_prefs_get_raise_on_click () ||
       display->grab_threshold_movement_reached)
     return;
@@ -1861,7 +1881,7 @@ meta_display_check_threshold_reached (MetaDisplay *display,
 void
 meta_display_queue_retheme_all_windows (MetaDisplay *display)
 {
-  GSList* windows;
+  GSList *windows;
   GSList *tmp;
 
   windows = meta_display_list_windows (display, META_LIST_DEFAULT);
@@ -1989,7 +2009,7 @@ meta_display_ping_timeout (gpointer data)
  */
 void
 meta_display_ping_window (MetaWindow *window,
-                         guint32     serial)
+                          guint32     serial)
 {
   MetaDisplay *display = window->display;
   MetaPingData *ping_data;
@@ -2007,9 +2027,10 @@ meta_display_ping_window (MetaWindow *window,
   ping_data->window = window;
   ping_data->serial = serial;
   ping_data->ping_timeout_id = g_timeout_add (PING_TIMEOUT_DELAY,
-                                             meta_display_ping_timeout,
-                                             ping_data);
-  g_source_set_name_by_id (ping_data->ping_timeout_id, "[mutter] meta_display_ping_timeout");
+                                              meta_display_ping_timeout,
+                                              ping_data);
+  g_source_set_name_by_id (ping_data->ping_timeout_id,
+                           "[mutter] meta_display_ping_timeout");
 
   display->pending_pings = g_slist_prepend (display->pending_pings, ping_data);
 
@@ -2030,8 +2051,8 @@ meta_display_ping_window (MetaWindow *window,
  * reply handler function, and freeing memory.
  */
 void
-meta_display_pong_for_serial (MetaDisplay    *display,
-                              guint32         serial)
+meta_display_pong_for_serial (MetaDisplay *display,
+                              guint32      serial)
 {
   GSList *tmp;
 
@@ -2074,12 +2095,19 @@ get_focused_group (MetaDisplay *display)
     return NULL;
 }
 
-#define IN_TAB_CHAIN(w,t) (((t) == META_TAB_LIST_NORMAL && META_WINDOW_IN_NORMAL_TAB_CHAIN (w)) \
-    || ((t) == META_TAB_LIST_DOCKS && META_WINDOW_IN_DOCK_TAB_CHAIN (w)) \
-    || ((t) == META_TAB_LIST_GROUP && META_WINDOW_IN_GROUP_TAB_CHAIN (w, get_focused_group (w->display))) \
-    || ((t) == META_TAB_LIST_NORMAL_ALL && META_WINDOW_IN_NORMAL_TAB_CHAIN_TYPE (w)))
+#define IN_TAB_CHAIN(w, \
+                     t) (((t) == META_TAB_LIST_NORMAL && \
+                          META_WINDOW_IN_NORMAL_TAB_CHAIN (w)) \
+                         || ((t) == META_TAB_LIST_DOCKS && \
+                             META_WINDOW_IN_DOCK_TAB_CHAIN (w)) \
+                         || ((t) == META_TAB_LIST_GROUP && \
+                             META_WINDOW_IN_GROUP_TAB_CHAIN (w, \
+                                                             get_focused_group ( \
+                                                               w->display))) \
+                         || ((t) == META_TAB_LIST_NORMAL_ALL && \
+                             META_WINDOW_IN_NORMAL_TAB_CHAIN_TYPE (w)))
 
-static MetaWindow*
+static MetaWindow *
 find_tab_forward (MetaDisplay   *display,
                   MetaTabList    type,
                   MetaWorkspace *workspace,
@@ -2119,7 +2147,7 @@ find_tab_forward (MetaDisplay   *display,
   return NULL;
 }
 
-static MetaWindow*
+static MetaWindow *
 find_tab_backward (MetaDisplay   *display,
                    MetaTabList    type,
                    MetaWorkspace *workspace,
@@ -2164,8 +2192,8 @@ mru_cmp (gconstpointer a,
 {
   guint32 time_a, time_b;
 
-  time_a = meta_window_get_user_time ((MetaWindow *)a);
-  time_b = meta_window_get_user_time ((MetaWindow *)b);
+  time_a = meta_window_get_user_time ((MetaWindow *) a);
+  time_b = meta_window_get_user_time ((MetaWindow *) b);
 
   if (time_a > time_b)
     return -1;
@@ -2189,7 +2217,7 @@ mru_cmp (gconstpointer a,
  *
  * Returns: (transfer container) (element-type Meta.Window): List of windows
  */
-GList*
+GList *
 meta_display_get_tab_list (MetaDisplay   *display,
                            MetaTabList    type,
                            MetaWorkspace *workspace)
@@ -2265,7 +2293,7 @@ meta_display_get_tab_list (MetaDisplay   *display,
  * Returns: (transfer none): Next window
  *
  */
-MetaWindow*
+MetaWindow *
 meta_display_get_tab_next (MetaDisplay   *display,
                            MetaTabList    type,
                            MetaWorkspace *workspace,
@@ -2285,9 +2313,15 @@ meta_display_get_tab_next (MetaDisplay   *display,
       g_assert (window->display == display);
 
       if (backward)
-        ret = find_tab_backward (display, type, workspace, g_list_find (tab_list, window), TRUE);
+        ret =
+          find_tab_backward (display, type, workspace, g_list_find (tab_list,
+                                                                    window),
+                             TRUE);
       else
-        ret = find_tab_forward (display, type, workspace, g_list_find (tab_list, window), TRUE);
+        ret =
+          find_tab_forward (display, type, workspace, g_list_find (tab_list,
+                                                                   window),
+                            TRUE);
     }
   else
     {
@@ -2314,7 +2348,7 @@ meta_display_get_tab_next (MetaDisplay   *display,
  * Returns: (transfer none): Current window
  *
  */
-MetaWindow*
+MetaWindow *
 meta_display_get_tab_current (MetaDisplay   *display,
                               MetaTabList    type,
                               MetaWorkspace *workspace)
@@ -2390,7 +2424,8 @@ meta_display_manage_all_windows (MetaDisplay *display)
   int n_children, i;
 
   meta_stack_freeze (display->stack);
-  meta_stack_tracker_get_stack (display->stack_tracker, &_children, &n_children);
+  meta_stack_tracker_get_stack (display->stack_tracker, &_children,
+                                &n_children);
 
   /* Copy the stack as it will be modified as part of the loop */
   children = g_memdup (_children, sizeof (guint64) * n_children);
@@ -2416,7 +2451,7 @@ meta_display_unmanage_windows (MetaDisplay *display,
   winlist = meta_display_list_windows (display,
                                        META_LIST_INCLUDE_OVERRIDE_REDIRECT);
   winlist = g_slist_sort (winlist, meta_display_stack_cmp);
-  g_slist_foreach (winlist, (GFunc)g_object_ref, NULL);
+  g_slist_foreach (winlist, (GFunc) g_object_ref, NULL);
 
   /* Unmanage all windows */
   tmp = winlist;
@@ -2441,8 +2476,8 @@ int
 meta_display_stack_cmp (const void *a,
                         const void *b)
 {
-  MetaWindow *aw = (void*) a;
-  MetaWindow *bw = (void*) b;
+  MetaWindow *aw = (void *) a;
+  MetaWindow *bw = (void *) b;
 
   return meta_stack_windows_cmp (aw->display->stack, aw, bw);
 }
@@ -2454,7 +2489,8 @@ meta_display_stack_cmp (const void *a,
  *
  * Sorts a set of windows according to their current stacking order. If windows
  * from multiple screens are present in the set of input windows, then all the
- * windows on screen 0 are sorted below all the windows on screen 1, and so forth.
+ * windows on screen 0 are sorted below all the windows on screen 1, and so
+ *forth.
  * Since the stacking order of override-redirect windows isn't controlled by
  * Metacity, if override-redirect windows are in the input, the result may not
  * correspond to the actual stacking order in the X server.
@@ -2462,7 +2498,8 @@ meta_display_stack_cmp (const void *a,
  * An example of using this would be to sort the list of transient dialogs for a
  * window into their current stacking order.
  *
- * Returns: (transfer container) (element-type MetaWindow): Input windows sorted by stacking order, from 
lowest to highest
+ * Returns: (transfer container) (element-type MetaWindow): Input windows sorted
+ *by stacking order, from lowest to highest
  */
 GSList *
 meta_display_sort_windows_by_stacking (MetaDisplay *display,
@@ -2499,7 +2536,7 @@ meta_display_increment_focus_sentinel (MetaDisplay *display)
                    display->x11_display->xroot,
                    display->x11_display->atom__MUTTER_SENTINEL,
                    XA_CARDINAL,
-                   32, PropModeReplace, (guchar*) data, 1);
+                   32, PropModeReplace, (guchar *) data, 1);
 
   display->sentinel_counter += 1;
 }
@@ -2598,7 +2635,8 @@ meta_display_modifiers_accelerator_activate (MetaDisplay *display)
 {
   gboolean freeze;
 
-  g_signal_emit (display, display_signals[MODIFIERS_ACCELERATOR_ACTIVATED], 0, &freeze);
+  g_signal_emit (display, display_signals[MODIFIERS_ACCELERATOR_ACTIVATED], 0,
+                 &freeze);
 
   return freeze;
 }
@@ -2627,7 +2665,7 @@ meta_display_supports_extended_barriers (MetaDisplay *display)
   if (META_IS_BACKEND_X11 (meta_get_backend ()))
     {
       return (META_X11_DISPLAY_HAS_XINPUT_23 (display->x11_display) &&
-              !meta_is_wayland_compositor());
+              !meta_is_wayland_compositor ());
     }
 
   g_assert_not_reached ();
@@ -2747,11 +2785,11 @@ meta_display_request_restart (MetaDisplay *display)
 }
 
 gboolean
-meta_display_show_resize_popup (MetaDisplay *display,
-                                gboolean show,
+meta_display_show_resize_popup (MetaDisplay   *display,
+                                gboolean       show,
                                 MetaRectangle *rect,
-                                int display_w,
-                                int display_h)
+                                int            display_w,
+                                int            display_h)
 {
   gboolean result = FALSE;
 
@@ -2812,8 +2850,9 @@ meta_display_request_pad_osd (MetaDisplay        *display,
       logical_monitor =
         meta_input_settings_get_tablet_logical_monitor (input_settings, pad);
 #ifdef HAVE_LIBWACOM
-      wacom_device = meta_input_settings_get_tablet_wacom_device (input_settings,
-                                                                  pad);
+      wacom_device = meta_input_settings_get_tablet_wacom_device (
+        input_settings,
+        pad);
       layout_path = libwacom_get_layout_filename (wacom_device);
 #endif
     }
@@ -2849,7 +2888,8 @@ meta_display_get_pad_action_label (MetaDisplay        *display,
 
   /* First, lookup the action, as imposed by settings */
   settings = meta_backend_get_input_settings (meta_get_backend ());
-  label = meta_input_settings_get_pad_action_label (settings, pad, action_type, action_number);
+  label = meta_input_settings_get_pad_action_label (settings, pad, action_type,
+                                                    action_number);
   if (label)
     return label;
 
@@ -2862,8 +2902,9 @@ meta_display_get_pad_action_label (MetaDisplay        *display,
       MetaWaylandTabletPad *tablet_pad = NULL;
 
       compositor = meta_wayland_compositor_get_default ();
-      tablet_seat = meta_wayland_tablet_manager_ensure_seat (compositor->tablet_manager,
-                                                             compositor->seat);
+      tablet_seat = meta_wayland_tablet_manager_ensure_seat (
+        compositor->tablet_manager,
+        compositor->seat);
       if (tablet_seat)
         tablet_pad = meta_wayland_tablet_seat_lookup_pad (tablet_seat, pad);
 
@@ -2903,7 +2944,8 @@ lookup_tablet_monitor (MetaDisplay        *display,
   if (!input_settings)
     return -1;
 
-  monitor = meta_input_settings_get_tablet_logical_monitor (input_settings, device);
+  monitor = meta_input_settings_get_tablet_logical_monitor (input_settings,
+                                                            device);
 
   if (monitor)
     {
@@ -2954,10 +2996,10 @@ meta_display_notify_pad_group_switch (MetaDisplay        *display,
 }
 
 void
-meta_display_foreach_window (MetaDisplay           *display,
-                             MetaListWindowsFlags   flags,
-                             MetaDisplayWindowFunc  func,
-                             gpointer               data)
+meta_display_foreach_window (MetaDisplay          *display,
+                             MetaListWindowsFlags  flags,
+                             MetaDisplayWindowFunc func,
+                             gpointer              data)
 {
   GSList *windows;
 
@@ -3086,7 +3128,7 @@ meta_display_update_tile_preview (MetaDisplay *display,
       if (display->tile_preview_timeout_id > 0)
         g_source_remove (display->tile_preview_timeout_id);
 
-      meta_display_update_tile_preview_timeout ((gpointer)display);
+      meta_display_update_tile_preview_timeout ((gpointer) display);
     }
 }
 
@@ -3160,7 +3202,8 @@ meta_display_apply_startup_properties (MetaDisplay *display,
               sequence = seq;
 
               g_assert (window->startup_id == NULL);
-              window->startup_id = g_strdup (sn_startup_sequence_get_id (sequence));
+              window->startup_id =
+                g_strdup (sn_startup_sequence_get_id (sequence));
               startup_id = window->startup_id;
 
               meta_topic (META_DEBUG_STARTUP,
@@ -3316,7 +3359,8 @@ check_fullscreen_func (gpointer data)
         {
           /* We want to handle the case where an application is creating an
            * override-redirect window the size of the screen (monitor) and treat
-           * it similarly to a fullscreen window, though it doesn't have fullscreen
+           * it similarly to a fullscreen window, though it doesn't have
+           *fullscreen
            * window management behavior. (Being O-R, it's not managed at all.)
            */
           if (meta_window_is_monitor_sized (window))
@@ -3374,7 +3418,7 @@ check_fullscreen_func (gpointer data)
   if (in_fullscreen_changed)
     {
       /* DOCK window stacking depends on the monitor's fullscreen
-         status so we need to trigger a re-layering. */
+       *  status so we need to trigger a re-layering. */
       MetaWindow *window = meta_stack_get_top (display->stack);
       if (window)
         meta_stack_update_layer (display->stack, window);
@@ -3389,9 +3433,10 @@ void
 meta_display_queue_check_fullscreen (MetaDisplay *display)
 {
   if (!display->check_fullscreen_later)
-    display->check_fullscreen_later = meta_later_add (META_LATER_CHECK_FULLSCREEN,
-                                                      check_fullscreen_func,
-                                                      display, NULL);
+    display->check_fullscreen_later = meta_later_add (
+      META_LATER_CHECK_FULLSCREEN,
+      check_fullscreen_func,
+      display, NULL);
 }
 
 int
@@ -3544,7 +3589,8 @@ meta_display_get_monitor_geometry (MetaDisplay   *display,
  * You can get notification when this changes by connecting to
  * MetaDisplay::in-fullscreen-changed.
  *
- * Returns: %TRUE if there is a fullscreen window covering the specified monitor.
+ * Returns: %TRUE if there is a fullscreen window covering the specified
+ *monitor.
  */
 gboolean
 meta_display_get_monitor_in_fullscreen (MetaDisplay *display,
@@ -3568,7 +3614,7 @@ meta_display_get_monitor_in_fullscreen (MetaDisplay *display,
                                                           monitor);
 
   /* We use -1 as a flag to mean "not known yet" for notification
-  purposes */ return logical_monitor->in_fullscreen == TRUE;
+   *  purposes */return logical_monitor->in_fullscreen == TRUE;
 }
 
 MetaWindow *
diff --git a/src/core/edge-resistance.c b/src/core/edge-resistance.c
index 88b2a51e1..3f23dd332 100644
--- a/src/core/edge-resistance.c
+++ b/src/core/edge-resistance.c
@@ -33,20 +33,20 @@
  */
 #define WINDOW_EDGES_RELEVANT(window, display) \
   meta_window_should_be_showing (window) &&    \
-  window         != display->grab_window &&    \
-  window->type   != META_WINDOW_DESKTOP &&     \
-  window->type   != META_WINDOW_MENU    &&     \
-  window->type   != META_WINDOW_SPLASHSCREEN
+  window != display->grab_window &&    \
+  window->type != META_WINDOW_DESKTOP &&     \
+  window->type != META_WINDOW_MENU &&     \
+  window->type != META_WINDOW_SPLASHSCREEN
 
 struct ResistanceDataForAnEdge
 {
-  gboolean     timeout_setup;
-  guint        timeout_id;
-  int          timeout_edge_pos;
-  gboolean     timeout_over;
-  GSourceFunc  timeout_func;
-  MetaWindow  *window;
-  int          keyboard_buildup;
+  gboolean timeout_setup;
+  guint timeout_id;
+  int timeout_edge_pos;
+  gboolean timeout_over;
+  GSourceFunc timeout_func;
+  MetaWindow *window;
+  int keyboard_buildup;
 };
 typedef struct ResistanceDataForAnEdge ResistanceDataForAnEdge;
 
@@ -96,17 +96,17 @@ find_index_of_edge_near_position (const GArray *edges,
   /* Initialize mid, edge, & compare in the off change that the array only
    * has one element.
    */
-  mid  = 0;
-  edge = g_array_index (edges, MetaEdge*, mid);
+  mid = 0;
+  edge = g_array_index (edges, MetaEdge *, mid);
   compare = horizontal ? edge->rect.x : edge->rect.y;
 
   /* Begin the search... */
-  low  = 0;
+  low = 0;
   high = edges->len - 1;
   while (low < high)
     {
-      mid = low + (high - low)/2;
-      edge = g_array_index (edges, MetaEdge*, mid);
+      mid = low + (high - low) / 2;
+      edge = g_array_index (edges, MetaEdge *, mid);
       compare = horizontal ? edge->rect.x : edge->rect.y;
 
       if (compare == position)
@@ -130,13 +130,13 @@ find_index_of_edge_near_position (const GArray *edges,
       while (compare >= position && mid > 0)
         {
           mid--;
-          edge = g_array_index (edges, MetaEdge*, mid);
+          edge = g_array_index (edges, MetaEdge *, mid);
           compare = horizontal ? edge->rect.x : edge->rect.y;
         }
-      while (compare < position && mid < (int)edges->len - 1)
+      while (compare < position && mid < (int) edges->len - 1)
         {
           mid++;
-          edge = g_array_index (edges, MetaEdge*, mid);
+          edge = g_array_index (edges, MetaEdge *, mid);
           compare = horizontal ? edge->rect.x : edge->rect.y;
         }
 
@@ -149,16 +149,16 @@ find_index_of_edge_near_position (const GArray *edges,
     }
   else
     {
-      while (compare <= position && mid < (int)edges->len - 1)
+      while (compare <= position && mid < (int) edges->len - 1)
         {
           mid++;
-          edge = g_array_index (edges, MetaEdge*, mid);
+          edge = g_array_index (edges, MetaEdge *, mid);
           compare = horizontal ? edge->rect.x : edge->rect.y;
         }
       while (compare > position && mid > 0)
         {
           mid--;
-          edge = g_array_index (edges, MetaEdge*, mid);
+          edge = g_array_index (edges, MetaEdge *, mid);
           compare = horizontal ? edge->rect.x : edge->rect.y;
         }
 
@@ -199,17 +199,17 @@ find_nearest_position (const GArray        *edges,
   /* Initialize mid, edge, & compare in the off change that the array only
    * has one element.
    */
-  mid  = 0;
-  edge = g_array_index (edges, MetaEdge*, mid);
+  mid = 0;
+  edge = g_array_index (edges, MetaEdge *, mid);
   compare = horizontal ? edge->rect.x : edge->rect.y;
 
   /* Begin the search... */
-  low  = 0;
+  low = 0;
   high = edges->len - 1;
   while (low < high)
     {
-      mid = low + (high - low)/2;
-      edge = g_array_index (edges, MetaEdge*, mid);
+      mid = low + (high - low) / 2;
+      edge = g_array_index (edges, MetaEdge *, mid);
       compare = horizontal ? edge->rect.x : edge->rect.y;
 
       if (compare == position)
@@ -229,7 +229,7 @@ find_nearest_position (const GArray        *edges,
   best_dist = INT_MAX;
 
   /* Start the search at mid */
-  edge = g_array_index (edges, MetaEdge*, mid);
+  edge = g_array_index (edges, MetaEdge *, mid);
   compare = horizontal ? edge->rect.x : edge->rect.y;
   edges_align = meta_rectangle_edge_aligns (new_rect, edge);
   if (edges_align &&
@@ -244,14 +244,14 @@ find_nearest_position (const GArray        *edges,
     }
 
   /* Now start searching higher than mid */
-  for (i = mid + 1; i < (int)edges->len; i++)
+  for (i = mid + 1; i < (int) edges->len; i++)
     {
-      edge = g_array_index (edges, MetaEdge*, i);
+      edge = g_array_index (edges, MetaEdge *, i);
       compare = horizontal ? edge->rect.x : edge->rect.y;
 
       edges_align = horizontal ?
-        meta_rectangle_vert_overlap (&edge->rect, new_rect) :
-        meta_rectangle_horiz_overlap (&edge->rect, new_rect);
+                    meta_rectangle_vert_overlap (&edge->rect, new_rect) :
+                    meta_rectangle_horiz_overlap (&edge->rect, new_rect);
 
       if (edges_align &&
           (!only_forward ||
@@ -268,14 +268,14 @@ find_nearest_position (const GArray        *edges,
     }
 
   /* Now start searching lower than mid */
-  for (i = mid-1; i >= 0; i--)
+  for (i = mid - 1; i >= 0; i--)
     {
-      edge = g_array_index (edges, MetaEdge*, i);
+      edge = g_array_index (edges, MetaEdge *, i);
       compare = horizontal ? edge->rect.x : edge->rect.y;
 
       edges_align = horizontal ?
-        meta_rectangle_vert_overlap (&edge->rect, new_rect) :
-        meta_rectangle_horiz_overlap (&edge->rect, new_rect);
+                    meta_rectangle_vert_overlap (&edge->rect, new_rect) :
+                    meta_rectangle_horiz_overlap (&edge->rect, new_rect);
 
       if (edges_align &&
           (!only_forward ||
@@ -324,31 +324,31 @@ edge_resistance_timeout (gpointer data)
 }
 
 static int
-apply_edge_resistance (MetaWindow                *window,
-                       int                        old_pos,
-                       int                        new_pos,
-                       const MetaRectangle       *old_rect,
-                       const MetaRectangle       *new_rect,
-                       GArray                    *edges,
-                       ResistanceDataForAnEdge   *resistance_data,
-                       GSourceFunc                timeout_func,
-                       gboolean                   xdir,
-                       gboolean                   keyboard_op)
+apply_edge_resistance (MetaWindow              *window,
+                       int                      old_pos,
+                       int                      new_pos,
+                       const MetaRectangle     *old_rect,
+                       const MetaRectangle     *new_rect,
+                       GArray                  *edges,
+                       ResistanceDataForAnEdge *resistance_data,
+                       GSourceFunc              timeout_func,
+                       gboolean                 xdir,
+                       gboolean                 keyboard_op)
 {
   int i, begin, end;
   int last_edge;
   gboolean increasing = new_pos > old_pos;
-  int      increment = increasing ? 1 : -1;
-
-  const int PIXEL_DISTANCE_THRESHOLD_TOWARDS_WINDOW    = 16;
-  const int PIXEL_DISTANCE_THRESHOLD_AWAYFROM_WINDOW   =  0;
-  const int PIXEL_DISTANCE_THRESHOLD_TOWARDS_MONITOR   = 32;
-  const int PIXEL_DISTANCE_THRESHOLD_AWAYFROM_MONITOR  =  0;
-  const int PIXEL_DISTANCE_THRESHOLD_TOWARDS_SCREEN    = 32;
-  const int PIXEL_DISTANCE_THRESHOLD_AWAYFROM_SCREEN   =  0;
-  const int TIMEOUT_RESISTANCE_LENGTH_MS_WINDOW   =   0;
-  const int TIMEOUT_RESISTANCE_LENGTH_MS_MONITOR =   0;
-  const int TIMEOUT_RESISTANCE_LENGTH_MS_SCREEN   =   0;
+  int increment = increasing ? 1 : -1;
+
+  const int PIXEL_DISTANCE_THRESHOLD_TOWARDS_WINDOW = 16;
+  const int PIXEL_DISTANCE_THRESHOLD_AWAYFROM_WINDOW = 0;
+  const int PIXEL_DISTANCE_THRESHOLD_TOWARDS_MONITOR = 32;
+  const int PIXEL_DISTANCE_THRESHOLD_AWAYFROM_MONITOR = 0;
+  const int PIXEL_DISTANCE_THRESHOLD_TOWARDS_SCREEN = 32;
+  const int PIXEL_DISTANCE_THRESHOLD_AWAYFROM_SCREEN = 0;
+  const int TIMEOUT_RESISTANCE_LENGTH_MS_WINDOW = 0;
+  const int TIMEOUT_RESISTANCE_LENGTH_MS_MONITOR = 0;
+  const int TIMEOUT_RESISTANCE_LENGTH_MS_SCREEN = 0;
 
   /* Quit if no movement was specified */
   if (old_pos == new_pos)
@@ -357,7 +357,7 @@ apply_edge_resistance (MetaWindow                *window,
   /* Remove the old timeout if it's no longer relevant */
   if (resistance_data->timeout_setup &&
       ((resistance_data->timeout_edge_pos > old_pos &&
-        resistance_data->timeout_edge_pos > new_pos)  ||
+        resistance_data->timeout_edge_pos > new_pos) ||
        (resistance_data->timeout_edge_pos < old_pos &&
         resistance_data->timeout_edge_pos < new_pos)))
     {
@@ -370,27 +370,27 @@ apply_edge_resistance (MetaWindow                *window,
     }
 
   /* Get the range of indices in the edge array that we move past/to. */
-  begin = find_index_of_edge_near_position (edges, old_pos,  increasing, xdir);
-  end   = find_index_of_edge_near_position (edges, new_pos, !increasing, xdir);
+  begin = find_index_of_edge_near_position (edges, old_pos, increasing, xdir);
+  end = find_index_of_edge_near_position (edges, new_pos, !increasing, xdir);
 
   /* begin and end can be outside the array index, if the window is partially
    * off the screen
    */
   last_edge = edges->len - 1;
   begin = CLAMP (begin, 0, last_edge);
-  end   = CLAMP (end,   0, last_edge);
+  end = CLAMP (end, 0, last_edge);
 
   /* Loop over all these edges we're moving past/to. */
   i = begin;
-  while ((increasing  && i <= end) ||
+  while ((increasing && i <= end) ||
          (!increasing && i >= end))
     {
-      gboolean  edges_align;
-      MetaEdge *edge = g_array_index (edges, MetaEdge*, i);
-      int       compare = xdir ? edge->rect.x : edge->rect.y;
+      gboolean edges_align;
+      MetaEdge *edge = g_array_index (edges, MetaEdge *, i);
+      int compare = xdir ? edge->rect.x : edge->rect.y;
 
       /* Find out if this edge is relevant */
-      edges_align = meta_rectangle_edge_aligns (new_rect, edge)  ||
+      edges_align = meta_rectangle_edge_aligns (new_rect, edge) ||
                     meta_rectangle_edge_aligns (old_rect, edge);
 
       /* Nothing to do unless the edges align */
@@ -550,8 +550,8 @@ apply_edge_resistance_to_each_side (MetaDisplay         *display,
                                     gboolean             is_resize)
 {
   MetaEdgeResistanceData *edge_data;
-  MetaRectangle           modified_rect;
-  gboolean                modified;
+  MetaRectangle modified_rect;
+  gboolean modified;
   int new_left, new_right, new_top, new_bottom;
 
   if (display->grab_edge_resistance_data == NULL)
@@ -566,26 +566,26 @@ apply_edge_resistance_to_each_side (MetaDisplay         *display,
        * sides of windows to both left and right edges.
        */
 
-      new_left   = apply_edge_snapping (BOX_LEFT (*old_outer),
-                                        BOX_LEFT (*new_outer),
-                                        new_outer,
-                                        edge_data->left_edges,
-                                        TRUE,
-                                        keyboard_op);
-
-      new_right  = apply_edge_snapping (BOX_RIGHT (*old_outer),
-                                        BOX_RIGHT (*new_outer),
-                                        new_outer,
-                                        edge_data->right_edges,
-                                        TRUE,
-                                        keyboard_op);
-
-      new_top    = apply_edge_snapping (BOX_TOP (*old_outer),
-                                        BOX_TOP (*new_outer),
-                                        new_outer,
-                                        edge_data->top_edges,
-                                        FALSE,
-                                        keyboard_op);
+      new_left = apply_edge_snapping (BOX_LEFT (*old_outer),
+                                      BOX_LEFT (*new_outer),
+                                      new_outer,
+                                      edge_data->left_edges,
+                                      TRUE,
+                                      keyboard_op);
+
+      new_right = apply_edge_snapping (BOX_RIGHT (*old_outer),
+                                       BOX_RIGHT (*new_outer),
+                                       new_outer,
+                                       edge_data->right_edges,
+                                       TRUE,
+                                       keyboard_op);
+
+      new_top = apply_edge_snapping (BOX_TOP (*old_outer),
+                                     BOX_TOP (*new_outer),
+                                     new_outer,
+                                     edge_data->top_edges,
+                                     FALSE,
+                                     keyboard_op);
 
       new_bottom = apply_edge_snapping (BOX_BOTTOM (*old_outer),
                                         BOX_BOTTOM (*new_outer),
@@ -600,13 +600,13 @@ apply_edge_resistance_to_each_side (MetaDisplay         *display,
       guint i;
 
       const gfloat tile_edges[] =
-        {
-          1./4.,
-          1./3.,
-          1./2.,
-          2./3.,
-          3./4.,
-        };
+      {
+        1. / 4.,
+        1. / 3.,
+        1. / 2.,
+        2. / 3.,
+        3. / 4.,
+      };
 
       meta_window_get_work_area_current_monitor (window, &workarea);
 
@@ -624,7 +624,8 @@ apply_edge_resistance_to_each_side (MetaDisplay         *display,
        */
       for (i = 0; i < G_N_ELEMENTS (tile_edges); i++)
         {
-          guint horizontal_point = workarea.x + floor (workarea.width * tile_edges[i]);
+          guint horizontal_point = workarea.x + floor (
+            workarea.width * tile_edges[i]);
 
           if (ABS (horizontal_point - new_left) < 16)
             {
@@ -647,45 +648,45 @@ apply_edge_resistance_to_each_side (MetaDisplay         *display,
       if (!is_resize || window->size_hints.width_inc == 1)
         {
           /* Now, apply the normal horizontal edge resistance */
-          new_left   = apply_edge_resistance (window,
-                                              BOX_LEFT (*old_outer),
-                                              BOX_LEFT (*new_outer),
-                                              old_outer,
-                                              new_outer,
-                                              edge_data->left_edges,
-                                              &edge_data->left_data,
-                                              timeout_func,
-                                              TRUE,
-                                              keyboard_op);
-          new_right  = apply_edge_resistance (window,
-                                              BOX_RIGHT (*old_outer),
-                                              BOX_RIGHT (*new_outer),
-                                              old_outer,
-                                              new_outer,
-                                              edge_data->right_edges,
-                                              &edge_data->right_data,
-                                              timeout_func,
-                                              TRUE,
-                                              keyboard_op);
+          new_left = apply_edge_resistance (window,
+                                            BOX_LEFT (*old_outer),
+                                            BOX_LEFT (*new_outer),
+                                            old_outer,
+                                            new_outer,
+                                            edge_data->left_edges,
+                                            &edge_data->left_data,
+                                            timeout_func,
+                                            TRUE,
+                                            keyboard_op);
+          new_right = apply_edge_resistance (window,
+                                             BOX_RIGHT (*old_outer),
+                                             BOX_RIGHT (*new_outer),
+                                             old_outer,
+                                             new_outer,
+                                             edge_data->right_edges,
+                                             &edge_data->right_data,
+                                             timeout_func,
+                                             TRUE,
+                                             keyboard_op);
         }
       else
         {
-          new_left  = new_outer->x;
+          new_left = new_outer->x;
           new_right = new_outer->x + new_outer->width;
         }
       /* Same for vertical resizes... */
       if (!is_resize || window->size_hints.height_inc == 1)
         {
-          new_top    = apply_edge_resistance (window,
-                                              BOX_TOP (*old_outer),
-                                              BOX_TOP (*new_outer),
-                                              old_outer,
-                                              new_outer,
-                                              edge_data->top_edges,
-                                              &edge_data->top_data,
-                                              timeout_func,
-                                              FALSE,
-                                              keyboard_op);
+          new_top = apply_edge_resistance (window,
+                                           BOX_TOP (*old_outer),
+                                           BOX_TOP (*new_outer),
+                                           old_outer,
+                                           new_outer,
+                                           edge_data->top_edges,
+                                           &edge_data->top_data,
+                                           timeout_func,
+                                           FALSE,
+                                           keyboard_op);
           new_bottom = apply_edge_resistance (window,
                                               BOX_BOTTOM (*old_outer),
                                               BOX_BOTTOM (*new_outer),
@@ -699,7 +700,7 @@ apply_edge_resistance_to_each_side (MetaDisplay         *display,
         }
       else
         {
-          new_top    = new_outer->y;
+          new_top = new_outer->y;
           new_bottom = new_outer->y + new_outer->height;
         }
     }
@@ -717,7 +718,7 @@ apply_edge_resistance_to_each_side (MetaDisplay         *display,
 void
 meta_display_cleanup_edges (MetaDisplay *display)
 {
-  guint i,j;
+  guint i, j;
   MetaEdgeResistanceData *edge_data = display->grab_edge_resistance_data;
   GHashTable *edges_to_be_freed;
 
@@ -755,7 +756,7 @@ meta_display_cleanup_edges (MetaDisplay *display)
 
       for (j = 0; j < tmp->len; j++)
         {
-          MetaEdge *edge = g_array_index (tmp, MetaEdge*, j);
+          MetaEdge *edge = g_array_index (tmp, MetaEdge *, j);
           if (edge->edge_type == META_EDGE_WINDOW &&
               edge->side_type == side)
             {
@@ -783,14 +784,14 @@ meta_display_cleanup_edges (MetaDisplay *display)
   edge_data->bottom_edges = NULL;
 
   /* Cleanup the timeouts */
-  if (edge_data->left_data.timeout_setup   &&
-      edge_data->left_data.timeout_id   != 0)
+  if (edge_data->left_data.timeout_setup &&
+      edge_data->left_data.timeout_id != 0)
     g_source_remove (edge_data->left_data.timeout_id);
-  if (edge_data->right_data.timeout_setup  &&
-      edge_data->right_data.timeout_id  != 0)
+  if (edge_data->right_data.timeout_setup &&
+      edge_data->right_data.timeout_id != 0)
     g_source_remove (edge_data->right_data.timeout_id);
-  if (edge_data->top_data.timeout_setup    &&
-      edge_data->top_data.timeout_id    != 0)
+  if (edge_data->top_data.timeout_setup &&
+      edge_data->top_data.timeout_id != 0)
     g_source_remove (edge_data->top_data.timeout_id);
   if (edge_data->bottom_data.timeout_setup &&
       edge_data->bottom_data.timeout_id != 0)
@@ -811,9 +812,9 @@ stupid_sort_requiring_extra_pointer_dereference (gconstpointer a,
 
 static void
 cache_edges (MetaDisplay *display,
-             GList *window_edges,
-             GList *monitor_edges,
-             GList *screen_edges)
+             GList       *window_edges,
+             GList       *monitor_edges,
+             GList       *screen_edges)
 {
   MetaEdgeResistanceData *edge_data;
   GList *tmp;
@@ -824,12 +825,12 @@ cache_edges (MetaDisplay *display,
    * 0th: Print debugging information to the log about the edges
    */
 #ifdef WITH_VERBOSE_MODE
-  if (meta_is_verbose())
+  if (meta_is_verbose ())
     {
-      int max_edges = MAX (MAX( g_list_length (window_edges),
+      int max_edges = MAX (MAX (g_list_length (window_edges),
                                 g_list_length (monitor_edges)),
                            g_list_length (screen_edges));
-      char big_buffer[(EDGE_LENGTH+2)*max_edges];
+      char big_buffer[(EDGE_LENGTH + 2) * max_edges];
 
       meta_rectangle_edge_list_to_string (window_edges, ", ", big_buffer);
       meta_topic (META_DEBUG_EDGE_RESISTANCE,
@@ -897,21 +898,21 @@ cache_edges (MetaDisplay *display,
   g_assert (display->grab_edge_resistance_data == NULL);
   display->grab_edge_resistance_data = g_new0 (MetaEdgeResistanceData, 1);
   edge_data = display->grab_edge_resistance_data;
-  edge_data->left_edges   = g_array_sized_new (FALSE,
-                                               FALSE,
-                                               sizeof(MetaEdge*),
-                                               num_left + num_right);
-  edge_data->right_edges  = g_array_sized_new (FALSE,
-                                               FALSE,
-                                               sizeof(MetaEdge*),
-                                               num_left + num_right);
-  edge_data->top_edges    = g_array_sized_new (FALSE,
-                                               FALSE,
-                                               sizeof(MetaEdge*),
-                                               num_top + num_bottom);
+  edge_data->left_edges = g_array_sized_new (FALSE,
+                                             FALSE,
+                                             sizeof (MetaEdge *),
+                                             num_left + num_right);
+  edge_data->right_edges = g_array_sized_new (FALSE,
+                                              FALSE,
+                                              sizeof (MetaEdge *),
+                                              num_left + num_right);
+  edge_data->top_edges = g_array_sized_new (FALSE,
+                                            FALSE,
+                                            sizeof (MetaEdge *),
+                                            num_top + num_bottom);
   edge_data->bottom_edges = g_array_sized_new (FALSE,
                                                FALSE,
-                                               sizeof(MetaEdge*),
+                                               sizeof (MetaEdge *),
                                                num_top + num_bottom);
 
   /*
@@ -978,14 +979,14 @@ initialize_grab_edge_resistance_data (MetaDisplay *display)
 {
   MetaEdgeResistanceData *edge_data = display->grab_edge_resistance_data;
 
-  edge_data->left_data.timeout_setup   = FALSE;
-  edge_data->right_data.timeout_setup  = FALSE;
-  edge_data->top_data.timeout_setup    = FALSE;
+  edge_data->left_data.timeout_setup = FALSE;
+  edge_data->right_data.timeout_setup = FALSE;
+  edge_data->top_data.timeout_setup = FALSE;
   edge_data->bottom_data.timeout_setup = FALSE;
 
-  edge_data->left_data.keyboard_buildup   = 0;
-  edge_data->right_data.keyboard_buildup  = 0;
-  edge_data->top_data.keyboard_buildup    = 0;
+  edge_data->left_data.keyboard_buildup = 0;
+  edge_data->right_data.keyboard_buildup = 0;
+  edge_data->top_data.keyboard_buildup = 0;
   edge_data->bottom_data.keyboard_buildup = 0;
 }
 
@@ -1055,8 +1056,8 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
   cur_window_iter = stacked_windows;
   while (cur_window_iter != NULL)
     {
-      MetaRectangle  cur_rect;
-      MetaWindow    *cur_window = cur_window_iter->data;
+      MetaRectangle cur_rect;
+      MetaWindow *cur_window = cur_window_iter->data;
       meta_window_get_frame_rect (cur_window, &cur_rect);
 
       /* Check if we want to use this window's edges for edge
@@ -1132,7 +1133,7 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
           while (rem_win_stacking &&
                  stack_position >= GPOINTER_TO_INT (rem_win_stacking->data))
             {
-              rem_windows      = rem_windows->next;
+              rem_windows = rem_windows->next;
               rem_win_stacking = rem_win_stacking->next;
             }
 
@@ -1160,7 +1161,7 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
    * to free a list instead of four ugly ones?
    */
   g_slist_foreach (obscuring_windows,
-                   (void (*)(gpointer,gpointer))&g_free, /* ew, for ugly */
+                   (void (*)(gpointer, gpointer)) & g_free, /* ew, for ugly */
                    NULL);
   g_slist_free (obscuring_windows);
 
@@ -1187,12 +1188,12 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
 }
 
 void
-meta_window_edge_resistance_for_move (MetaWindow  *window,
-                                      int         *new_x,
-                                      int         *new_y,
-                                      GSourceFunc  timeout_func,
-                                      gboolean     snap,
-                                      gboolean     is_keyboard_op)
+meta_window_edge_resistance_for_move (MetaWindow *window,
+                                      int        *new_x,
+                                      int        *new_y,
+                                      GSourceFunc timeout_func,
+                                      gboolean    snap,
+                                      gboolean    is_keyboard_op)
 {
   MetaRectangle old_outer, proposed_outer, new_outer;
   gboolean is_resize;
@@ -1230,9 +1231,9 @@ meta_window_edge_resistance_for_move (MetaWindow  *window,
       else
         reference = &old_outer;
 
-      left_change  = BOX_LEFT (new_outer)  - BOX_LEFT (*reference);
+      left_change = BOX_LEFT (new_outer) - BOX_LEFT (*reference);
       right_change = BOX_RIGHT (new_outer) - BOX_RIGHT (*reference);
-      if (     snap && is_keyboard_op && left_change == 0)
+      if (snap && is_keyboard_op && left_change == 0)
         smaller_x_change = right_change;
       else if (snap && is_keyboard_op && right_change == 0)
         smaller_x_change = left_change;
@@ -1241,9 +1242,9 @@ meta_window_edge_resistance_for_move (MetaWindow  *window,
       else
         smaller_x_change = right_change;
 
-      top_change    = BOX_TOP (new_outer)    - BOX_TOP (*reference);
+      top_change = BOX_TOP (new_outer) - BOX_TOP (*reference);
       bottom_change = BOX_BOTTOM (new_outer) - BOX_BOTTOM (*reference);
-      if (     snap && is_keyboard_op && top_change == 0)
+      if (snap && is_keyboard_op && top_change == 0)
         smaller_y_change = bottom_change;
       else if (snap && is_keyboard_op && bottom_change == 0)
         smaller_y_change = top_change;
@@ -1253,9 +1254,9 @@ meta_window_edge_resistance_for_move (MetaWindow  *window,
         smaller_y_change = bottom_change;
 
       *new_x = old_outer.x + smaller_x_change +
-              (BOX_LEFT (*reference) - BOX_LEFT (old_outer));
+               (BOX_LEFT (*reference) - BOX_LEFT (old_outer));
       *new_y = old_outer.y + smaller_y_change +
-              (BOX_TOP (*reference) - BOX_TOP (old_outer));
+               (BOX_TOP (*reference) - BOX_TOP (old_outer));
 
       meta_topic (META_DEBUG_EDGE_RESISTANCE,
                   "outer x & y move-to coordinate changed from %d,%d to %d,%d\n",
@@ -1265,19 +1266,19 @@ meta_window_edge_resistance_for_move (MetaWindow  *window,
 }
 
 void
-meta_window_edge_resistance_for_resize (MetaWindow  *window,
-                                        int         *new_width,
-                                        int         *new_height,
-                                        int          gravity,
-                                        GSourceFunc  timeout_func,
-                                        gboolean     snap,
-                                        gboolean     is_keyboard_op)
+meta_window_edge_resistance_for_resize (MetaWindow *window,
+                                        int        *new_width,
+                                        int        *new_height,
+                                        int         gravity,
+                                        GSourceFunc timeout_func,
+                                        gboolean    snap,
+                                        gboolean    is_keyboard_op)
 {
   MetaRectangle old_outer, new_outer;
   int proposed_outer_width, proposed_outer_height;
 
   meta_window_get_frame_rect (window, &old_outer);
-  proposed_outer_width  = *new_width;
+  proposed_outer_width = *new_width;
   proposed_outer_height = *new_height;
   meta_rectangle_resize_with_gravity (&old_outer,
                                       &new_outer,
diff --git a/src/core/events.c b/src/core/events.c
index 350fbe86b..147719fe9 100644
--- a/src/core/events.c
+++ b/src/core/events.c
@@ -66,19 +66,19 @@ get_window_for_event (MetaDisplay        *display,
   switch (display->event_route)
     {
     case META_EVENT_ROUTE_NORMAL:
-      {
-        ClutterActor *source;
-
-        /* Always use the key focused window for key events. */
-        if (IS_KEY_EVENT (event))
-            return stage_has_key_focus () ? display->focus_window : NULL;
-
-        source = clutter_event_get_source (event);
-        if (META_IS_SURFACE_ACTOR (source))
-          return meta_surface_actor_get_window (META_SURFACE_ACTOR (source));
-        else
-          return NULL;
-      }
+    {
+      ClutterActor *source;
+
+      /* Always use the key focused window for key events. */
+      if (IS_KEY_EVENT (event))
+        return stage_has_key_focus () ? display->focus_window : NULL;
+
+      source = clutter_event_get_source (event);
+      if (META_IS_SURFACE_ACTOR (source))
+        return meta_surface_actor_get_window (META_SURFACE_ACTOR (source));
+      else
+        return NULL;
+    }
     case META_EVENT_ROUTE_WINDOW_OP:
     case META_EVENT_ROUTE_COMPOSITOR_GRAB:
     case META_EVENT_ROUTE_WAYLAND_POPUP:
@@ -216,7 +216,8 @@ meta_display_handle_event (MetaDisplay        *display,
        event->type == CLUTTER_PAD_RING ||
        event->type == CLUTTER_PAD_STRIP))
     {
-      if (meta_input_settings_handle_pad_event (meta_backend_get_input_settings (backend),
+      if (meta_input_settings_handle_pad_event (meta_backend_get_input_settings (
+                                                  backend),
                                                 event))
         {
           bypass_wayland = bypass_clutter = TRUE;
@@ -229,7 +230,8 @@ meta_display_handle_event (MetaDisplay        *display,
   if (source)
     {
       meta_backend_update_last_device (backend,
-                                       clutter_input_device_get_device_id (source));
+                                       clutter_input_device_get_device_id (
+                                         source));
     }
 
 #ifdef HAVE_WAYLAND
@@ -239,9 +241,11 @@ meta_display_handle_event (MetaDisplay        *display,
 
       compositor = meta_wayland_compositor_get_default ();
 
-      if (meta_wayland_tablet_manager_consumes_event (compositor->tablet_manager, event))
+      if (meta_wayland_tablet_manager_consumes_event (compositor->tablet_manager,
+                                                      event))
         {
-          meta_wayland_tablet_manager_update_cursor_position (compositor->tablet_manager, event);
+          meta_wayland_tablet_manager_update_cursor_position (
+            compositor->tablet_manager, event);
         }
       else
         {
@@ -369,9 +373,10 @@ meta_display_handle_event (MetaDisplay        *display,
             {
               if (META_IS_BACKEND_X11 (backend))
                 {
-                  Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
+                  Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (
+                                                                       backend));
                   meta_verbose ("Allowing events time %u\n",
-                                (unsigned int)event->button.time);
+                                (unsigned int) event->button.time);
                   XIAllowEvents (xdisplay, clutter_event_get_device_id (event),
                                  XIReplayDevice, event->button.time);
                 }
@@ -392,7 +397,7 @@ meta_display_handle_event (MetaDisplay        *display,
       goto out;
     }
 
- out:
+out:
   /* If the compositor has a grab, don't pass that through to Wayland */
   if (display->event_route == META_EVENT_ROUTE_COMPOSITOR_GRAB)
     bypass_wayland = TRUE;
diff --git a/src/core/frame.c b/src/core/frame.c
index e0a952165..b985bcb0d 100644
--- a/src/core/frame.c
+++ b/src/core/frame.c
@@ -85,7 +85,7 @@ meta_window_ensure_frame (MetaWindow *window)
   meta_verbose ("Frame for %s is 0x%lx\n", frame->window->desc, frame->xwindow);
   attrs.event_mask = EVENT_MASK;
   XChangeWindowAttributes (x11_display->xdisplay,
-                          frame->xwindow, CWEventMask, &attrs);
+                           frame->xwindow, CWEventMask, &attrs);
 
   meta_x11_display_register_x_window (x11_display, &frame->xwindow, window);
 
@@ -96,7 +96,8 @@ meta_window_ensure_frame (MetaWindow *window)
                                * we don't want to take that as a withdraw
                                */
       meta_topic (META_DEBUG_WINDOW_STATE,
-                  "Incrementing unmaps_pending on %s for reparent\n", window->desc);
+                  "Incrementing unmaps_pending on %s for reparent\n",
+                  window->desc);
       window->unmaps_pending += 1;
     }
 
@@ -132,7 +133,8 @@ meta_window_ensure_frame (MetaWindow *window)
     MetaBackend *backend = meta_get_backend ();
     if (META_IS_BACKEND_X11 (backend))
       {
-        Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
+        Display *xdisplay =
+          meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
 
         /* Since the backend selects for events on another connection,
          * make sure to sync the GTK+ connection to ensure that the
@@ -140,7 +142,8 @@ meta_window_ensure_frame (MetaWindow *window)
         XSync (x11_display->xdisplay, False);
 
         unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
-        XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
+        XIEventMask mask =
+        { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
 
         XISelectEvents (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
                         frame->xwindow, &mask, 1);
@@ -190,7 +193,8 @@ meta_window_destroy_frame (MetaWindow *window)
                                * by the client.
                                */
       meta_topic (META_DEBUG_WINDOW_STATE,
-                  "Incrementing unmaps_pending on %s for reparent back to root\n", window->desc);
+                  "Incrementing unmaps_pending on %s for reparent back to root\n",
+                  window->desc);
       window->unmaps_pending += 1;
     }
   meta_stack_tracker_record_add (window->display->stack_tracker,
@@ -244,9 +248,9 @@ meta_frame_get_flags (MetaFrame *frame)
 
   if (frame->window->border_only)
     {
-      ; /* FIXME this may disable the _function_ as well as decor
-         * in some cases, which is sort of wrong.
-         */
+      /* FIXME this may disable the _function_ as well as decor
+       * in some cases, which is sort of wrong.
+       */
     }
   else
     {
@@ -314,10 +318,10 @@ meta_frame_get_flags (MetaFrame *frame)
 void
 meta_frame_borders_clear (MetaFrameBorders *self)
 {
-  self->visible.top    = self->invisible.top    = self->total.top    = 0;
+  self->visible.top = self->invisible.top = self->total.top = 0;
   self->visible.bottom = self->invisible.bottom = self->total.bottom = 0;
-  self->visible.left   = self->invisible.left   = self->total.left   = 0;
-  self->visible.right  = self->invisible.right  = self->total.right  = 0;
+  self->visible.left = self->invisible.left = self->total.left = 0;
+  self->visible.right = self->invisible.right = self->total.right = 0;
 }
 
 void
@@ -358,10 +362,10 @@ meta_frame_sync_to_window (MetaFrame *frame,
               frame->rect.y + frame->rect.height);
 
   meta_ui_frame_move_resize (frame->ui_frame,
-                            frame->rect.x,
-                            frame->rect.y,
-                            frame->rect.width,
-                            frame->rect.height);
+                             frame->rect.x,
+                             frame->rect.y,
+                             frame->rect.width,
+                             frame->rect.height);
 
   return need_resize;
 }
@@ -373,8 +377,8 @@ meta_frame_get_frame_bounds (MetaFrame *frame)
 }
 
 void
-meta_frame_get_mask (MetaFrame                    *frame,
-                     cairo_t                      *cr)
+meta_frame_get_mask (MetaFrame *frame,
+                     cairo_t   *cr)
 {
   meta_ui_frame_get_mask (frame->ui_frame, cr);
 }
@@ -386,8 +390,8 @@ meta_frame_queue_draw (MetaFrame *frame)
 }
 
 void
-meta_frame_set_screen_cursor (MetaFrame        *frame,
-                             MetaCursor cursor)
+meta_frame_set_screen_cursor (MetaFrame *frame,
+                              MetaCursor cursor)
 {
   MetaX11Display *x11_display;
   Cursor xcursor;
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 3830492a9..cfb0943ae 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -62,13 +62,13 @@
 #define META_KEY_BINDING_PRIMARY_LAYOUT 0
 #define META_KEY_BINDING_SECONDARY_LAYOUT 1
 
-static gboolean add_builtin_keybinding (MetaDisplay          *display,
-                                        const char           *name,
-                                        GSettings            *settings,
-                                        MetaKeyBindingFlags   flags,
-                                        MetaKeyBindingAction  action,
-                                        MetaKeyHandlerFunc    handler,
-                                        int                   handler_arg);
+static gboolean add_builtin_keybinding (MetaDisplay         *display,
+                                        const char          *name,
+                                        GSettings           *settings,
+                                        MetaKeyBindingFlags  flags,
+                                        MetaKeyBindingAction action,
+                                        MetaKeyHandlerFunc   handler,
+                                        int                  handler_arg);
 
 static void
 resolved_key_combo_reset (MetaResolvedKeyCombo *resolved_combo)
@@ -129,13 +129,13 @@ meta_key_binding_copy (MetaKeyBinding *binding)
   return clone;
 }
 
-G_DEFINE_BOXED_TYPE(MetaKeyBinding,
-                    meta_key_binding,
-                    meta_key_binding_copy,
-                    meta_key_binding_free)
+G_DEFINE_BOXED_TYPE (MetaKeyBinding,
+                     meta_key_binding,
+                     meta_key_binding_copy,
+                     meta_key_binding_free)
 
 const char *
-meta_key_binding_get_name (MetaKeyBinding *binding)
+meta_key_binding_get_name (MetaKeyBinding * binding)
 {
   return binding->name;
 }
@@ -181,8 +181,8 @@ static gboolean process_keyboard_resize_grab (MetaDisplay     *display,
                                               MetaWindow      *window,
                                               ClutterKeyEvent *event);
 
-static void grab_key_bindings           (MetaDisplay *display);
-static void ungrab_key_bindings         (MetaDisplay *display);
+static void grab_key_bindings (MetaDisplay *display);
+static void ungrab_key_bindings (MetaDisplay *display);
 
 static GHashTable *key_handlers;
 static GHashTable *external_grabs;
@@ -199,7 +199,8 @@ key_handler_free (MetaKeyHandler *handler)
 }
 
 typedef struct _MetaKeyGrab MetaKeyGrab;
-struct _MetaKeyGrab {
+struct _MetaKeyGrab
+{
   char *name;
   guint action;
   MetaKeyCombo combo;
@@ -217,13 +218,13 @@ key_combo_key (MetaResolvedKeyCombo *resolved_combo,
                int                   i)
 {
   /* On X, keycodes are only 8 bits while libxkbcommon supports 32 bit
-     keycodes, but since we're using the same XKB keymaps that X uses,
-     we won't find keycodes bigger than 8 bits in practice. The bits
-     that mutter cares about in the modifier mask are also all in the
-     lower 8 bits both on X and clutter key events. This means that we
-     can use a 32 bit integer to safely concatenate both keycode and
-     mask and thus making it easy to use them as an index in a
-     GHashTable. */
+   *  keycodes, but since we're using the same XKB keymaps that X uses,
+   *  we won't find keycodes bigger than 8 bits in practice. The bits
+   *  that mutter cares about in the modifier mask are also all in the
+   *  lower 8 bits both on X and clutter key events. This means that we
+   *  can use a 32 bit integer to safely concatenate both keycode and
+   *  mask and thus making it easy to use them as an index in a
+   *  GHashTable. */
   guint32 key = resolved_combo->keycodes[i] & 0xffff;
   return (key << 16) | (resolved_combo->mask & 0xffff);
 }
@@ -237,15 +238,17 @@ reload_modmap (MetaKeyBindingManager *keys)
   xkb_mod_mask_t dummy_mask;
 
   /* Modifiers to find. */
-  struct {
+  struct
+  {
     const char *name;
     xkb_mod_mask_t *mask_p;
     xkb_mod_mask_t *virtual_mask_p;
-  } mods[] = {
+  } mods[] =
+  {
     { "ScrollLock", &scroll_lock_mask, &dummy_mask },
-    { "Meta",       &keys->meta_mask,  &keys->virtual_meta_mask },
-    { "Hyper",      &keys->hyper_mask, &keys->virtual_hyper_mask },
-    { "Super",      &keys->super_mask, &keys->virtual_super_mask },
+    { "Meta", &keys->meta_mask, &keys->virtual_meta_mask },
+    { "Hyper", &keys->hyper_mask, &keys->virtual_hyper_mask },
+    { "Super", &keys->super_mask, &keys->virtual_super_mask },
   };
 
   scratch_state = xkb_state_new (keymap);
@@ -261,7 +264,9 @@ reload_modmap (MetaKeyBindingManager *keys)
         {
           xkb_mod_mask_t vmodmask = (1 << idx);
           xkb_state_update_mask (scratch_state, vmodmask, 0, 0, 0, 0, 0);
-          *mask_p = xkb_state_serialize_mods (scratch_state, XKB_STATE_MODS_DEPRESSED) & ~vmodmask;
+          *mask_p = xkb_state_serialize_mods (scratch_state,
+                                              XKB_STATE_MODS_DEPRESSED) &
+                    ~vmodmask;
           *virtual_mask_p = vmodmask;
         }
       else
@@ -294,7 +299,8 @@ is_keycode_for_keysym (struct xkb_keymap *keymap,
   const xkb_keysym_t *syms;
   int num_syms, k;
 
-  num_syms = xkb_keymap_key_get_syms_by_level (keymap, keycode, layout, level, &syms);
+  num_syms = xkb_keymap_key_get_syms_by_level (keymap, keycode, layout, level,
+                                               &syms);
   for (k = 0; k < num_syms; k++)
     {
       if (syms[k] == keysym)
@@ -367,9 +373,9 @@ add_keysym_keycodes_from_layout (int                           keysym,
 /* Original code from gdk_x11_keymap_get_entries_for_keyval() in
  * gdkkeys-x11.c */
 static void
-get_keycodes_for_keysym (MetaKeyBindingManager  *keys,
-                         int                     keysym,
-                         MetaResolvedKeyCombo   *resolved_combo)
+get_keycodes_for_keysym (MetaKeyBindingManager *keys,
+                         int                    keysym,
+                         MetaResolvedKeyCombo  *resolved_combo)
 {
   unsigned int i;
   GArray *keycodes;
@@ -395,7 +401,7 @@ get_keycodes_for_keysym (MetaKeyBindingManager  *keys,
       add_keysym_keycodes_from_layout (keysym, layout, keycodes);
     }
 
- out:
+out:
   resolved_combo->len = keycodes->len;
   resolved_combo->keycodes =
     (xkb_keycode_t *) g_array_free (keycodes,
@@ -430,7 +436,8 @@ calculate_n_layout_levels (struct xkb_keymap *keymap,
                            xkb_layout_index_t layout_index)
 
 {
-  CalculateLayoutLevelState state = {
+  CalculateLayoutLevelState state =
+  {
     .keymap = keymap,
     .layout_index = layout_index,
 
@@ -457,7 +464,8 @@ reload_iso_next_group_combos (MetaKeyBindingManager *keys)
   if (iso_next_group_option == NULL)
     return;
 
-  get_keycodes_for_keysym (keys, XKB_KEY_ISO_Next_Group, keys->iso_next_group_combo);
+  get_keycodes_for_keysym (keys, XKB_KEY_ISO_Next_Group,
+                           keys->iso_next_group_combo);
 
   if (keys->iso_next_group_combo[0].len == 0)
     return;
@@ -527,8 +535,8 @@ reload_iso_next_group_combos (MetaKeyBindingManager *keys)
 
 static void
 devirtualize_modifiers (MetaKeyBindingManager *keys,
-                        MetaVirtualModifier     modifiers,
-                        unsigned int           *mask)
+                        MetaVirtualModifier    modifiers,
+                        unsigned int          *mask)
 {
   *mask = 0;
 
@@ -556,7 +564,7 @@ devirtualize_modifiers (MetaKeyBindingManager *keys,
 
 static void
 index_binding (MetaKeyBindingManager *keys,
-               MetaKeyBinding         *binding)
+               MetaKeyBinding        *binding)
 {
   int i;
 
@@ -594,7 +602,6 @@ resolve_key_combo (MetaKeyBindingManager *keys,
                    MetaKeyCombo          *combo,
                    MetaResolvedKeyCombo  *resolved_combo)
 {
-
   resolved_key_combo_reset (resolved_combo);
 
   if (combo->keysym != 0)
@@ -664,7 +671,8 @@ find_latin_keysym (struct xkb_keymap *keymap,
 static gboolean
 needs_secondary_layout (MetaKeyBindingKeyboardLayout *layout)
 {
-  gboolean required_keysyms_found[] = {
+  gboolean required_keysyms_found[] =
+  {
     FALSE, /* XKB_KEY_a */
     FALSE, /* XKB_KEY_b */
     FALSE, /* XKB_KEY_c */
@@ -692,7 +700,8 @@ needs_secondary_layout (MetaKeyBindingKeyboardLayout *layout)
     FALSE, /* XKB_KEY_y */
     FALSE, /* XKB_KEY_z */
   };
-  FindLatinKeysymsState state = {
+  FindLatinKeysymsState state =
+  {
     .layout = layout,
     .required_keysyms_found = required_keysyms_found,
     .n_required_keysyms = G_N_ELEMENTS (required_keysyms_found),
@@ -713,7 +722,9 @@ clear_active_keyboard_layouts (MetaKeyBindingManager *keys)
       MetaKeyBindingKeyboardLayout *layout = &keys->active_layouts[i];
 
       g_clear_pointer (&layout->keymap, xkb_keymap_unref);
-      *layout = (MetaKeyBindingKeyboardLayout) { 0 };
+      *layout = (MetaKeyBindingKeyboardLayout) {
+        0
+      };
     }
 }
 
@@ -731,12 +742,13 @@ create_us_layout (void)
   names.options = "";
 
   context = xkb_context_new (XKB_CONTEXT_NO_FLAGS);
-  keymap = xkb_keymap_new_from_names (context, &names, XKB_KEYMAP_COMPILE_NO_FLAGS);
+  keymap = xkb_keymap_new_from_names (context, &names,
+                                      XKB_KEYMAP_COMPILE_NO_FLAGS);
   xkb_context_unref (context);
 
   return (MetaKeyBindingKeyboardLayout) {
-    .keymap = keymap,
-    .n_levels = calculate_n_layout_levels (keymap, 0),
+           .keymap = keymap,
+           .n_levels = calculate_n_layout_levels (keymap, 0),
   };
 }
 
@@ -781,13 +793,14 @@ reload_combos (MetaKeyBindingManager *keys)
 
   reload_iso_next_group_combos (keys);
 
-  g_hash_table_foreach (keys->key_bindings, binding_reload_combos_foreach, keys);
+  g_hash_table_foreach (keys->key_bindings, binding_reload_combos_foreach,
+                        keys);
 }
 
 static void
 rebuild_binding_table (MetaKeyBindingManager *keys,
-                       GList                  *prefs,
-                       GList                  *grabs)
+                       GList                 *prefs,
+                       GList                 *grabs)
 {
   MetaKeyBinding *b;
   GList *p, *g;
@@ -797,7 +810,7 @@ rebuild_binding_table (MetaKeyBindingManager *keys,
   p = prefs;
   while (p)
     {
-      MetaKeyPref *pref = (MetaKeyPref*)p->data;
+      MetaKeyPref *pref = (MetaKeyPref *) p->data;
       GSList *tmp = pref->combos;
 
       while (tmp)
@@ -826,7 +839,7 @@ rebuild_binding_table (MetaKeyBindingManager *keys,
   g = grabs;
   while (g)
     {
-      MetaKeyGrab *grab = (MetaKeyGrab*)g->data;
+      MetaKeyGrab *grab = (MetaKeyGrab *) g->data;
       if (grab->combo.keysym != None || grab->combo.keycode != 0)
         {
           MetaKeyHandler *handler = HANDLER ("external-grab");
@@ -938,15 +951,15 @@ next_dynamic_keybinding_action (void)
 }
 
 static gboolean
-add_keybinding_internal (MetaDisplay          *display,
-                         const char           *name,
-                         GSettings            *settings,
-                         MetaKeyBindingFlags   flags,
-                         MetaKeyBindingAction  action,
-                         MetaKeyHandlerFunc    func,
-                         int                   data,
-                         gpointer              user_data,
-                         GDestroyNotify        free_data)
+add_keybinding_internal (MetaDisplay         *display,
+                         const char          *name,
+                         GSettings           *settings,
+                         MetaKeyBindingFlags  flags,
+                         MetaKeyBindingAction action,
+                         MetaKeyHandlerFunc   func,
+                         int                  data,
+                         gpointer             user_data,
+                         GDestroyNotify       free_data)
 {
   MetaKeyHandler *handler;
 
@@ -968,13 +981,13 @@ add_keybinding_internal (MetaDisplay          *display,
 }
 
 static gboolean
-add_builtin_keybinding (MetaDisplay          *display,
-                        const char           *name,
-                        GSettings            *settings,
-                        MetaKeyBindingFlags   flags,
-                        MetaKeyBindingAction  action,
-                        MetaKeyHandlerFunc    handler,
-                        int                   handler_arg)
+add_builtin_keybinding (MetaDisplay         *display,
+                        const char          *name,
+                        GSettings           *settings,
+                        MetaKeyBindingFlags  flags,
+                        MetaKeyBindingAction action,
+                        MetaKeyHandlerFunc   handler,
+                        int                  handler_arg)
 {
   return add_keybinding_internal (display, name, settings,
                                   flags | META_KEY_BINDING_BUILTIN,
@@ -993,9 +1006,11 @@ add_builtin_keybinding (MetaDisplay          *display,
  *
  * Add a keybinding at runtime. The key @name in @schema needs to be of
  * type %G_VARIANT_TYPE_STRING_ARRAY, with each string describing a
- * keybinding in the form of "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1". The parser
+ * keybinding in the form of "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1".
+ *The parser
  * is fairly liberal and allows lower or upper case, and also abbreviations
- * such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;". If the key is set to the empty list or a
+ * such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;". If the key is set to the empty list
+ *or a
  * list with a single element of either "" or "disabled", the keybinding is
  * disabled.
  *
@@ -1005,13 +1020,13 @@ add_builtin_keybinding (MetaDisplay          *display,
  *          added successfully, otherwise %META_KEYBINDING_ACTION_NONE
  */
 guint
-meta_display_add_keybinding (MetaDisplay         *display,
-                             const char          *name,
-                             GSettings           *settings,
-                             MetaKeyBindingFlags  flags,
-                             MetaKeyHandlerFunc   handler,
-                             gpointer             user_data,
-                             GDestroyNotify       free_data)
+meta_display_add_keybinding (MetaDisplay        *display,
+                             const char         *name,
+                             GSettings          *settings,
+                             MetaKeyBindingFlags flags,
+                             MetaKeyHandlerFunc  handler,
+                             gpointer            user_data,
+                             GDestroyNotify      free_data)
 {
   guint new_action = next_dynamic_keybinding_action ();
 
@@ -1078,7 +1093,7 @@ get_keybinding_action (MetaKeyBindingManager *keys,
 
 static xkb_mod_mask_t
 mask_from_event_params (MetaKeyBindingManager *keys,
-                        unsigned long mask)
+                        unsigned long          mask)
 {
   return mask & 0xff & ~keys->ignored_modifier_mask;
 }
@@ -1129,23 +1144,27 @@ reload_keybindings (MetaDisplay *display)
 
 static GArray *
 calc_grab_modifiers (MetaKeyBindingManager *keys,
-                     unsigned int modmask)
+                     unsigned int           modmask)
 {
   unsigned int ignored_mask;
   XIGrabModifiers mods;
   GArray *mods_array = g_array_new (FALSE, TRUE, sizeof (XIGrabModifiers));
 
   /* The X server crashes if XIAnyModifier gets passed in with any
-     other bits. It doesn't make sense to ask for a grab of
-     XIAnyModifier plus other bits anyway so we avoid that. */
+   *  other bits. It doesn't make sense to ask for a grab of
+   *  XIAnyModifier plus other bits anyway so we avoid that. */
   if (modmask & XIAnyModifier)
     {
-      mods = (XIGrabModifiers) { XIAnyModifier, 0 };
+      mods = (XIGrabModifiers) {
+        XIAnyModifier, 0
+      };
       g_array_append_val (mods_array, mods);
       return mods_array;
     }
 
-  mods = (XIGrabModifiers) { modmask, 0 };
+  mods = (XIGrabModifiers) {
+    modmask, 0
+  };
   g_array_append_val (mods_array, mods);
 
   for (ignored_mask = 1;
@@ -1154,7 +1173,9 @@ calc_grab_modifiers (MetaKeyBindingManager *keys,
     {
       if (ignored_mask & keys->ignored_modifier_mask)
         {
-          mods = (XIGrabModifiers) { modmask | ignored_mask, 0 };
+          mods = (XIGrabModifiers) {
+            modmask | ignored_mask, 0
+          };
           g_array_append_val (mods_array, mods);
         }
     }
@@ -1164,11 +1185,11 @@ calc_grab_modifiers (MetaKeyBindingManager *keys,
 
 static void
 meta_change_button_grab (MetaKeyBindingManager *keys,
-                         Window                  xwindow,
-                         gboolean                grab,
-                         gboolean                sync,
-                         int                     button,
-                         int                     modmask)
+                         Window                 xwindow,
+                         gboolean               grab,
+                         gboolean               sync,
+                         int                    button,
+                         int                    modmask)
 {
   if (meta_is_wayland_compositor ())
     return;
@@ -1193,11 +1214,11 @@ meta_change_button_grab (MetaKeyBindingManager *keys,
                   button, xwindow, None,
                   sync ? XIGrabModeSync : XIGrabModeAsync,
                   XIGrabModeAsync, False,
-                  &mask, mods->len, (XIGrabModifiers *)mods->data);
+                  &mask, mods->len, (XIGrabModifiers *) mods->data);
   else
     XIUngrabButton (xdisplay,
                     META_VIRTUAL_CORE_POINTER_ID,
-                    button, xwindow, mods->len, (XIGrabModifiers *)mods->data);
+                    button, xwindow, mods->len, (XIGrabModifiers *) mods->data);
 
   g_array_free (mods, TRUE);
 }
@@ -1340,27 +1361,27 @@ prefs_changed_callback (MetaPreference pref,
       grab_key_bindings (display);
       break;
     case META_PREF_MOUSE_BUTTON_MODS:
-      {
-        GSList *windows, *l;
-        windows = meta_display_list_windows (display, META_LIST_DEFAULT);
+    {
+      GSList *windows, *l;
+      windows = meta_display_list_windows (display, META_LIST_DEFAULT);
 
-        for (l = windows; l; l = l->next)
-          {
-            MetaWindow *w = l->data;
-            meta_display_ungrab_window_buttons (display, w->xwindow);
-          }
+      for (l = windows; l; l = l->next)
+        {
+          MetaWindow *w = l->data;
+          meta_display_ungrab_window_buttons (display, w->xwindow);
+        }
 
-        update_window_grab_modifiers (keys);
+      update_window_grab_modifiers (keys);
 
-        for (l = windows; l; l = l->next)
-          {
-            MetaWindow *w = l->data;
-            if (w->type != META_WINDOW_DOCK)
-              meta_display_grab_window_buttons (display, w->xwindow);
-          }
+      for (l = windows; l; l = l->next)
+        {
+          MetaWindow *w = l->data;
+          if (w->type != META_WINDOW_DOCK)
+            meta_display_grab_window_buttons (display, w->xwindow);
+        }
 
-        g_slist_free (windows);
-      }
+      g_slist_free (windows);
+    }
     default:
       break;
     }
@@ -1422,12 +1443,12 @@ meta_change_keygrab (MetaKeyBindingManager *keys,
                        META_VIRTUAL_CORE_KEYBOARD_ID,
                        keycode, xwindow,
                        XIGrabModeSync, XIGrabModeAsync,
-                       False, &mask, mods->len, (XIGrabModifiers *)mods->data);
+                       False, &mask, mods->len, (XIGrabModifiers *) mods->data);
       else
         XIUngrabKeycode (xdisplay,
                          META_VIRTUAL_CORE_KEYBOARD_ID,
                          keycode, xwindow,
-                         mods->len, (XIGrabModifiers *)mods->data);
+                         mods->len, (XIGrabModifiers *) mods->data);
     }
 
   g_array_free (mods, TRUE);
@@ -1448,7 +1469,8 @@ change_keygrab_foreach (gpointer key,
 {
   ChangeKeygrabData *data = user_data;
   MetaKeyBinding *binding = value;
-  gboolean binding_is_per_window = (binding->flags & META_KEY_BINDING_PER_WINDOW) != 0;
+  gboolean binding_is_per_window =
+    (binding->flags & META_KEY_BINDING_PER_WINDOW) != 0;
 
   if (data->only_per_window != binding_is_per_window)
     return;
@@ -1456,14 +1478,15 @@ change_keygrab_foreach (gpointer key,
   if (binding->resolved_combo.len == 0)
     return;
 
-  meta_change_keygrab (data->keys, data->xwindow, data->grab, &binding->resolved_combo);
+  meta_change_keygrab (data->keys, data->xwindow, data->grab,
+                       &binding->resolved_combo);
 }
 
 static void
 change_binding_keygrabs (MetaKeyBindingManager *keys,
-                         Window                  xwindow,
-                         gboolean                only_per_window,
-                         gboolean                grab)
+                         Window                 xwindow,
+                         gboolean               only_per_window,
+                         gboolean               grab)
 {
   ChangeKeygrabData data;
 
@@ -1525,7 +1548,7 @@ change_window_keygrabs (MetaKeyBindingManager *keys,
 }
 
 void
-meta_window_grab_keys (MetaWindow  *window)
+meta_window_grab_keys (MetaWindow *window)
 {
   MetaDisplay *display = window->display;
   MetaKeyBindingManager *keys = &display->key_binding_manager;
@@ -1562,7 +1585,7 @@ meta_window_grab_keys (MetaWindow  *window)
 }
 
 void
-meta_window_ungrab_keys (MetaWindow  *window)
+meta_window_ungrab_keys (MetaWindow *window)
 {
   if (window->keys_grabbed)
     {
@@ -1622,7 +1645,8 @@ meta_display_grab_accelerator (MetaDisplay *display,
       return META_KEYBINDING_ACTION_NONE;
     }
 
-  meta_change_keygrab (keys, display->x11_display->xroot, TRUE, &resolved_combo);
+  meta_change_keygrab (keys, display->x11_display->xroot, TRUE,
+                       &resolved_combo);
 
   grab = g_new0 (MetaKeyGrab, 1);
   grab->action = next_dynamic_keybinding_action ();
@@ -1672,7 +1696,8 @@ meta_display_ungrab_accelerator (MetaDisplay *display,
       for (i = 0; i < binding->resolved_combo.len; i++)
         {
           guint32 index_key = key_combo_key (&binding->resolved_combo, i);
-          g_hash_table_remove (keys->key_bindings_index, GINT_TO_POINTER (index_key));
+          g_hash_table_remove (keys->key_bindings_index,
+                               GINT_TO_POINTER (index_key));
         }
 
       g_hash_table_remove (keys->key_bindings, binding);
@@ -1742,8 +1767,8 @@ ungrab_keyboard (guint32 timestamp)
 }
 
 gboolean
-meta_window_grab_all_keys (MetaWindow  *window,
-                           guint32      timestamp)
+meta_window_grab_all_keys (MetaWindow *window,
+                           guint32     timestamp)
 {
   Window grabwindow;
   gboolean retval;
@@ -1819,7 +1844,8 @@ meta_display_unfreeze_keyboard (MetaDisplay *display, guint32 timestamp)
   if (!META_IS_BACKEND_X11 (backend))
     return;
 
-  Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
+  Display *xdisplay =
+    meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
 
   XIAllowEvents (xdisplay, META_VIRTUAL_CORE_KEYBOARD_ID,
                  XIAsyncDevice, timestamp);
@@ -1863,25 +1889,25 @@ invoke_handler (MetaDisplay     *display,
                 MetaKeyBinding  *binding)
 {
   if (handler->func)
-    (* handler->func) (display,
-                       handler->flags & META_KEY_BINDING_PER_WINDOW ?
-                       window : NULL,
-                       event,
-                       binding,
-                       handler->user_data);
+    (*handler->func)(display,
+                     handler->flags & META_KEY_BINDING_PER_WINDOW ?
+                     window : NULL,
+                     event,
+                     binding,
+                     handler->user_data);
   else
-    (* handler->default_func) (display,
-                               handler->flags & META_KEY_BINDING_PER_WINDOW ?
-                               window: NULL,
-                               event,
-                               binding,
-                               NULL);
+    (*handler->default_func)(display,
+                             handler->flags & META_KEY_BINDING_PER_WINDOW ?
+                             window : NULL,
+                             event,
+                             binding,
+                             NULL);
 }
 
 static gboolean
-process_event (MetaDisplay          *display,
-               MetaWindow           *window,
-               ClutterKeyEvent      *event)
+process_event (MetaDisplay     *display,
+               MetaWindow      *window,
+               ClutterKeyEvent *event)
 {
   MetaKeyBindingManager *keys = &display->key_binding_manager;
   xkb_keycode_t keycode = (xkb_keycode_t) event->hardware_keycode;
@@ -1942,16 +1968,16 @@ process_event (MetaDisplay          *display,
 
   return TRUE;
 
- not_found:
+not_found:
   meta_topic (META_DEBUG_KEYBINDINGS,
               "No handler found for this event in this binding table\n");
   return FALSE;
 }
 
 static gboolean
-process_overlay_key (MetaDisplay *display,
+process_overlay_key (MetaDisplay     *display,
                      ClutterKeyEvent *event,
-                     MetaWindow *window)
+                     MetaWindow      *window)
 {
   MetaKeyBindingManager *keys = &display->key_binding_manager;
   MetaBackend *backend = keys->backend;
@@ -1973,8 +1999,8 @@ process_overlay_key (MetaDisplay *display,
 
   if (keys->overlay_key_only_pressed)
     {
-      if (! resolved_key_combo_has_keycode (&keys->overlay_resolved_key_combo,
-                                            event->hardware_keycode))
+      if (!resolved_key_combo_has_keycode (&keys->overlay_resolved_key_combo,
+                                           event->hardware_keycode))
         {
           keys->overlay_key_only_pressed = FALSE;
 
@@ -1999,7 +2025,8 @@ process_overlay_key (MetaDisplay *display,
 
               if (xdisplay)
                 XIAllowEvents (xdisplay,
-                               clutter_input_device_get_device_id (event->device),
+                               clutter_input_device_get_device_id (
+                                 event->device),
                                XIAsyncDevice, event->time);
             }
           else
@@ -2008,7 +2035,8 @@ process_overlay_key (MetaDisplay *display,
                * per-window key bindings or to the application */
               if (xdisplay)
                 XIAllowEvents (xdisplay,
-                               clutter_input_device_get_device_id (event->device),
+                               clutter_input_device_get_device_id (
+                                 event->device),
                                XIReplayDevice, event->time);
 
               return FALSE;
@@ -2074,7 +2102,7 @@ process_overlay_key (MetaDisplay *display,
 }
 
 static gboolean
-process_iso_next_group (MetaDisplay *display,
+process_iso_next_group (MetaDisplay     *display,
                         ClutterKeyEvent *event)
 {
   MetaKeyBindingManager *keys = &display->key_binding_manager;
@@ -2091,14 +2119,14 @@ process_iso_next_group (MetaDisplay *display,
 
   for (i = 0; i < keys->n_iso_next_group_combos; ++i)
     {
-      for (j = 0; j <  keys->iso_next_group_combo[i].len; ++j)
+      for (j = 0; j < keys->iso_next_group_combo[i].len; ++j)
         {
           if (keycode == keys->iso_next_group_combo[i].keycodes[j] &&
               mask == keys->iso_next_group_combo[i].mask)
             {
               /* If the signal handler returns TRUE the keyboard will
-                 remain frozen. It's the signal handler's responsibility
-                 to unfreeze it. */
+               *  remain frozen. It's the signal handler's responsibility
+               *  to unfreeze it. */
               if (!meta_display_modifiers_accelerator_activate (display))
                 meta_display_unfreeze_keyboard (display, event->time);
               activate = TRUE;
@@ -2135,7 +2163,8 @@ process_key_event (MetaDisplay     *display,
     MetaBackend *backend = meta_get_backend ();
     if (META_IS_BACKEND_X11 (backend))
       {
-        Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
+        Display *xdisplay =
+          meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
         XIAllowEvents (xdisplay,
                        clutter_input_device_get_device_id (event->device),
                        XIAsyncDevice, event->time);
@@ -2160,20 +2189,23 @@ process_key_event (MetaDisplay     *display,
                 {
                   meta_topic (META_DEBUG_KEYBINDINGS,
                               "Processing event for keyboard move\n");
-                  keep_grab = process_keyboard_move_grab (display, window, event);
+                  keep_grab =
+                    process_keyboard_move_grab (display, window, event);
                 }
               else
                 {
                   meta_topic (META_DEBUG_KEYBINDINGS,
                               "Processing event for keyboard resize\n");
-                  keep_grab = process_keyboard_resize_grab (display, window, event);
+                  keep_grab = process_keyboard_resize_grab (display, window,
+                                                            event);
                 }
             }
           else
             {
               meta_topic (META_DEBUG_KEYBINDINGS,
                           "Processing event for mouse-only move/resize\n");
-              keep_grab = process_mouse_move_resize_grab (display, window, event);
+              keep_grab =
+                process_mouse_move_resize_grab (display, window, event);
             }
         }
       if (!keep_grab)
@@ -2740,13 +2772,14 @@ static void
 handle_switch_to_last_workspace (MetaDisplay     *display,
                                  MetaWindow      *event_window,
                                  ClutterKeyEvent *event,
-                                 MetaKeyBinding *binding,
-                                 gpointer        dummy)
+                                 MetaKeyBinding  *binding,
+                                 gpointer         dummy)
 {
-    MetaWorkspaceManager *workspace_manager = display->workspace_manager;
-    gint target = meta_workspace_manager_get_n_workspaces (workspace_manager) - 1;
-    MetaWorkspace *workspace = meta_workspace_manager_get_workspace_by_index (workspace_manager, target);
-    meta_workspace_activate (workspace, event->time);
+  MetaWorkspaceManager *workspace_manager = display->workspace_manager;
+  gint target = meta_workspace_manager_get_n_workspaces (workspace_manager) - 1;
+  MetaWorkspace *workspace = meta_workspace_manager_get_workspace_by_index (
+    workspace_manager, target);
+  meta_workspace_activate (workspace, event->time);
 }
 
 static void
@@ -2766,12 +2799,14 @@ handle_switch_to_workspace (MetaDisplay     *display,
        * current workspace.
        */
 
-      workspace = meta_workspace_get_neighbor (workspace_manager->active_workspace,
-                                               which);
+      workspace = meta_workspace_get_neighbor (
+        workspace_manager->active_workspace,
+        which);
     }
   else
     {
-      workspace = meta_workspace_manager_get_workspace_by_index (workspace_manager, which);
+      workspace = meta_workspace_manager_get_workspace_by_index (
+        workspace_manager, which);
     }
 
   if (workspace)
@@ -2831,9 +2866,9 @@ handle_always_on_top (MetaDisplay     *display,
 }
 
 static void
-handle_move_to_corner_backend (MetaDisplay           *display,
-                               MetaWindow            *window,
-                               int                    gravity)
+handle_move_to_corner_backend (MetaDisplay *display,
+                               MetaWindow  *window,
+                               int          gravity)
 {
   MetaRectangle work_area;
   MetaRectangle frame_rect;
@@ -2986,8 +3021,9 @@ handle_move_to_center  (MetaDisplay     *display,
 
   meta_window_move_frame (window,
                           TRUE,
-                          work_area.x + (work_area.width  - frame_rect.width ) / 2,
-                          work_area.y + (work_area.height - frame_rect.height) / 2);
+                          work_area.x + (work_area.width - frame_rect.width) / 2,
+                          work_area.y + (work_area.height - frame_rect.height) /
+                          2);
 }
 
 static void
@@ -3025,7 +3061,7 @@ handle_panel (MetaDisplay     *display,
   action_atom = None;
   switch (action)
     {
-      /* FIXME: The numbers are wrong */
+    /* FIXME: The numbers are wrong */
     case META_KEYBINDING_ACTION_PANEL_MAIN_MENU:
       action_atom = x11_display->atom__GNOME_PANEL_ACTION_MAIN_MENU;
       break;
@@ -3055,9 +3091,9 @@ handle_panel (MetaDisplay     *display,
 
   XSendEvent (x11_display->xdisplay,
               x11_display->xroot,
-             False,
-             StructureNotifyMask,
-             (XEvent*) &ev);
+              False,
+              StructureNotifyMask,
+              (XEvent *) &ev);
 
   meta_x11_error_trap_pop (x11_display);
 }
@@ -3171,10 +3207,11 @@ handle_toggle_tiled (MetaDisplay     *display,
   if ((META_WINDOW_TILED_LEFT (window) && mode == META_TILE_LEFT) ||
       (META_WINDOW_TILED_RIGHT (window) && mode == META_TILE_RIGHT))
     {
-      window->tile_monitor_number = window->saved_maximize ? window->monitor->number
+      window->tile_monitor_number =
+        window->saved_maximize ? window->monitor->number
         : -1;
       window->tile_mode = window->saved_maximize ? META_TILE_MAXIMIZED
-        : META_TILE_NONE;
+                          : META_TILE_NONE;
 
       if (window->saved_maximize)
         meta_window_maximize (window, META_MAXIMIZE_BOTH);
@@ -3325,7 +3362,8 @@ handle_move_to_workspace_last (MetaDisplay     *display,
     return;
 
   which = meta_workspace_manager_get_n_workspaces (workspace_manager) - 1;
-  workspace = meta_workspace_manager_get_workspace_by_index (workspace_manager, which);
+  workspace = meta_workspace_manager_get_workspace_by_index (workspace_manager,
+                                                             which);
   meta_window_change_workspace (window, workspace);
 }
 
@@ -3356,12 +3394,14 @@ handle_move_to_workspace  (MetaDisplay     *display,
   workspace = NULL;
   if (flip)
     {
-      workspace = meta_workspace_get_neighbor (workspace_manager->active_workspace,
-                                               which);
+      workspace = meta_workspace_get_neighbor (
+        workspace_manager->active_workspace,
+        which);
     }
   else
     {
-      workspace = meta_workspace_manager_get_workspace_by_index (workspace_manager, which);
+      workspace = meta_workspace_manager_get_workspace_by_index (
+        workspace_manager, which);
     }
 
   if (workspace)
@@ -3386,11 +3426,11 @@ handle_move_to_workspace  (MetaDisplay     *display,
 }
 
 static void
-handle_move_to_monitor (MetaDisplay    *display,
-                        MetaWindow     *window,
-                       ClutterKeyEvent *event,
-                        MetaKeyBinding *binding,
-                        gpointer        dummy)
+handle_move_to_monitor (MetaDisplay     *display,
+                        MetaWindow      *window,
+                        ClutterKeyEvent *event,
+                        MetaKeyBinding  *binding,
+                        gpointer         dummy)
 {
   MetaBackend *backend = meta_get_backend ();
   MetaMonitorManager *monitor_manager =
@@ -3410,9 +3450,9 @@ handle_move_to_monitor (MetaDisplay    *display,
 
 static void
 handle_raise_or_lower (MetaDisplay     *display,
-                      MetaWindow      *window,
-                      ClutterKeyEvent *event,
-                      MetaKeyBinding  *binding,
+                       MetaWindow      *window,
+                       ClutterKeyEvent *event,
+                       MetaKeyBinding  *binding,
                        gpointer         dummy)
 {
   /* Get window at pointer */
@@ -3504,11 +3544,11 @@ handle_switch_vt (MetaDisplay     *display,
 #endif /* HAVE_NATIVE_BACKEND */
 
 static void
-handle_switch_monitor (MetaDisplay    *display,
-                       MetaWindow     *window,
+handle_switch_monitor (MetaDisplay     *display,
+                       MetaWindow      *window,
                        ClutterKeyEvent *event,
-                       MetaKeyBinding *binding,
-                       gpointer        dummy)
+                       MetaKeyBinding  *binding,
+                       gpointer         dummy)
 {
   MetaBackend *backend = meta_get_backend ();
   MetaMonitorManager *monitor_manager =
@@ -3524,11 +3564,11 @@ handle_switch_monitor (MetaDisplay    *display,
 }
 
 static void
-handle_rotate_monitor (MetaDisplay    *display,
-                       MetaWindow     *window,
+handle_rotate_monitor (MetaDisplay     *display,
+                       MetaWindow      *window,
                        ClutterKeyEvent *event,
-                       MetaKeyBinding *binding,
-                       gpointer        dummy)
+                       MetaKeyBinding  *binding,
+                       gpointer         dummy)
 {
   MetaBackend *backend = meta_get_backend ();
   MetaMonitorManager *monitor_manager =
@@ -3567,10 +3607,10 @@ handle_restore_shortcuts (MetaDisplay     *display,
  * %FALSE otherwise.
  */
 gboolean
-meta_keybindings_set_custom_handler (const gchar        *name,
-                                     MetaKeyHandlerFunc  handler,
-                                     gpointer            user_data,
-                                     GDestroyNotify      free_data)
+meta_keybindings_set_custom_handler (const gchar       *name,
+                                     MetaKeyHandlerFunc handler,
+                                     gpointer           user_data,
+                                     GDestroyNotify     free_data)
 {
   MetaKeyHandler *key_handler = HANDLER (name);
 
@@ -3592,7 +3632,8 @@ init_builtin_key_bindings (MetaDisplay *display)
 {
   GSettings *common_keybindings = g_settings_new (SCHEMA_COMMON_KEYBINDINGS);
   GSettings *mutter_keybindings = g_settings_new (SCHEMA_MUTTER_KEYBINDINGS);
-  GSettings *mutter_wayland_keybindings = g_settings_new (SCHEMA_MUTTER_WAYLAND_KEYBINDINGS);
+  GSettings *mutter_wayland_keybindings = g_settings_new (
+    SCHEMA_MUTTER_WAYLAND_KEYBINDINGS);
 
   add_builtin_keybinding (display,
                           "switch-to-workspace-1",
@@ -3845,7 +3886,8 @@ init_builtin_key_bindings (MetaDisplay *display)
                           common_keybindings,
                           META_KEY_BINDING_NONE,
                           META_KEYBINDING_ACTION_PANEL_RUN_DIALOG,
-                          handle_panel, META_KEYBINDING_ACTION_PANEL_RUN_DIALOG);
+                          handle_panel,
+                          META_KEYBINDING_ACTION_PANEL_RUN_DIALOG);
 
   add_builtin_keybinding (display,
                           "set-spew-mark",
@@ -4383,7 +4425,8 @@ meta_display_init_keys (MetaDisplay *display)
   keys->super_mask = 0;
   keys->meta_mask = 0;
 
-  keys->key_bindings = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) meta_key_binding_free);
+  keys->key_bindings = g_hash_table_new_full (NULL, NULL, NULL,
+                                              (GDestroyNotify) meta_key_binding_free);
   keys->key_bindings_index = g_hash_table_new (NULL, NULL);
 
   reload_modmap (keys);
@@ -4412,7 +4455,7 @@ meta_display_init_keys (MetaDisplay *display)
 
   external_grabs = g_hash_table_new_full (g_str_hash, g_str_equal,
                                           NULL,
-                                          (GDestroyNotify)meta_key_grab_free);
+                                          (GDestroyNotify) meta_key_grab_free);
 
   init_builtin_key_bindings (display);
 
diff --git a/src/core/main.c b/src/core/main.c
index e8464720f..8784076b5 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -147,12 +147,12 @@ meta_print_self_identity (void)
   g_date_set_time_t (&d, time (NULL));
   g_date_strftime (buf, sizeof (buf), "%x", &d);
   meta_verbose ("Mutter version %s running on %s\n",
-    VERSION, buf);
+                VERSION, buf);
 
   /* Locale and encoding. */
   g_get_charset (&charset);
   meta_verbose ("Running in locale \"%s\" with encoding \"%s\"\n",
-    setlocale (LC_ALL, NULL), charset);
+                setlocale (LC_ALL, NULL), charset);
 
   /* Compilation settings. */
   meta_print_compilation_info ();
@@ -162,23 +162,24 @@ meta_print_self_identity (void)
  * The set of possible options that can be set on Mutter's
  * command line.
  */
-static gchar    *opt_save_file;
-static gchar    *opt_display_name;
-static gchar    *opt_client_id;
-static gboolean  opt_replace_wm;
-static gboolean  opt_disable_sm;
-static gboolean  opt_sync;
+static gchar *opt_save_file;
+static gchar *opt_display_name;
+static gchar *opt_client_id;
+static gboolean opt_replace_wm;
+static gboolean opt_disable_sm;
+static gboolean opt_sync;
 #ifdef HAVE_WAYLAND
-static gboolean  opt_wayland;
-static gboolean  opt_nested;
-static gboolean  opt_no_x11;
+static gboolean opt_wayland;
+static gboolean opt_nested;
+static gboolean opt_no_x11;
 #endif
 #ifdef HAVE_NATIVE_BACKEND
-static gboolean  opt_display_server;
+static gboolean opt_display_server;
 #endif
-static gboolean  opt_x11;
+static gboolean opt_x11;
 
-static GOptionEntry meta_options[] = {
+static GOptionEntry meta_options[] =
+{
   {
     "sm-disable", 0, 0, G_OPTION_ARG_NONE,
     &opt_disable_sm,
@@ -263,7 +264,8 @@ meta_get_option_context (void)
   GOptionContext *ctx;
 
   if (setlocale (LC_ALL, "") == NULL)
-    meta_warning ("Locale not understood by C library, internationalization will not work\n");
+    meta_warning (
+      "Locale not understood by C library, internationalization will not work\n");
   bindtextdomain (GETTEXT_PACKAGE, MUTTER_LOCALEDIR);
   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 
@@ -301,7 +303,8 @@ meta_finalize (void)
 
   if (display)
     meta_display_close (display,
-                        META_CURRENT_TIME); /* I doubt correct timestamps matter here */
+                        META_CURRENT_TIME); /* I doubt correct timestamps matter
+                                             * here */
 
 #ifdef HAVE_WAYLAND
   if (meta_is_wayland_compositor ())
@@ -321,8 +324,8 @@ on_sigterm (gpointer user_data)
 static gboolean
 session_type_is_supported (const char *session_type)
 {
-   return (g_strcmp0 (session_type, "x11") == 0) ||
-          (g_strcmp0 (session_type, "wayland") == 0);
+  return (g_strcmp0 (session_type, "x11") == 0) ||
+         (g_strcmp0 (session_type, "wayland") == 0);
 }
 
 static char *
@@ -439,7 +442,8 @@ calculate_compositor_configuration (MetaCompositorType *compositor_type,
   if ((opt_wayland || opt_nested) && opt_x11)
 #endif
     {
-      meta_warning ("Can't run both as Wayland compositor and X11 compositing manager\n");
+      meta_warning (
+        "Can't run both as Wayland compositor and X11 compositing manager\n");
       meta_exit (META_EXIT_ERROR);
     }
 
@@ -464,7 +468,7 @@ calculate_compositor_configuration (MetaCompositorType *compositor_type,
     *compositor_type = META_COMPOSITOR_TYPE_WAYLAND;
   else
 #endif /* HAVE_WAYLAND */
-    *compositor_type = META_COMPOSITOR_TYPE_X11;
+  *compositor_type = META_COMPOSITOR_TYPE_X11;
 
 #ifdef HAVE_WAYLAND
   if (opt_nested)
@@ -498,10 +502,10 @@ calculate_compositor_configuration (MetaCompositorType *compositor_type,
     }
   else
 #endif /* HAVE_WAYLAND */
-    {
-      *backend_gtype = META_TYPE_BACKEND_X11_CM;
-      return;
-    }
+  {
+    *backend_gtype = META_TYPE_BACKEND_X11_CM;
+    return;
+  }
 }
 
 static gboolean _compositor_configuration_overridden = FALSE;
@@ -533,13 +537,13 @@ meta_init (void)
 
   sigemptyset (&empty_mask);
   act.sa_handler = SIG_IGN;
-  act.sa_mask    = empty_mask;
-  act.sa_flags   = 0;
-  if (sigaction (SIGPIPE,  &act, NULL) < 0)
+  act.sa_mask = empty_mask;
+  act.sa_flags = 0;
+  if (sigaction (SIGPIPE, &act, NULL) < 0)
     g_printerr ("Failed to register SIGPIPE handler: %s\n",
                 g_strerror (errno));
 #ifdef SIGXFSZ
-  if (sigaction (SIGXFSZ,  &act, NULL) < 0)
+  if (sigaction (SIGXFSZ, &act, NULL) < 0)
     g_printerr ("Failed to register SIGXFSZ handler: %s\n",
                 g_strerror (errno));
 #endif
@@ -592,7 +596,8 @@ meta_init (void)
   meta_clutter_init ();
 
 #ifdef HAVE_WAYLAND
-  /* Bring up Wayland. This also launches Xwayland and sets DISPLAY as well... */
+  /* Bring up Wayland. This also launches Xwayland and sets DISPLAY as well...
+   * */
   if (meta_is_wayland_compositor ())
     meta_wayland_init ();
 #endif
@@ -627,7 +632,8 @@ meta_init (void)
 /**
  * meta_register_with_session:
  *
- * Registers mutter with the session manager.  Call this after completing your own
+ * Registers mutter with the session manager.  Call this after completing your
+ *own
  * initialization.
  *
  * This should be called when the session manager can safely continue to the
diff --git a/src/core/meta-accel-parse.c b/src/core/meta-accel-parse.c
index 0d34251af..c7e0c6856 100644
--- a/src/core/meta-accel-parse.c
+++ b/src/core/meta-accel-parse.c
@@ -154,14 +154,14 @@ static inline gboolean
 is_primary (const gchar *string)
 {
   return ((string[0] == '<') &&
-         (string[1] == 'p' || string[1] == 'P') &&
-         (string[2] == 'r' || string[2] == 'R') &&
-         (string[3] == 'i' || string[3] == 'I') &&
-         (string[4] == 'm' || string[4] == 'M') &&
-         (string[5] == 'a' || string[5] == 'A') &&
-         (string[6] == 'r' || string[6] == 'R') &&
-         (string[7] == 'y' || string[7] == 'Y') &&
-         (string[8] == '>'));
+          (string[1] == 'p' || string[1] == 'P') &&
+          (string[2] == 'r' || string[2] == 'R') &&
+          (string[3] == 'i' || string[3] == 'I') &&
+          (string[4] == 'm' || string[4] == 'M') &&
+          (string[5] == 'a' || string[5] == 'A') &&
+          (string[6] == 'r' || string[6] == 'R') &&
+          (string[7] == 'y' || string[7] == 'Y') &&
+          (string[8] == '>'));
 }
 
 static inline gboolean
@@ -174,8 +174,8 @@ is_keycode (const gchar *string)
 }
 
 static gboolean
-accelerator_parse (const gchar         *accelerator,
-                   MetaKeyCombo        *combo)
+accelerator_parse (const gchar  *accelerator,
+                   MetaKeyCombo *combo)
 {
   guint keyval, keycode;
   MetaVirtualModifier mods;
@@ -229,7 +229,8 @@ accelerator_parse (const gchar         *accelerator,
             }
           else if (len >= 6 && is_modx (accelerator))
             {
-              static const guint mod_vals[] = {
+              static const guint mod_vals[] =
+              {
                 META_VIRTUAL_ALT_MASK,
                 META_VIRTUAL_MOD2_MASK,
                 META_VIRTUAL_MOD3_MASK,
@@ -292,31 +293,33 @@ accelerator_parse (const gchar         *accelerator,
               keycode = strtoul (accelerator, NULL, 16);
               goto out;
             }
-         else if (strcmp (accelerator, "Above_Tab") == 0)
+          else if (strcmp (accelerator, "Above_Tab") == 0)
             {
               keyval = META_KEY_ABOVE_TAB;
               goto out;
             }
           else
-           {
-              keyval = xkb_keysym_from_name (accelerator, XKB_KEYSYM_CASE_INSENSITIVE);
-             if (keyval == XKB_KEY_NoSymbol)
-               {
+            {
+              keyval = xkb_keysym_from_name (accelerator,
+                                             XKB_KEYSYM_CASE_INSENSITIVE);
+              if (keyval == XKB_KEY_NoSymbol)
+                {
                   char *with_xf86 = g_strconcat ("XF86", accelerator, NULL);
-                  keyval = xkb_keysym_from_name (with_xf86, XKB_KEYSYM_CASE_INSENSITIVE);
+                  keyval = xkb_keysym_from_name (with_xf86,
+                                                 XKB_KEYSYM_CASE_INSENSITIVE);
                   g_free (with_xf86);
 
                   if (keyval == XKB_KEY_NoSymbol)
                     return FALSE;
                 }
-           }
+            }
 
           accelerator += len;
           len -= len;
         }
     }
 
- out:
+out:
   combo->keysym = keyval;
   combo->keycode = keycode;
   combo->modifiers = mods;
@@ -329,7 +332,9 @@ meta_parse_accelerator (const char   *accel,
 {
   g_return_val_if_fail (combo != NULL, FALSE);
 
-  *combo = (MetaKeyCombo) { 0 };
+  *combo = (MetaKeyCombo) {
+    0
+  };
 
   if (!accel[0] || strcmp (accel, "disabled") == 0)
     return TRUE;
diff --git a/src/core/meta-border.c b/src/core/meta-border.c
index 3c926c419..a687e09aa 100644
--- a/src/core/meta-border.c
+++ b/src/core/meta-border.c
@@ -40,8 +40,8 @@ meta_vector2_add (const MetaVector2 a,
                   const MetaVector2 b)
 {
   return (MetaVector2) {
-    .x = a.x + b.x,
-    .y = a.y + b.y,
+           .x = a.x + b.x,
+           .y = a.y + b.y,
   };
 }
 
@@ -50,8 +50,8 @@ meta_vector2_multiply_constant (const float       c,
                                 const MetaVector2 a)
 {
   return (MetaVector2) {
-    .x = c * a.x,
-    .y = c * a.y,
+           .x = c * a.x,
+           .y = c * a.y,
   };
 }
 
@@ -137,10 +137,10 @@ unsigned int
 meta_border_get_allows_directions (MetaBorder *border)
 {
   return ~border->blocking_directions &
-    (META_BORDER_MOTION_DIRECTION_POSITIVE_X |
-     META_BORDER_MOTION_DIRECTION_POSITIVE_Y |
-     META_BORDER_MOTION_DIRECTION_NEGATIVE_X |
-     META_BORDER_MOTION_DIRECTION_NEGATIVE_Y);
+         (META_BORDER_MOTION_DIRECTION_POSITIVE_X |
+          META_BORDER_MOTION_DIRECTION_POSITIVE_Y |
+          META_BORDER_MOTION_DIRECTION_NEGATIVE_X |
+          META_BORDER_MOTION_DIRECTION_NEGATIVE_Y);
 }
 
 void
diff --git a/src/core/meta-close-dialog-default.c b/src/core/meta-close-dialog-default.c
index fa2c1cae9..5a0e0e154 100644
--- a/src/core/meta-close-dialog-default.c
+++ b/src/core/meta-close-dialog-default.c
@@ -46,7 +46,8 @@ struct _MetaCloseDialogDefault
   guint child_watch_id;
 };
 
-enum {
+enum
+{
   PROP_0,
   PROP_WINDOW,
   N_PROPS
@@ -72,7 +73,8 @@ dialog_exited (GPid     pid,
 
   /* exit status of 0 means the user pressed "Force Quit" */
   if (WIFEXITED (status) && WEXITSTATUS (status) == 0)
-    g_signal_emit_by_name (dialog, "response", META_CLOSE_DIALOG_RESPONSE_FORCE_CLOSE);
+    g_signal_emit_by_name (dialog, "response",
+                           META_CLOSE_DIALOG_RESPONSE_FORCE_CLOSE);
 }
 
 static void
@@ -152,10 +154,10 @@ meta_close_dialog_default_show (MetaCloseDialog *dialog)
     tmp = g_strdup (_("Application is not responding."));
 
   window_content = g_strdup_printf (
-      "<big><b>%s</b></big>\n\n%s",
-      tmp,
-      _("You may choose to wait a short while for it to "
-        "continue or force the application to quit entirely."));
+    "<big><b>%s</b></big>\n\n%s",
+    tmp,
+    _("You may choose to wait a short while for it to "
+      "continue or force the application to quit entirely."));
 
   dialog_pid =
     meta_show_dialog ("--question",
diff --git a/src/core/meta-close-dialog.c b/src/core/meta-close-dialog.c
index 81f692364..e45e2e546 100644
--- a/src/core/meta-close-dialog.c
+++ b/src/core/meta-close-dialog.c
@@ -25,7 +25,8 @@
 #include "meta/meta-close-dialog.h"
 #include "meta/meta-enum-types.h"
 
-enum {
+enum
+{
   RESPONSE,
   N_SIGNALS
 };
@@ -102,8 +103,8 @@ meta_close_dialog_hide (MetaCloseDialog *dialog)
  * implementations.
  **/
 void
-meta_close_dialog_response (MetaCloseDialog         *dialog,
-                            MetaCloseDialogResponse  response)
+meta_close_dialog_response (MetaCloseDialog        *dialog,
+                            MetaCloseDialogResponse response)
 {
   g_signal_emit (dialog, dialog_signals[RESPONSE], 0, response);
   meta_close_dialog_hide (dialog);
@@ -120,7 +121,8 @@ meta_close_dialog_response (MetaCloseDialog         *dialog,
 gboolean
 meta_close_dialog_is_visible (MetaCloseDialog *dialog)
 {
-  return GPOINTER_TO_INT (g_object_get_qdata (G_OBJECT (dialog), quark_visible));
+  return GPOINTER_TO_INT (g_object_get_qdata (G_OBJECT (dialog),
+                                              quark_visible));
 }
 
 /**
diff --git a/src/core/meta-fraction.c b/src/core/meta-fraction.c
index 8090aa411..c3b7e9b2b 100644
--- a/src/core/meta-fraction.c
+++ b/src/core/meta-fraction.c
@@ -128,7 +128,7 @@ meta_fraction_from_double (double src)
     }
 
   return (MetaFraction) {
-    .num = N,
-    .denom = D
+           .num = N,
+           .denom = D
   };
 }
diff --git a/src/core/meta-gesture-tracker.c b/src/core/meta-gesture-tracker.c
index e27a35230..ad434da11 100644
--- a/src/core/meta-gesture-tracker.c
+++ b/src/core/meta-gesture-tracker.c
@@ -61,7 +61,8 @@ struct _GestureActionData
 
 struct _MetaGestureTrackerPrivate
 {
-  GHashTable *sequences; /* Hashtable of ClutterEventSequence->MetaSequenceInfo */
+  GHashTable *sequences; /* Hashtable of ClutterEventSequence->MetaSequenceInfo
+                          * */
 
   MetaSequenceState stage_state;
   GArray *stage_gestures; /* Array of GestureActionData */
@@ -69,7 +70,8 @@ struct _MetaGestureTrackerPrivate
   guint autodeny_timeout;
 };
 
-enum {
+enum
+{
   PROP_0,
   PROP_AUTODENY_TIMEOUT,
   PROP_LAST,
@@ -77,7 +79,8 @@ enum {
 
 static GParamSpec *obj_props[PROP_LAST];
 
-enum {
+enum
+{
   STATE_CHANGED,
   N_SIGNALS
 };
@@ -88,14 +91,16 @@ static guint signals[N_SIGNALS] = { 0 };
 
 static void meta_gesture_tracker_untrack_stage (MetaGestureTracker *tracker);
 
-G_DEFINE_TYPE_WITH_PRIVATE (MetaGestureTracker, meta_gesture_tracker, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (MetaGestureTracker, meta_gesture_tracker,
+                            G_TYPE_OBJECT)
 
 static void
 meta_gesture_tracker_finalize (GObject *object)
 {
   MetaGestureTrackerPrivate *priv;
 
-  priv = meta_gesture_tracker_get_instance_private (META_GESTURE_TRACKER (object));
+  priv = meta_gesture_tracker_get_instance_private (META_GESTURE_TRACKER (
+                                                      object));
 
   g_hash_table_destroy (priv->sequences);
   g_array_free (priv->stage_gestures, TRUE);
@@ -112,7 +117,8 @@ meta_gesture_tracker_set_property (GObject      *object,
 {
   MetaGestureTrackerPrivate *priv;
 
-  priv = meta_gesture_tracker_get_instance_private (META_GESTURE_TRACKER (object));
+  priv = meta_gesture_tracker_get_instance_private (META_GESTURE_TRACKER (
+                                                      object));
 
   switch (prop_id)
     {
@@ -133,7 +139,8 @@ meta_gesture_tracker_get_property (GObject    *object,
 {
   MetaGestureTrackerPrivate *priv;
 
-  priv = meta_gesture_tracker_get_instance_private (META_GESTURE_TRACKER (object));
+  priv = meta_gesture_tracker_get_instance_private (META_GESTURE_TRACKER (
+                                                      object));
 
   switch (prop_id)
     {
@@ -158,7 +165,8 @@ meta_gesture_tracker_class_init (MetaGestureTrackerClass *klass)
   obj_props[PROP_AUTODENY_TIMEOUT] = g_param_spec_uint ("autodeny-timeout",
                                                         "Auto-deny timeout",
                                                         "Auto-deny timeout",
-                                                        0, G_MAXUINT, DEFAULT_AUTODENY_TIMEOUT,
+                                                        0, G_MAXUINT,
+                                                        DEFAULT_AUTODENY_TIMEOUT,
                                                         G_PARAM_STATIC_STRINGS |
                                                         G_PARAM_READWRITE |
                                                         G_PARAM_CONSTRUCT_ONLY);
@@ -267,7 +275,7 @@ meta_gesture_tracker_set_state (MetaGestureTracker *tracker,
   g_hash_table_iter_init (&iter, priv->sequences);
   priv->stage_state = state;
 
-  while (g_hash_table_iter_next (&iter, (gpointer*) &sequence, NULL))
+  while (g_hash_table_iter_next (&iter, (gpointer *) &sequence, NULL))
     meta_gesture_tracker_set_sequence_state (tracker, sequence, state);
 
   return TRUE;
@@ -349,7 +357,8 @@ meta_gesture_tracker_init (MetaGestureTracker *tracker)
   priv->sequences = g_hash_table_new_full (NULL, NULL, NULL,
                                            (GDestroyNotify) meta_sequence_info_free);
   priv->stage_gestures = g_array_new (FALSE, FALSE, sizeof (GestureActionData));
-  g_array_set_clear_func (priv->stage_gestures, (GDestroyNotify) clear_gesture_data);
+  g_array_set_clear_func (priv->stage_gestures,
+                          (GDestroyNotify) clear_gesture_data);
 }
 
 MetaGestureTracker *
@@ -411,7 +420,7 @@ meta_gesture_tracker_untrack_stage (MetaGestureTracker *tracker)
 
 gboolean
 meta_gesture_tracker_handle_event (MetaGestureTracker *tracker,
-                                  const ClutterEvent *event)
+                                   const ClutterEvent *event)
 {
   MetaGestureTrackerPrivate *priv;
   ClutterEventSequence *sequence;
@@ -544,7 +553,8 @@ meta_gesture_tracker_set_sequence_state (MetaGestureTracker   *tracker,
   info->state = state;
   g_signal_emit (tracker, signals[STATE_CHANGED], 0, sequence, info->state);
 
-  /* If the sequence was denied, set immediately to PENDING_END after emission */
+  /* If the sequence was denied, set immediately to PENDING_END after emission
+   * */
   if (state == META_SEQUENCE_REJECTED)
     {
       info->state = META_SEQUENCE_PENDING_END;
@@ -561,7 +571,8 @@ meta_gesture_tracker_get_sequence_state (MetaGestureTracker   *tracker,
   MetaGestureTrackerPrivate *priv;
   MetaSequenceInfo *info;
 
-  g_return_val_if_fail (META_IS_GESTURE_TRACKER (tracker), META_SEQUENCE_PENDING_END);
+  g_return_val_if_fail (META_IS_GESTURE_TRACKER (
+                          tracker), META_SEQUENCE_PENDING_END);
 
   priv = meta_gesture_tracker_get_instance_private (tracker);
   info = g_hash_table_lookup (priv->sequences, sequence);
diff --git a/src/core/meta-inhibit-shortcuts-dialog-default.c 
b/src/core/meta-inhibit-shortcuts-dialog-default.c
index 55ac82359..854e7d37d 100644
--- a/src/core/meta-inhibit-shortcuts-dialog-default.c
+++ b/src/core/meta-inhibit-shortcuts-dialog-default.c
@@ -25,7 +25,8 @@
 #include "core/window-private.h"
 #include "meta/meta-inhibit-shortcuts-dialog.h"
 
-typedef struct _MetaInhibitShortcutsDialogDefaultPrivate MetaInhibitShortcutsDialogDefaultPrivate;
+typedef struct _MetaInhibitShortcutsDialogDefaultPrivate
+  MetaInhibitShortcutsDialogDefaultPrivate;
 
 struct _MetaInhibitShortcutsDialogDefault
 {
@@ -33,25 +34,32 @@ struct _MetaInhibitShortcutsDialogDefault
   MetaWindow *window;
 };
 
-enum {
+enum
+{
   PROP_0,
   PROP_WINDOW,
   N_PROPS
 };
 
-static void meta_inhibit_shortcuts_dialog_iface_init (MetaInhibitShortcutsDialogInterface *iface);
+static void meta_inhibit_shortcuts_dialog_iface_init (
+  MetaInhibitShortcutsDialogInterface *iface);
 
-G_DEFINE_TYPE_WITH_CODE (MetaInhibitShortcutsDialogDefault, meta_inhibit_shortcuts_dialog_default,
+G_DEFINE_TYPE_WITH_CODE (MetaInhibitShortcutsDialogDefault,
+                         meta_inhibit_shortcuts_dialog_default,
                          G_TYPE_OBJECT,
-                         G_IMPLEMENT_INTERFACE (META_TYPE_INHIBIT_SHORTCUTS_DIALOG,
-                                                meta_inhibit_shortcuts_dialog_iface_init))
+                         G_IMPLEMENT_INTERFACE (
+                           META_TYPE_INHIBIT_SHORTCUTS_DIALOG,
+                           meta_inhibit_shortcuts_dialog_iface_init))
 
 static void
 meta_inhibit_shortcuts_dialog_default_show (MetaInhibitShortcutsDialog *dialog)
 {
-  /* Default to allow shortcuts inhibitor, but complain that no dialog is implemented */
-  g_warning ("No MetaInhibitShortcutDialog implementation, falling back on allowing");
-  meta_inhibit_shortcuts_dialog_response (dialog, META_INHIBIT_SHORTCUTS_DIALOG_RESPONSE_ALLOW);
+  /* Default to allow shortcuts inhibitor, but complain that no dialog is
+   * implemented */
+  g_warning (
+    "No MetaInhibitShortcutDialog implementation, falling back on allowing");
+  meta_inhibit_shortcuts_dialog_response (dialog,
+                                          META_INHIBIT_SHORTCUTS_DIALOG_RESPONSE_ALLOW);
 }
 
 static void
@@ -60,7 +68,8 @@ meta_inhibit_shortcuts_dialog_default_hide (MetaInhibitShortcutsDialog *dialog)
 }
 
 static void
-meta_inhibit_shortcuts_dialog_iface_init (MetaInhibitShortcutsDialogInterface *iface)
+meta_inhibit_shortcuts_dialog_iface_init (
+  MetaInhibitShortcutsDialogInterface *iface)
 {
   iface->show = meta_inhibit_shortcuts_dialog_default_show;
   iface->hide = meta_inhibit_shortcuts_dialog_default_hide;
@@ -107,18 +116,22 @@ meta_inhibit_shortcuts_dialog_default_get_property (GObject    *object,
 }
 
 static void
-meta_inhibit_shortcuts_dialog_default_class_init (MetaInhibitShortcutsDialogDefaultClass *klass)
+meta_inhibit_shortcuts_dialog_default_class_init (
+  MetaInhibitShortcutsDialogDefaultClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-  object_class->set_property = meta_inhibit_shortcuts_dialog_default_set_property;
-  object_class->get_property = meta_inhibit_shortcuts_dialog_default_get_property;
+  object_class->set_property =
+    meta_inhibit_shortcuts_dialog_default_set_property;
+  object_class->get_property =
+    meta_inhibit_shortcuts_dialog_default_get_property;
 
   g_object_class_override_property (object_class, PROP_WINDOW, "window");
 }
 
 static void
-meta_inhibit_shortcuts_dialog_default_init (MetaInhibitShortcutsDialogDefault *dialog)
+meta_inhibit_shortcuts_dialog_default_init (
+  MetaInhibitShortcutsDialogDefault *dialog)
 {
 }
 
diff --git a/src/core/meta-inhibit-shortcuts-dialog.c b/src/core/meta-inhibit-shortcuts-dialog.c
index d5b4e5a05..b15976f94 100644
--- a/src/core/meta-inhibit-shortcuts-dialog.c
+++ b/src/core/meta-inhibit-shortcuts-dialog.c
@@ -30,10 +30,12 @@ enum
 
 static guint inhibit_dialog_signals[LAST_SIGNAL] = { 0, };
 
-G_DEFINE_INTERFACE (MetaInhibitShortcutsDialog, meta_inhibit_shortcuts_dialog, G_TYPE_OBJECT)
+G_DEFINE_INTERFACE (MetaInhibitShortcutsDialog, meta_inhibit_shortcuts_dialog,
+                    G_TYPE_OBJECT)
 
 static void
-meta_inhibit_shortcuts_dialog_default_init (MetaInhibitShortcutsDialogInterface *iface)
+meta_inhibit_shortcuts_dialog_default_init (
+  MetaInhibitShortcutsDialogInterface *iface)
 {
   g_object_interface_install_property (iface,
                                        g_param_spec_object ("window",
@@ -41,7 +43,8 @@ meta_inhibit_shortcuts_dialog_default_init (MetaInhibitShortcutsDialogInterface
                                                             "Window",
                                                             META_TYPE_WINDOW,
                                                             G_PARAM_READWRITE |
-                                                            G_PARAM_CONSTRUCT_ONLY |
+                                                            G_PARAM_CONSTRUCT_ONLY
+                                                            |
                                                             G_PARAM_STATIC_STRINGS));
   inhibit_dialog_signals[RESPONSE] =
     g_signal_new ("response",
@@ -95,8 +98,9 @@ meta_inhibit_shortcuts_dialog_hide (MetaInhibitShortcutsDialog *dialog)
  * implementations.
  **/
 void
-meta_inhibit_shortcuts_dialog_response (MetaInhibitShortcutsDialog         *dialog,
-                                        MetaInhibitShortcutsDialogResponse  response)
+meta_inhibit_shortcuts_dialog_response (
+  MetaInhibitShortcutsDialog        *dialog,
+  MetaInhibitShortcutsDialogResponse response)
 {
   g_signal_emit (dialog, inhibit_dialog_signals[RESPONSE], 0, response);
   meta_inhibit_shortcuts_dialog_hide (dialog);
diff --git a/src/core/meta-workspace-manager.c b/src/core/meta-workspace-manager.c
index 9590cc9aa..f74048330 100644
--- a/src/core/meta-workspace-manager.c
+++ b/src/core/meta-workspace-manager.c
@@ -46,7 +46,8 @@ enum
   LAST_SIGNAL
 };
 
-enum {
+enum
+{
   PROP_0,
 
   PROP_N_WORKSPACES
@@ -68,7 +69,9 @@ meta_workspace_manager_get_property (GObject    *object,
   switch (prop_id)
     {
     case PROP_N_WORKSPACES:
-      g_value_set_int (value, meta_workspace_manager_get_n_workspaces (workspace_manager));
+      g_value_set_int (value,
+                       meta_workspace_manager_get_n_workspaces (
+                         workspace_manager));
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -168,7 +171,8 @@ meta_workspace_manager_init (MetaWorkspaceManager *workspace_manager)
 }
 
 void
-meta_workspace_manager_reload_work_areas (MetaWorkspaceManager *workspace_manager)
+meta_workspace_manager_reload_work_areas (
+  MetaWorkspaceManager *workspace_manager)
 {
   GList *l;
 
@@ -231,9 +235,11 @@ meta_workspace_manager_init_workspaces (MetaWorkspaceManager *workspace_manager)
   else
     num = meta_prefs_get_num_workspaces ();
 
-  meta_workspace_manager_update_num_workspaces (workspace_manager, META_CURRENT_TIME, num);
+  meta_workspace_manager_update_num_workspaces (workspace_manager,
+                                                META_CURRENT_TIME, num);
 
-  meta_workspace_activate (workspace_manager->workspaces->data, META_CURRENT_TIME);
+  meta_workspace_activate (workspace_manager->workspaces->data,
+                           META_CURRENT_TIME);
 
   meta_workspace_manager_reload_work_areas (workspace_manager);
 }
@@ -249,24 +255,28 @@ meta_workspace_manager_get_n_workspaces (MetaWorkspaceManager *workspace_manager
  * @workspace_manager: a #MetaWorkspaceManager
  * @index: index of one of the display's workspaces
  *
- * Gets the workspace object for one of a workspace manager's workspaces given the workspace
+ * Gets the workspace object for one of a workspace manager's workspaces given
+ *the workspace
  * index. It's valid to call this function with an out-of-range index and it
  * will robustly return %NULL.
  *
- * Return value: (transfer none): the workspace object with specified index, or %NULL
+ * Return value: (transfer none): the workspace object with specified index, or
+ *%NULL
  *   if the index is out of range.
  */
 MetaWorkspace *
-meta_workspace_manager_get_workspace_by_index (MetaWorkspaceManager *workspace_manager,
-                                               int                   idx)
+meta_workspace_manager_get_workspace_by_index (
+  MetaWorkspaceManager *workspace_manager,
+  int                   idx)
 {
   return g_list_nth_data (workspace_manager->workspaces, idx);
 }
 
 void
-meta_workspace_manager_remove_workspace (MetaWorkspaceManager *workspace_manager,
-                                         MetaWorkspace        *workspace,
-                                         guint32               timestamp)
+meta_workspace_manager_remove_workspace (
+  MetaWorkspaceManager *workspace_manager,
+  MetaWorkspace        *workspace,
+  guint32               timestamp)
 {
   GList *l;
   GList *next;
@@ -299,7 +309,8 @@ meta_workspace_manager_remove_workspace (MetaWorkspaceManager *workspace_manager
 
   /* To emit the signal after removing the workspace */
   index = meta_workspace_index (workspace);
-  active_index = meta_workspace_manager_get_active_workspace_index (workspace_manager);
+  active_index = meta_workspace_manager_get_active_workspace_index (
+    workspace_manager);
   active_index_changed = index < active_index;
 
   /* This also removes the workspace from the displays list */
@@ -339,15 +350,17 @@ meta_workspace_manager_remove_workspace (MetaWorkspaceManager *workspace_manager
  *   focusing a window on the new workspace. (Doesn't hurt to pass a valid
  *   timestamp when available even if not switching workspaces.)
  *
- * Append a new workspace to the workspace manager and (optionally) switch to that
+ * Append a new workspace to the workspace manager and (optionally) switch to
+ *that
  * display.
  *
  * Return value: (transfer none): the newly appended workspace.
  */
 MetaWorkspace *
-meta_workspace_manager_append_new_workspace (MetaWorkspaceManager *workspace_manager,
-                                             gboolean              activate,
-                                             guint32               timestamp)
+meta_workspace_manager_append_new_workspace (
+  MetaWorkspaceManager *workspace_manager,
+  gboolean              activate,
+  guint32               timestamp)
 {
   MetaWorkspace *w;
   int new_num;
@@ -376,9 +389,10 @@ meta_workspace_manager_append_new_workspace (MetaWorkspaceManager *workspace_man
 }
 
 void
-meta_workspace_manager_update_num_workspaces (MetaWorkspaceManager *workspace_manager,
-                                              guint32               timestamp,
-                                              int                   new_num)
+meta_workspace_manager_update_num_workspaces (
+  MetaWorkspaceManager *workspace_manager,
+  guint32               timestamp,
+  int                   new_num)
 {
   int old_num;
   GList *l;
@@ -450,11 +464,12 @@ meta_workspace_manager_update_num_workspaces (MetaWorkspaceManager *workspace_ma
 }
 
 void
-meta_workspace_manager_update_workspace_layout (MetaWorkspaceManager *workspace_manager,
-                                                MetaDisplayCorner     starting_corner,
-                                                gboolean              vertical_layout,
-                                                int                   n_rows,
-                                                int                   n_columns)
+meta_workspace_manager_update_workspace_layout (
+  MetaWorkspaceManager *workspace_manager,
+  MetaDisplayCorner     starting_corner,
+  gboolean              vertical_layout,
+  int                   n_rows,
+  int                   n_columns)
 {
   g_return_if_fail (META_IS_WORKSPACE_MANAGER (workspace_manager));
   g_return_if_fail (n_rows > 0 || n_columns > 0);
@@ -468,32 +483,38 @@ meta_workspace_manager_update_workspace_layout (MetaWorkspaceManager *workspace_
   workspace_manager->rows_of_workspaces = n_rows;
   workspace_manager->columns_of_workspaces = n_columns;
 
-  meta_verbose ("Workspace layout rows = %d cols = %d orientation = %d starting corner = %u\n",
-                workspace_manager->rows_of_workspaces,
-                workspace_manager->columns_of_workspaces,
-                workspace_manager->vertical_workspaces,
-                workspace_manager->starting_corner);
+  meta_verbose (
+    "Workspace layout rows = %d cols = %d orientation = %d starting corner = %u\n",
+    workspace_manager->rows_of_workspaces,
+    workspace_manager->columns_of_workspaces,
+    workspace_manager->vertical_workspaces,
+    workspace_manager->starting_corner);
 }
 
 /**
  * meta_workspace_manager_override_workspace_layout:
  * @workspace_manager: a #MetaWorkspaceManager
  * @starting_corner: the corner at which the first workspace is found
- * @vertical_layout: if %TRUE the workspaces are laid out in columns rather than rows
- * @n_rows: number of rows of workspaces, or -1 to determine the number of rows from
+ * @vertical_layout: if %TRUE the workspaces are laid out in columns rather than
+ *rows
+ * @n_rows: number of rows of workspaces, or -1 to determine the number of rows
+ *from
  *   @n_columns and the total number of workspaces
- * @n_columns: number of columns of workspaces, or -1 to determine the number of columns from
+ * @n_columns: number of columns of workspaces, or -1 to determine the number of
+ *columns from
  *   @n_rows and the total number of workspaces
  *
- * Explicitly set the layout of workspaces. Once this has been called, the contents of the
+ * Explicitly set the layout of workspaces. Once this has been called, the
+ *contents of the
  * _NET_DESKTOP_LAYOUT property on the root window are completely ignored.
  */
 void
-meta_workspace_manager_override_workspace_layout (MetaWorkspaceManager *workspace_manager,
-                                                  MetaDisplayCorner     starting_corner,
-                                                  gboolean              vertical_layout,
-                                                  int                   n_rows,
-                                                  int                   n_columns)
+meta_workspace_manager_override_workspace_layout (
+  MetaWorkspaceManager *workspace_manager,
+  MetaDisplayCorner     starting_corner,
+  gboolean              vertical_layout,
+  int                   n_rows,
+  int                   n_columns)
 {
   workspace_manager->workspace_layout_overridden = FALSE;
 
@@ -527,10 +548,11 @@ meta_workspace_manager_corner_to_string (MetaDisplayCorner corner)
 #endif /* WITH_VERBOSE_MODE */
 
 void
-meta_workspace_manager_calc_workspace_layout (MetaWorkspaceManager *workspace_manager,
-                                              int                   num_workspaces,
-                                              int                   current_space,
-                                              MetaWorkspaceLayout  *layout)
+meta_workspace_manager_calc_workspace_layout (
+  MetaWorkspaceManager *workspace_manager,
+  int                   num_workspaces,
+  int                   current_space,
+  MetaWorkspaceLayout  *layout)
 {
   int rows, cols;
   int grid_area;
@@ -562,7 +584,8 @@ meta_workspace_manager_calc_workspace_layout (MetaWorkspaceManager *workspace_ma
                 "num_spaces = %d vertical = %s corner = %s\n",
                 rows, cols, current_space, num_workspaces,
                 workspace_manager->vertical_workspaces ? "(true)" : "(false)",
-                meta_workspace_manager_corner_to_string (workspace_manager->starting_corner));
+                meta_workspace_manager_corner_to_string (workspace_manager->
+                                                         starting_corner));
 
   /* ok, we want to setup the distances in the workspace array to go
    * in each direction. Remember, there are many ways that a workspace
@@ -614,7 +637,7 @@ meta_workspace_manager_calc_workspace_layout (MetaWorkspaceManager *workspace_ma
               r = 0;
               while (r < rows)
                 {
-                  grid[r*cols+c] = i;
+                  grid[r * cols + c] = i;
                   ++i;
                   ++r;
                 }
@@ -629,7 +652,7 @@ meta_workspace_manager_calc_workspace_layout (MetaWorkspaceManager *workspace_ma
               c = 0;
               while (c < cols)
                 {
-                  grid[r*cols+c] = i;
+                  grid[r * cols + c] = i;
                   ++i;
                   ++c;
                 }
@@ -646,7 +669,7 @@ meta_workspace_manager_calc_workspace_layout (MetaWorkspaceManager *workspace_ma
               r = 0;
               while (r < rows)
                 {
-                  grid[r*cols+c] = i;
+                  grid[r * cols + c] = i;
                   ++i;
                   ++r;
                 }
@@ -661,7 +684,7 @@ meta_workspace_manager_calc_workspace_layout (MetaWorkspaceManager *workspace_ma
               c = cols - 1;
               while (c >= 0)
                 {
-                  grid[r*cols+c] = i;
+                  grid[r * cols + c] = i;
                   ++i;
                   --c;
                 }
@@ -678,7 +701,7 @@ meta_workspace_manager_calc_workspace_layout (MetaWorkspaceManager *workspace_ma
               r = rows - 1;
               while (r >= 0)
                 {
-                  grid[r*cols+c] = i;
+                  grid[r * cols + c] = i;
                   ++i;
                   --r;
                 }
@@ -693,7 +716,7 @@ meta_workspace_manager_calc_workspace_layout (MetaWorkspaceManager *workspace_ma
               c = 0;
               while (c < cols)
                 {
-                  grid[r*cols+c] = i;
+                  grid[r * cols + c] = i;
                   ++i;
                   ++c;
                 }
@@ -710,7 +733,7 @@ meta_workspace_manager_calc_workspace_layout (MetaWorkspaceManager *workspace_ma
               r = rows - 1;
               while (r >= 0)
                 {
-                  grid[r*cols+c] = i;
+                  grid[r * cols + c] = i;
                   ++i;
                   --r;
                 }
@@ -725,7 +748,7 @@ meta_workspace_manager_calc_workspace_layout (MetaWorkspaceManager *workspace_ma
               c = cols - 1;
               while (c >= 0)
                 {
-                  grid[r*cols+c] = i;
+                  grid[r * cols + c] = i;
                   ++i;
                   --c;
                 }
@@ -747,15 +770,15 @@ meta_workspace_manager_calc_workspace_layout (MetaWorkspaceManager *workspace_ma
       c = 0;
       while (c < cols)
         {
-          if (grid[r*cols+c] == current_space)
+          if (grid[r * cols + c] == current_space)
             {
               current_row = r;
               current_col = c;
             }
-          else if (grid[r*cols+c] >= num_workspaces)
+          else if (grid[r * cols + c] >= num_workspaces)
             {
               /* flag nonexistent spaces with -1 */
-              grid[r*cols+c] = -1;
+              grid[r * cols + c] = -1;
             }
           ++c;
         }
@@ -782,9 +805,9 @@ meta_workspace_manager_calc_workspace_layout (MetaWorkspaceManager *workspace_ma
             {
               if (r == layout->current_row &&
                   c == layout->current_col)
-                meta_verbose ("*%2d ", layout->grid[r*layout->cols+c]);
+                meta_verbose ("*%2d ", layout->grid[r * layout->cols + c]);
               else
-                meta_verbose ("%3d ", layout->grid[r*layout->cols+c]);
+                meta_verbose ("%3d ", layout->grid[r * layout->cols + c]);
               ++c;
             }
           meta_verbose ("\n");
@@ -810,7 +833,8 @@ queue_windows_showing (MetaWorkspaceManager *workspace_manager)
    * active_workspace's window list, because the active_workspace's
    * window list may not contain the on_all_workspace windows.
    */
-  windows = meta_display_list_windows (workspace_manager->display, META_LIST_DEFAULT);
+  windows = meta_display_list_windows (workspace_manager->display,
+                                       META_LIST_DEFAULT);
 
   for (l = windows; l; l = l->next)
     {
@@ -823,8 +847,9 @@ queue_windows_showing (MetaWorkspaceManager *workspace_manager)
 }
 
 void
-meta_workspace_manager_minimize_all_on_active_workspace_except (MetaWorkspaceManager *workspace_manager,
-                                                                MetaWindow           *keep)
+meta_workspace_manager_minimize_all_on_active_workspace_except (
+  MetaWorkspaceManager *workspace_manager,
+  MetaWindow           *keep)
 {
   GList *l;
 
@@ -888,7 +913,8 @@ meta_workspace_manager_unshow_desktop (MetaWorkspaceManager *workspace_manager)
  * meta_workspace_manager_get_workspaces: (skip)
  * @workspace_manager: a #MetaWorkspaceManager
  *
- * Returns: (transfer none) (element-type Meta.Workspace): The workspaces for @display
+ * Returns: (transfer none) (element-type Meta.Workspace): The workspaces for
+ *@display
  */
 GList *
 meta_workspace_manager_get_workspaces (MetaWorkspaceManager *workspace_manager)
@@ -897,7 +923,8 @@ meta_workspace_manager_get_workspaces (MetaWorkspaceManager *workspace_manager)
 }
 
 int
-meta_workspace_manager_get_active_workspace_index (MetaWorkspaceManager *workspace_manager)
+meta_workspace_manager_get_active_workspace_index (
+  MetaWorkspaceManager *workspace_manager)
 {
   MetaWorkspace *active = workspace_manager->active_workspace;
 
@@ -914,16 +941,18 @@ meta_workspace_manager_get_active_workspace_index (MetaWorkspaceManager *workspa
  * Returns: (transfer none): The current workspace
  */
 MetaWorkspace *
-meta_workspace_manager_get_active_workspace (MetaWorkspaceManager *workspace_manager)
+meta_workspace_manager_get_active_workspace (
+  MetaWorkspaceManager *workspace_manager)
 {
   return workspace_manager->active_workspace;
 }
 
-void 
-meta_workspace_manager_workspace_switched (MetaWorkspaceManager *workspace_manager,
-                                           int                   from,
-                                           int                   to,
-                                           MetaMotionDirection   direction)
+void
+meta_workspace_manager_workspace_switched (
+  MetaWorkspaceManager *workspace_manager,
+  int                   from,
+  int                   to,
+  MetaMotionDirection   direction)
 {
   g_signal_emit (workspace_manager,
                  workspace_manager_signals[WORKSPACE_SWITCHED], 0,
diff --git a/src/core/mutter.c b/src/core/mutter.c
index 389d99199..2b48d26b9 100644
--- a/src/core/mutter.c
+++ b/src/core/mutter.c
@@ -28,10 +28,10 @@
 #include "meta/util.h"
 
 static gboolean
-print_version (const gchar    *option_name,
-               const gchar    *value,
-               gpointer        data,
-               GError        **error)
+print_version (const gchar *option_name,
+               const gchar *value,
+               gpointer     data,
+               GError     **error)
 {
   const int latest_year = 2011;
 
@@ -45,7 +45,8 @@ print_version (const gchar    *option_name,
 
 static const char *plugin = "libdefault";
 
-GOptionEntry mutter_options[] = {
+GOptionEntry mutter_options[] =
+{
   {
     "version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
     print_version,
diff --git a/src/core/place.c b/src/core/place.c
index 82c3a7b9e..fe10d89f3 100644
--- a/src/core/place.c
+++ b/src/core/place.c
@@ -150,24 +150,25 @@ find_next_cascade (MetaWindow *window,
         {
           meta_window_get_titlebar_rect (w, &titlebar_rect);
 
-          /* Cascade the window evenly by the titlebar height; this isn't a typo. */
+          /* Cascade the window evenly by the titlebar height; this isn't a
+           * typo. */
           cascade_x = wx + titlebar_rect.height;
           cascade_y = wy + titlebar_rect.height;
 
           /* If we go off the screen, start over with a new cascade */
-         if (((cascade_x + window_width) >
+          if (((cascade_x + window_width) >
                (work_area.x + work_area.width)) ||
               ((cascade_y + window_height) >
-              (work_area.y + work_area.height)))
-           {
-             cascade_x = MAX (0, work_area.x);
-             cascade_y = MAX (0, work_area.y);
+               (work_area.y + work_area.height)))
+            {
+              cascade_x = MAX (0, work_area.x);
+              cascade_y = MAX (0, work_area.y);
 
 #define CASCADE_INTERVAL 50 /* space between top-left corners of cascades */
               cascade_stage += 1;
-             cascade_x += CASCADE_INTERVAL * cascade_stage;
+              cascade_x += CASCADE_INTERVAL * cascade_stage;
 
-             /* start over with a new cascade translated to the right, unless
+              /* start over with a new cascade translated to the right, unless
                * we are out of space
                */
               if ((cascade_x + window_width) <
@@ -182,7 +183,7 @@ find_next_cascade (MetaWindow *window,
                   cascade_x = MAX (0, work_area.x);
                   break;
                 }
-           }
+            }
         }
       else
         {
@@ -224,34 +225,34 @@ find_most_freespace (MetaWindow *window,
   meta_window_get_frame_rect (window, &frame_rect);
 
   /* Find the areas of choosing the various sides of the focus window */
-  max_width  = MIN (avoid.width, frame_rect.width);
+  max_width = MIN (avoid.width, frame_rect.width);
   max_height = MIN (avoid.height, frame_rect.height);
-  left_space   = avoid.x - work_area.x;
-  right_space  = work_area.width - (avoid.x + avoid.width - work_area.x);
-  top_space    = avoid.y - work_area.y;
+  left_space = avoid.x - work_area.x;
+  right_space = work_area.width - (avoid.x + avoid.width - work_area.x);
+  top_space = avoid.y - work_area.y;
   bottom_space = work_area.height - (avoid.y + avoid.height - work_area.y);
-  left   = MIN (left_space,   frame_rect.width);
-  right  = MIN (right_space,  frame_rect.width);
-  top    = MIN (top_space,    frame_rect.height);
+  left = MIN (left_space, frame_rect.width);
+  right = MIN (right_space, frame_rect.width);
+  top = MIN (top_space, frame_rect.height);
   bottom = MIN (bottom_space, frame_rect.height);
 
   /* Find out which side of the focus_window can show the most of the window */
   side = META_LEFT;
-  max_area = left*max_height;
-  if (right*max_height > max_area)
+  max_area = left * max_height;
+  if (right * max_height > max_area)
     {
       side = META_RIGHT;
-      max_area = right*max_height;
+      max_area = right * max_height;
     }
-  if (top*max_width > max_area)
+  if (top * max_width > max_area)
     {
       side = META_TOP;
-      max_area = top*max_width;
+      max_area = top * max_width;
     }
-  if (bottom*max_width > max_area)
+  if (bottom * max_width > max_area)
     {
       side = META_BOTTOM;
-      max_area = bottom*max_width;
+      max_area = bottom * max_width;
     }
 
   /* Give up if there's no where to put it (i.e. focus window is maximized) */
@@ -321,9 +322,9 @@ window_place_centered (MetaWindow *window)
   type = window->type;
 
   return (type == META_WINDOW_DIALOG ||
-    type == META_WINDOW_MODAL_DIALOG ||
-    type == META_WINDOW_SPLASHSCREEN ||
-    (type == META_WINDOW_NORMAL && meta_prefs_get_center_new_windows ()));
+          type == META_WINDOW_MODAL_DIALOG ||
+          type == META_WINDOW_SPLASHSCREEN ||
+          (type == META_WINDOW_NORMAL && meta_prefs_get_center_new_windows ()));
 }
 
 static void
@@ -385,14 +386,14 @@ rectangle_overlaps_some_window (MetaRectangle *rect,
         case META_WINDOW_DESKTOP:
         case META_WINDOW_DIALOG:
         case META_WINDOW_MODAL_DIALOG:
-       /* override redirect window types: */
-       case META_WINDOW_DROPDOWN_MENU:
-       case META_WINDOW_POPUP_MENU:
-       case META_WINDOW_TOOLTIP:
-       case META_WINDOW_NOTIFICATION:
-       case META_WINDOW_COMBO:
-       case META_WINDOW_DND:
-       case META_WINDOW_OVERRIDE_OTHER:
+        /* override redirect window types: */
+        case META_WINDOW_DROPDOWN_MENU:
+        case META_WINDOW_POPUP_MENU:
+        case META_WINDOW_TOOLTIP:
+        case META_WINDOW_NOTIFICATION:
+        case META_WINDOW_COMBO:
+        case META_WINDOW_DND:
+        case META_WINDOW_OVERRIDE_OTHER:
           break;
 
         case META_WINDOW_NORMAL:
@@ -468,9 +469,9 @@ center_tile_rect_in_area (MetaRectangle *rect,
    * as a group)
    */
 
-  fluff = (work_area->width % (rect->width+1)) / 2;
+  fluff = (work_area->width % (rect->width + 1)) / 2;
   rect->x = work_area->x + fluff;
-  fluff = (work_area->height % (rect->height+1)) / 3;
+  fluff = (work_area->height % (rect->height + 1)) / 3;
   rect->y = work_area->y + fluff;
 }
 
@@ -601,7 +602,7 @@ find_first_fit (MetaWindow         *window,
       tmp = tmp->next;
     }
 
- out:
+out:
   g_list_free (below_sorted);
   g_list_free (right_sorted);
   return retval;
@@ -663,11 +664,11 @@ meta_window_process_placement (MetaWindow        *window,
 }
 
 void
-meta_window_place (MetaWindow        *window,
-                   int                x,
-                   int                y,
-                   int               *new_x,
-                   int               *new_y)
+meta_window_place (MetaWindow *window,
+                   int         x,
+                   int         y,
+                   int        *new_x,
+                   int        *new_y)
 {
   MetaBackend *backend = meta_get_backend ();
   GList *windows = NULL;
@@ -687,16 +688,16 @@ meta_window_place (MetaWindow        *window,
 
   switch (window->type)
     {
-      /* Run placement algorithm on these. */
+    /* Run placement algorithm on these. */
     case META_WINDOW_NORMAL:
     case META_WINDOW_DIALOG:
     case META_WINDOW_MODAL_DIALOG:
     case META_WINDOW_SPLASHSCREEN:
       break;
 
-      /* Assume the app knows best how to place these, no placement
-       * algorithm ever (other than "leave them as-is")
-       */
+    /* Assume the app knows best how to place these, no placement
+     * algorithm ever (other than "leave them as-is")
+     */
     case META_WINDOW_DESKTOP:
     case META_WINDOW_DOCK:
     case META_WINDOW_TOOLBAR:
@@ -717,40 +718,41 @@ meta_window_place (MetaWindow        *window,
     {
       switch (window->type)
         {
-          /* Only accept USPosition on normal windows because the app is full
-           * of shit claiming the user set -geometry for a dialog or dock
-           */
+        /* Only accept USPosition on normal windows because the app is full
+         * of shit claiming the user set -geometry for a dialog or dock
+         */
         case META_WINDOW_NORMAL:
           if (window->size_hints.flags & USPosition)
             {
               /* don't constrain with placement algorithm */
               meta_topic (META_DEBUG_PLACEMENT,
-                          "Honoring USPosition for %s instead of using placement algorithm\n", window->desc);
+                          "Honoring USPosition for %s instead of using placement algorithm\n",
+                          window->desc);
 
               goto done;
             }
           break;
 
-          /* Ignore even USPosition on dialogs, splashscreen */
+        /* Ignore even USPosition on dialogs, splashscreen */
         case META_WINDOW_DIALOG:
         case META_WINDOW_MODAL_DIALOG:
         case META_WINDOW_SPLASHSCREEN:
           break;
 
-          /* Assume the app knows best how to place these. */
+        /* Assume the app knows best how to place these. */
         case META_WINDOW_DESKTOP:
         case META_WINDOW_DOCK:
         case META_WINDOW_TOOLBAR:
         case META_WINDOW_MENU:
         case META_WINDOW_UTILITY:
-       /* override redirect window types: */
-       case META_WINDOW_DROPDOWN_MENU:
-       case META_WINDOW_POPUP_MENU:
-       case META_WINDOW_TOOLTIP:
-       case META_WINDOW_NOTIFICATION:
-       case META_WINDOW_COMBO:
-       case META_WINDOW_DND:
-       case META_WINDOW_OVERRIDE_OTHER:
+        /* override redirect window types: */
+        case META_WINDOW_DROPDOWN_MENU:
+        case META_WINDOW_POPUP_MENU:
+        case META_WINDOW_TOOLTIP:
+        case META_WINDOW_NOTIFICATION:
+        case META_WINDOW_COMBO:
+        case META_WINDOW_DND:
+        case META_WINDOW_OVERRIDE_OTHER:
           if (window->size_hints.flags & PPosition)
             {
               meta_topic (META_DEBUG_PLACEMENT,
@@ -796,9 +798,10 @@ meta_window_place (MetaWindow        *window,
           /* "visually" center window over parent, leaving twice as
            * much space below as on top.
            */
-          y += (parent_frame_rect.height - frame_rect.height)/3;
+          y += (parent_frame_rect.height - frame_rect.height) / 3;
 
-          meta_topic (META_DEBUG_PLACEMENT, "Centered window %s over transient parent\n",
+          meta_topic (META_DEBUG_PLACEMENT,
+                      "Centered window %s over transient parent\n",
                       window->desc);
 
           avoid_being_obscured_as_second_modal_dialog (window, &x, &y);
@@ -845,7 +848,8 @@ meta_window_place (MetaWindow        *window,
     GSList *all_windows;
     GSList *tmp;
 
-    all_windows = meta_display_list_windows (window->display, META_LIST_DEFAULT);
+    all_windows =
+      meta_display_list_windows (window->display, META_LIST_DEFAULT);
 
     tmp = all_windows;
     while (tmp != NULL)
@@ -885,7 +889,8 @@ meta_window_place (MetaWindow        *window,
       /* If the window is bigger than the screen, then automaximize.  Do NOT
        * auto-maximize the directions independently.  See #419810.
        */
-      if (frame_rect.width >= workarea.width && frame_rect.height >= workarea.height)
+      if (frame_rect.width >= workarea.width &&
+          frame_rect.height >= workarea.height)
         {
           window->maximize_horizontally_after_placement = TRUE;
           window->maximize_vertically_after_placement = TRUE;
@@ -904,7 +909,7 @@ meta_window_place (MetaWindow        *window,
   /* No good fit? Fall back to cascading... */
   find_next_cascade (window, windows, x, y, &x, &y);
 
- done_check_denied_focus:
+done_check_denied_focus:
   /* If the window is being denied focus and isn't a transient of the
    * focus window, we do NOT want it to overlap with the focus window
    * if at all possible.  This is guaranteed to only be called if the
@@ -912,8 +917,8 @@ meta_window_place (MetaWindow        *window,
    */
   if (window->denied_focus_and_not_transient)
     {
-      MetaWindow    *focus_window;
-      gboolean       found_fit;
+      MetaWindow *focus_window;
+      gboolean found_fit;
 
       focus_window = window->display->focus_window;
       g_assert (focus_window != NULL);
@@ -937,7 +942,7 @@ meta_window_place (MetaWindow        *window,
                                       logical_monitor,
                                       x, y, &x, &y);
           g_list_free (focus_window_list);
-       }
+        }
 
       /* If that still didn't work, just place it where we can see as much
        * as possible.
@@ -946,7 +951,7 @@ meta_window_place (MetaWindow        *window,
         find_most_freespace (window, focus_window, x, y, &x, &y);
     }
 
- done:
+done:
   if (windows)
     g_list_free (windows);
 
diff --git a/src/core/prefs.c b/src/core/prefs.c
index 8340de3ad..f3dbffb69 100644
--- a/src/core/prefs.c
+++ b/src/core/prefs.c
@@ -82,14 +82,18 @@ static PangoFontDescription *titlebar_font = NULL;
 static MetaVirtualModifier mouse_button_mods = Mod1Mask;
 static MetaKeyCombo overlay_key_combo = { 0, 0, 0 };
 static GDesktopFocusMode focus_mode = G_DESKTOP_FOCUS_MODE_CLICK;
-static GDesktopFocusNewWindows focus_new_windows = G_DESKTOP_FOCUS_NEW_WINDOWS_SMART;
+static GDesktopFocusNewWindows focus_new_windows =
+  G_DESKTOP_FOCUS_NEW_WINDOWS_SMART;
 static gboolean raise_on_click = TRUE;
 static gboolean center_new_windows = FALSE;
 static gboolean attach_modal_dialogs = FALSE;
 static int num_workspaces = 4;
-static GDesktopTitlebarAction action_double_click_titlebar = G_DESKTOP_TITLEBAR_ACTION_TOGGLE_MAXIMIZE;
-static GDesktopTitlebarAction action_middle_click_titlebar = G_DESKTOP_TITLEBAR_ACTION_LOWER;
-static GDesktopTitlebarAction action_right_click_titlebar = G_DESKTOP_TITLEBAR_ACTION_MENU;
+static GDesktopTitlebarAction action_double_click_titlebar =
+  G_DESKTOP_TITLEBAR_ACTION_TOGGLE_MAXIMIZE;
+static GDesktopTitlebarAction action_middle_click_titlebar =
+  G_DESKTOP_TITLEBAR_ACTION_LOWER;
+static GDesktopTitlebarAction action_right_click_titlebar =
+  G_DESKTOP_TITLEBAR_ACTION_MENU;
 static gboolean dynamic_workspaces = FALSE;
 static gboolean disable_workarounds = FALSE;
 static gboolean auto_raise = FALSE;
@@ -104,9 +108,9 @@ static char *cursor_theme = NULL;
  * actual cursor size, multiplied with the global window scaling factor. On
  * Wayland, it will be the actual cursor size retrieved from gsettings.
  */
-static int   cursor_size = 24;
-static int   draggable_border_width = 10;
-static int   drag_threshold;
+static int cursor_size = 24;
+static int draggable_border_width = 10;
+static int drag_threshold;
 static gboolean resize_with_right_button = FALSE;
 static gboolean edge_tiling = FALSE;
 static gboolean force_fullscreen = TRUE;
@@ -114,7 +118,8 @@ static gboolean ignore_request_hide_titlebar = FALSE;
 static gboolean auto_maximize = TRUE;
 static gboolean show_fallback_app_menu = FALSE;
 
-static GDesktopVisualBellType visual_bell_type = G_DESKTOP_VISUAL_BELL_FULLSCREEN_FLASH;
+static GDesktopVisualBellType visual_bell_type =
+  G_DESKTOP_VISUAL_BELL_FULLSCREEN_FLASH;
 static MetaButtonLayout button_layout;
 
 /* NULL-terminated array */
@@ -126,29 +131,29 @@ static char *iso_next_group_option = NULL;
 
 static void handle_preference_update_enum (GSettings *settings,
                                            gchar     *key);
-static gboolean update_binding         (MetaKeyPref *binding,
-                                        gchar      **strokes);
-static gboolean update_key_binding     (const char  *key,
-                                        gchar      **strokes);
+static gboolean update_binding (MetaKeyPref *binding,
+                                gchar      **strokes);
+static gboolean update_key_binding (const char *key,
+                                    gchar     **strokes);
 
-static void settings_changed (GSettings      *settings,
-                              gchar          *key,
-                              gpointer        data);
-static void bindings_changed (GSettings      *settings,
-                              gchar          *key,
-                              gpointer        data);
+static void settings_changed (GSettings *settings,
+                              gchar     *key,
+                              gpointer   data);
+static void bindings_changed (GSettings *settings,
+                              gchar     *key,
+                              gpointer   data);
 
-static void queue_changed (MetaPreference  pref);
+static void queue_changed (MetaPreference pref);
 
 static void maybe_give_disable_workarounds_warning (void);
 
-static gboolean titlebar_handler (GVariant*, gpointer*, gpointer);
-static gboolean mouse_button_mods_handler (GVariant*, gpointer*, gpointer);
-static gboolean button_layout_handler (GVariant*, gpointer*, gpointer);
-static gboolean overlay_key_handler (GVariant*, gpointer*, gpointer);
-static gboolean iso_next_group_handler (GVariant*, gpointer*, gpointer);
+static gboolean titlebar_handler (GVariant *, gpointer *, gpointer);
+static gboolean mouse_button_mods_handler (GVariant *, gpointer *, gpointer);
+static gboolean button_layout_handler (GVariant *, gpointer *, gpointer);
+static gboolean overlay_key_handler (GVariant *, gpointer *, gpointer);
+static gboolean iso_next_group_handler (GVariant *, gpointer *, gpointer);
 
-static void     init_bindings             (void);
+static void     init_bindings (void);
 
 typedef struct
 {
@@ -223,274 +228,241 @@ typedef struct
 /* @@@ Don't use NULL lines at the end; glib can tell you how big it is */
 
 static MetaEnumPreference preferences_enum[] =
+{
   {
-    {
-      { "focus-new-windows",
-        SCHEMA_GENERAL,
-        META_PREF_FOCUS_NEW_WINDOWS,
-      },
-      &focus_new_windows,
-    },
-    {
-      { "focus-mode",
-        SCHEMA_GENERAL,
-        META_PREF_FOCUS_MODE,
-      },
-      &focus_mode,
-    },
-    {
-      { "visual-bell-type",
-        SCHEMA_GENERAL,
-        META_PREF_VISUAL_BELL_TYPE,
-      },
-      &visual_bell_type,
-    },
-    {
-      { "action-double-click-titlebar",
-        SCHEMA_GENERAL,
-        META_PREF_ACTION_DOUBLE_CLICK_TITLEBAR,
-      },
-      &action_double_click_titlebar,
-    },
-    {
-      { "action-middle-click-titlebar",
-        SCHEMA_GENERAL,
-        META_PREF_ACTION_MIDDLE_CLICK_TITLEBAR,
-      },
-      &action_middle_click_titlebar,
-    },
-    {
-      { "action-right-click-titlebar",
-        SCHEMA_GENERAL,
-        META_PREF_ACTION_RIGHT_CLICK_TITLEBAR,
-      },
-      &action_right_click_titlebar,
-    },
-    { { NULL, 0, 0 }, NULL },
-  };
+    { "focus-new-windows",
+      SCHEMA_GENERAL,
+      META_PREF_FOCUS_NEW_WINDOWS, },
+    &focus_new_windows,
+  },
+  {
+    { "focus-mode",
+      SCHEMA_GENERAL,
+      META_PREF_FOCUS_MODE, },
+    &focus_mode,
+  },
+  {
+    { "visual-bell-type",
+      SCHEMA_GENERAL,
+      META_PREF_VISUAL_BELL_TYPE, },
+    &visual_bell_type,
+  },
+  {
+    { "action-double-click-titlebar",
+      SCHEMA_GENERAL,
+      META_PREF_ACTION_DOUBLE_CLICK_TITLEBAR, },
+    &action_double_click_titlebar,
+  },
+  {
+    { "action-middle-click-titlebar",
+      SCHEMA_GENERAL,
+      META_PREF_ACTION_MIDDLE_CLICK_TITLEBAR, },
+    &action_middle_click_titlebar,
+  },
+  {
+    { "action-right-click-titlebar",
+      SCHEMA_GENERAL,
+      META_PREF_ACTION_RIGHT_CLICK_TITLEBAR, },
+    &action_right_click_titlebar,
+  },
+  { { NULL, 0, 0 }, NULL },
+};
 
 static MetaBoolPreference preferences_bool[] =
+{
   {
-    {
-      { "attach-modal-dialogs",
-        SCHEMA_MUTTER,
-        META_PREF_ATTACH_MODAL_DIALOGS,
-      },
-      &attach_modal_dialogs,
-    },
-    {
-      { "center-new-windows",
-        SCHEMA_MUTTER,
-        META_PREF_CENTER_NEW_WINDOWS,
-      },
-      &center_new_windows,
-    },
-    {
-      { "raise-on-click",
-        SCHEMA_GENERAL,
-        META_PREF_RAISE_ON_CLICK,
-      },
-      &raise_on_click,
-    },
-    {
-      { "titlebar-uses-system-font",
-        SCHEMA_GENERAL,
-        META_PREF_TITLEBAR_FONT, /* note! shares a pref */
-      },
-      &use_system_font,
-    },
-    {
-      { "dynamic-workspaces",
-        SCHEMA_MUTTER,
-        META_PREF_DYNAMIC_WORKSPACES,
-      },
-      &dynamic_workspaces,
-    },
-    {
-      { "disable-workarounds",
-        SCHEMA_GENERAL,
-        META_PREF_DISABLE_WORKAROUNDS,
-      },
-      &disable_workarounds,
-    },
-    {
-      { "auto-raise",
-        SCHEMA_GENERAL,
-        META_PREF_AUTO_RAISE,
-      },
-      &auto_raise,
-    },
-    {
-      { "focus-change-on-pointer-rest",
-        SCHEMA_MUTTER,
-        META_PREF_FOCUS_CHANGE_ON_POINTER_REST,
-      },
-      &focus_change_on_pointer_rest
-    },
-    {
-      { "visual-bell",
-        SCHEMA_GENERAL,
-        META_PREF_VISUAL_BELL,
-      },
-      &bell_is_visible, /* FIXME: change the name: it's confusing */
-    },
-    {
-      { "audible-bell",
-        SCHEMA_GENERAL,
-        META_PREF_AUDIBLE_BELL,
-      },
-      &bell_is_audible, /* FIXME: change the name: it's confusing */
-    },
-    {
-      { KEY_GNOME_ACCESSIBILITY,
-        SCHEMA_INTERFACE,
-        META_PREF_GNOME_ACCESSIBILITY,
-      },
-      &gnome_accessibility,
-    },
-    {
-      { KEY_GNOME_ANIMATIONS,
-        SCHEMA_INTERFACE,
-        META_PREF_GNOME_ANIMATIONS,
-      },
-      &gnome_animations,
-    },
-    {
-      { "resize-with-right-button",
-        SCHEMA_GENERAL,
-        META_PREF_RESIZE_WITH_RIGHT_BUTTON,
-      },
-      &resize_with_right_button,
-    },
-    {
-      { "edge-tiling",
-        SCHEMA_MUTTER,
-        META_PREF_EDGE_TILING,
-      },
-      &edge_tiling,
-    },
-    {
-      { "workspaces-only-on-primary",
-        SCHEMA_MUTTER,
-        META_PREF_WORKSPACES_ONLY_ON_PRIMARY,
-      },
-      &workspaces_only_on_primary,
-    },
-    {
-      { "auto-maximize",
-        SCHEMA_MUTTER,
-        META_PREF_AUTO_MAXIMIZE,
-      },
-      &auto_maximize,
+    { "attach-modal-dialogs",
+      SCHEMA_MUTTER,
+      META_PREF_ATTACH_MODAL_DIALOGS, },
+    &attach_modal_dialogs,
+  },
+  {
+    { "center-new-windows",
+      SCHEMA_MUTTER,
+      META_PREF_CENTER_NEW_WINDOWS, },
+    &center_new_windows,
+  },
+  {
+    { "raise-on-click",
+      SCHEMA_GENERAL,
+      META_PREF_RAISE_ON_CLICK, },
+    &raise_on_click,
+  },
+  {
+    { "titlebar-uses-system-font",
+      SCHEMA_GENERAL,
+      META_PREF_TITLEBAR_FONT,   /* note! shares a pref */
     },
-    { { NULL, 0, 0 }, NULL },
-  };
+    &use_system_font,
+  },
+  {
+    { "dynamic-workspaces",
+      SCHEMA_MUTTER,
+      META_PREF_DYNAMIC_WORKSPACES, },
+    &dynamic_workspaces,
+  },
+  {
+    { "disable-workarounds",
+      SCHEMA_GENERAL,
+      META_PREF_DISABLE_WORKAROUNDS, },
+    &disable_workarounds,
+  },
+  {
+    { "auto-raise",
+      SCHEMA_GENERAL,
+      META_PREF_AUTO_RAISE, },
+    &auto_raise,
+  },
+  {
+    { "focus-change-on-pointer-rest",
+      SCHEMA_MUTTER,
+      META_PREF_FOCUS_CHANGE_ON_POINTER_REST, },
+    &focus_change_on_pointer_rest
+  },
+  {
+    { "visual-bell",
+      SCHEMA_GENERAL,
+      META_PREF_VISUAL_BELL, },
+    &bell_is_visible,   /* FIXME: change the name: it's confusing */
+  },
+  {
+    { "audible-bell",
+      SCHEMA_GENERAL,
+      META_PREF_AUDIBLE_BELL, },
+    &bell_is_audible,   /* FIXME: change the name: it's confusing */
+  },
+  {
+    { KEY_GNOME_ACCESSIBILITY,
+      SCHEMA_INTERFACE,
+      META_PREF_GNOME_ACCESSIBILITY, },
+    &gnome_accessibility,
+  },
+  {
+    { KEY_GNOME_ANIMATIONS,
+      SCHEMA_INTERFACE,
+      META_PREF_GNOME_ANIMATIONS, },
+    &gnome_animations,
+  },
+  {
+    { "resize-with-right-button",
+      SCHEMA_GENERAL,
+      META_PREF_RESIZE_WITH_RIGHT_BUTTON, },
+    &resize_with_right_button,
+  },
+  {
+    { "edge-tiling",
+      SCHEMA_MUTTER,
+      META_PREF_EDGE_TILING, },
+    &edge_tiling,
+  },
+  {
+    { "workspaces-only-on-primary",
+      SCHEMA_MUTTER,
+      META_PREF_WORKSPACES_ONLY_ON_PRIMARY, },
+    &workspaces_only_on_primary,
+  },
+  {
+    { "auto-maximize",
+      SCHEMA_MUTTER,
+      META_PREF_AUTO_MAXIMIZE, },
+    &auto_maximize,
+  },
+  { { NULL, 0, 0 }, NULL },
+};
 
 static MetaStringPreference preferences_string[] =
+{
   {
-    {
-      { "mouse-button-modifier",
-        SCHEMA_GENERAL,
-        META_PREF_MOUSE_BUTTON_MODS,
-      },
-      mouse_button_mods_handler,
-      NULL,
-    },
-    {
-      { KEY_TITLEBAR_FONT,
-        SCHEMA_GENERAL,
-        META_PREF_TITLEBAR_FONT,
-      },
-      titlebar_handler,
-      NULL,
-    },
-    {
-      { "button-layout",
-        SCHEMA_GENERAL,
-        META_PREF_BUTTON_LAYOUT,
-      },
-      button_layout_handler,
-      NULL,
-    },
-    {
-      { "cursor-theme",
-        SCHEMA_INTERFACE,
-        META_PREF_CURSOR_THEME,
-      },
-      NULL,
-      &cursor_theme,
-    },
-    {
-      { "overlay-key",
-        SCHEMA_MUTTER,
-        META_PREF_KEYBINDINGS,
-      },
-      overlay_key_handler,
-      NULL,
-    },
-    { { NULL, 0, 0 }, NULL },
-  };
+    { "mouse-button-modifier",
+      SCHEMA_GENERAL,
+      META_PREF_MOUSE_BUTTON_MODS, },
+    mouse_button_mods_handler,
+    NULL,
+  },
+  {
+    { KEY_TITLEBAR_FONT,
+      SCHEMA_GENERAL,
+      META_PREF_TITLEBAR_FONT, },
+    titlebar_handler,
+    NULL,
+  },
+  {
+    { "button-layout",
+      SCHEMA_GENERAL,
+      META_PREF_BUTTON_LAYOUT, },
+    button_layout_handler,
+    NULL,
+  },
+  {
+    { "cursor-theme",
+      SCHEMA_INTERFACE,
+      META_PREF_CURSOR_THEME, },
+    NULL,
+    &cursor_theme,
+  },
+  {
+    { "overlay-key",
+      SCHEMA_MUTTER,
+      META_PREF_KEYBINDINGS, },
+    overlay_key_handler,
+    NULL,
+  },
+  { { NULL, 0, 0 }, NULL },
+};
 
 static MetaStringArrayPreference preferences_string_array[] =
+{
   {
-    {
-      { KEY_WORKSPACE_NAMES,
-        SCHEMA_GENERAL,
-        META_PREF_WORKSPACE_NAMES,
-      },
-      NULL,
-      &workspace_names,
-    },
-    {
-      { KEY_XKB_OPTIONS,
-        SCHEMA_INPUT_SOURCES,
-        META_PREF_KEYBINDINGS,
-      },
-      iso_next_group_handler,
-      NULL,
-    },
-    { { NULL, 0, 0 }, NULL },
-  };
+    { KEY_WORKSPACE_NAMES,
+      SCHEMA_GENERAL,
+      META_PREF_WORKSPACE_NAMES, },
+    NULL,
+    &workspace_names,
+  },
+  {
+    { KEY_XKB_OPTIONS,
+      SCHEMA_INPUT_SOURCES,
+      META_PREF_KEYBINDINGS, },
+    iso_next_group_handler,
+    NULL,
+  },
+  { { NULL, 0, 0 }, NULL },
+};
 
 static MetaIntPreference preferences_int[] =
+{
   {
-    {
-      { KEY_NUM_WORKSPACES,
-        SCHEMA_GENERAL,
-        META_PREF_NUM_WORKSPACES,
-      },
-      &num_workspaces
-    },
-    {
-      { "auto-raise-delay",
-        SCHEMA_GENERAL,
-        META_PREF_AUTO_RAISE_DELAY,
-      },
-      &auto_raise_delay
-    },
-    {
-      { "draggable-border-width",
-        SCHEMA_MUTTER,
-        META_PREF_DRAGGABLE_BORDER_WIDTH,
-      },
-      &draggable_border_width
-    },
-    {
-      { "drag-threshold",
-        SCHEMA_MOUSE,
-        META_PREF_DRAG_THRESHOLD,
-      },
-      &drag_threshold
-    },
-    {
-      { "cursor-size",
-        SCHEMA_INTERFACE,
-        META_PREF_CURSOR_SIZE,
-      },
-      &cursor_size
-    },
-    { { NULL, 0, 0 }, NULL },
-  };
+    { KEY_NUM_WORKSPACES,
+      SCHEMA_GENERAL,
+      META_PREF_NUM_WORKSPACES, },
+    &num_workspaces
+  },
+  {
+    { "auto-raise-delay",
+      SCHEMA_GENERAL,
+      META_PREF_AUTO_RAISE_DELAY, },
+    &auto_raise_delay
+  },
+  {
+    { "draggable-border-width",
+      SCHEMA_MUTTER,
+      META_PREF_DRAGGABLE_BORDER_WIDTH, },
+    &draggable_border_width
+  },
+  {
+    { "drag-threshold",
+      SCHEMA_MOUSE,
+      META_PREF_DRAG_THRESHOLD, },
+    &drag_threshold
+  },
+  {
+    { "cursor-size",
+      SCHEMA_INTERFACE,
+      META_PREF_CURSOR_SIZE, },
+    &cursor_size
+  },
+  { { NULL, 0, 0 }, NULL },
+};
 
 static void
 handle_preference_init_enum (void)
@@ -499,7 +471,7 @@ handle_preference_init_enum (void)
 
   while (cursor->base.key != NULL)
     {
-      if (cursor->target==NULL)
+      if (cursor->target == NULL)
         continue;
 
       *((gint *) cursor->target) =
@@ -516,7 +488,7 @@ handle_preference_init_bool (void)
 
   while (cursor->base.key != NULL)
     {
-      if (cursor->target!=NULL)
+      if (cursor->target != NULL)
         *cursor->target =
           g_settings_get_boolean (SETTINGS (cursor->base.schema),
                                   cursor->base.key);
@@ -616,7 +588,7 @@ handle_preference_init_int (void)
 
 static void
 handle_preference_update_enum (GSettings *settings,
-                               gchar *key)
+                               gchar     *key)
 {
   MetaEnumPreference *cursor = preferences_enum;
   gint old_value;
@@ -632,18 +604,18 @@ handle_preference_update_enum (GSettings *settings,
    * store the current value away.
    */
 
-  old_value = * ((gint *)cursor->target);
-  *((gint *)cursor->target) =
+  old_value = *((gint *) cursor->target);
+  *((gint *) cursor->target) =
     g_settings_get_enum (SETTINGS (cursor->base.schema), key);
 
   /* Did it change?  If so, tell the listeners about it. */
-  if (old_value != *((gint *)cursor->target))
+  if (old_value != *((gint *) cursor->target))
     queue_changed (cursor->base.pref);
 }
 
 static void
 handle_preference_update_bool (GSettings *settings,
-                               gchar *key)
+                               gchar     *key)
 {
   MetaBoolPreference *cursor = preferences_bool;
   gboolean old_value;
@@ -665,16 +637,16 @@ handle_preference_update_bool (GSettings *settings,
     g_settings_get_boolean (SETTINGS (cursor->base.schema), key);
 
   /* Did it change?  If so, tell the listeners about it. */
-  if (old_value != *((gboolean *)cursor->target))
+  if (old_value != *((gboolean *) cursor->target))
     queue_changed (cursor->base.pref);
 
-  if (cursor->base.pref==META_PREF_DISABLE_WORKAROUNDS)
+  if (cursor->base.pref == META_PREF_DISABLE_WORKAROUNDS)
     maybe_give_disable_workarounds_warning ();
 }
 
 static void
 handle_preference_update_string (GSettings *settings,
-                                 gchar *key)
+                                 gchar     *key)
 {
   MetaStringPreference *cursor = preferences_string;
   char *value;
@@ -683,7 +655,7 @@ handle_preference_update_string (GSettings *settings,
   while (cursor->base.key != NULL && strcmp (key, cursor->base.key) != 0)
     ++cursor;
 
-  if (cursor->base.key==NULL)
+  if (cursor->base.key == NULL)
     /* Didn't recognise that key. */
     return;
 
@@ -706,7 +678,7 @@ handle_preference_update_string (GSettings *settings,
 
       inform_listeners = (g_strcmp0 (value, *(cursor->target)) != 0);
 
-      g_free(*(cursor->target));
+      g_free (*(cursor->target));
 
       *(cursor->target) = value;
     }
@@ -717,7 +689,7 @@ handle_preference_update_string (GSettings *settings,
 
 static void
 handle_preference_update_string_array (GSettings *settings,
-                                       gchar *key)
+                                       gchar     *key)
 {
   MetaStringArrayPreference *cursor = preferences_string_array;
   gboolean inform_listeners = FALSE;
@@ -725,7 +697,7 @@ handle_preference_update_string_array (GSettings *settings,
   while (cursor->base.key != NULL && strcmp (key, cursor->base.key) != 0)
     ++cursor;
 
-  if (cursor->base.key==NULL)
+  if (cursor->base.key == NULL)
     /* Didn't recognise that key. */
     return;
 
@@ -767,7 +739,7 @@ handle_preference_update_string_array (GSettings *settings,
 
 static void
 handle_preference_update_int (GSettings *settings,
-                              gchar *key)
+                              gchar     *key)
 {
   MetaIntPreference *cursor = preferences_int;
   gint new_value;
@@ -860,7 +832,7 @@ emit_changed (MetaPreference pref)
     {
       MetaPrefsListener *l = tmp->data;
 
-      (* l->func) (pref, l->data);
+      (*l->func)(pref, l->data);
 
       tmp = tmp->next;
     }
@@ -956,7 +928,8 @@ meta_prefs_init (void)
   settings = g_settings_new (SCHEMA_INPUT_SOURCES);
   g_signal_connect (settings, "changed::" KEY_XKB_OPTIONS,
                     G_CALLBACK (settings_changed), NULL);
-  g_hash_table_insert (settings_schemas, g_strdup (SCHEMA_INPUT_SOURCES), settings);
+  g_hash_table_insert (settings_schemas, g_strdup (
+                         SCHEMA_INPUT_SOURCES), settings);
 
   /* Pick up initial values. */
 
@@ -989,7 +962,7 @@ find_pref (void                *prefs,
           return TRUE;
         }
 
-      p = (guchar *)p + pref_size;
+      p = (guchar *) p + pref_size;
     }
 
   return FALSE;
@@ -1003,8 +976,8 @@ find_pref (void                *prefs,
 
 static void
 settings_changed (GSettings *settings,
-                  gchar *key,
-                  gpointer data)
+                  gchar     *key,
+                  gpointer   data)
 {
   GVariant *value;
   const GVariantType *type;
@@ -1027,7 +1000,6 @@ settings_changed (GSettings *settings,
 
       while (cursor->base.key != NULL)
         {
-
           if (strcmp (key, cursor->base.key) == 0)
             found_enum = TRUE;
 
@@ -1050,8 +1022,8 @@ settings_changed (GSettings *settings,
 
 static void
 bindings_changed (GSettings *settings,
-                  gchar *key,
-                  gpointer data)
+                  gchar     *key,
+                  gpointer   data)
 {
   gchar **strokes;
   strokes = g_settings_get_strv (settings, key);
@@ -1137,7 +1109,7 @@ meta_prefs_set_show_fallback_app_menu (gboolean whether)
     queue_changed (META_PREF_BUTTON_LAYOUT);
 }
 
-const char*
+const char *
 meta_prefs_get_cursor_theme (void)
 {
   return cursor_theme;
@@ -1157,7 +1129,7 @@ meta_prefs_get_cursor_size (void)
 static gboolean
 titlebar_handler (GVariant *value,
                   gpointer *result,
-                  gpointer data)
+                  gpointer  data)
 {
   PangoFontDescription *desc;
   const gchar *string_value;
@@ -1314,9 +1286,9 @@ button_layout_handler (GVariant *value,
       while (buttons[b] != NULL)
         {
           MetaButtonFunction f = button_function_from_string (buttons[b]);
-          if (i > 0 && strcmp("spacer", buttons[b]) == 0)
+          if (i > 0 && strcmp ("spacer", buttons[b]) == 0)
             {
-              new_layout.left_buttons_has_spacer[i-1] = TRUE;
+              new_layout.left_buttons_has_spacer[i - 1] = TRUE;
             }
           else
             {
@@ -1328,7 +1300,8 @@ button_layout_handler (GVariant *value,
                 }
               else
                 {
-                  meta_topic (META_DEBUG_PREFS, "Ignoring unknown or already-used button name \"%s\"\n",
+                  meta_topic (META_DEBUG_PREFS,
+                              "Ignoring unknown or already-used button name \"%s\"\n",
                               buttons[b]);
                 }
             }
@@ -1365,9 +1338,9 @@ button_layout_handler (GVariant *value,
       while (buttons[b] != NULL)
         {
           MetaButtonFunction f = button_function_from_string (buttons[b]);
-          if (i > 0 && strcmp("spacer", buttons[b]) == 0)
+          if (i > 0 && strcmp ("spacer", buttons[b]) == 0)
             {
-              new_layout.right_buttons_has_spacer[i-1] = TRUE;
+              new_layout.right_buttons_has_spacer[i - 1] = TRUE;
             }
           else
             {
@@ -1379,7 +1352,8 @@ button_layout_handler (GVariant *value,
                 }
               else
                 {
-                  meta_topic (META_DEBUG_PREFS, "Ignoring unknown or already-used button name \"%s\"\n",
+                  meta_topic (META_DEBUG_PREFS,
+                              "Ignoring unknown or already-used button name \"%s\"\n",
                               buttons[b]);
                 }
             }
@@ -1399,19 +1373,24 @@ button_layout_handler (GVariant *value,
   g_strfreev (sides);
 
   /* Invert the button layout for RTL languages */
-  if (meta_get_locale_direction() == META_LOCALE_DIRECTION_RTL)
+  if (meta_get_locale_direction () == META_LOCALE_DIRECTION_RTL)
     {
       MetaButtonLayout rtl_layout;
       int j;
 
-      for (i = 0; new_layout.left_buttons[i] != META_BUTTON_FUNCTION_LAST; i++);
+      for (i = 0; new_layout.left_buttons[i] != META_BUTTON_FUNCTION_LAST; i++)
+        ;
       for (j = 0; j < i; j++)
         {
           rtl_layout.right_buttons[j] = new_layout.left_buttons[i - j - 1];
           if (j == 0)
-            rtl_layout.right_buttons_has_spacer[i - 1] = new_layout.left_buttons_has_spacer[i - j - 1];
+            rtl_layout.right_buttons_has_spacer[i -
+                                                1] =
+              new_layout.left_buttons_has_spacer[i - j - 1];
           else
-            rtl_layout.right_buttons_has_spacer[j - 1] = new_layout.left_buttons_has_spacer[i - j - 1];
+            rtl_layout.right_buttons_has_spacer[j -
+                                                1] =
+              new_layout.left_buttons_has_spacer[i - j - 1];
         }
       for (; j < MAX_BUTTONS_PER_CORNER; j++)
         {
@@ -1419,14 +1398,19 @@ button_layout_handler (GVariant *value,
           rtl_layout.right_buttons_has_spacer[j] = FALSE;
         }
 
-      for (i = 0; new_layout.right_buttons[i] != META_BUTTON_FUNCTION_LAST; i++);
+      for (i = 0; new_layout.right_buttons[i] != META_BUTTON_FUNCTION_LAST; i++)
+        ;
       for (j = 0; j < i; j++)
         {
           rtl_layout.left_buttons[j] = new_layout.right_buttons[i - j - 1];
           if (j == 0)
-            rtl_layout.left_buttons_has_spacer[i - 1] = new_layout.right_buttons_has_spacer[i - j - 1];
+            rtl_layout.left_buttons_has_spacer[i -
+                                               1] =
+              new_layout.right_buttons_has_spacer[i - j - 1];
           else
-            rtl_layout.left_buttons_has_spacer[j - 1] = new_layout.right_buttons_has_spacer[i - j - 1];
+            rtl_layout.left_buttons_has_spacer[j -
+                                               1] =
+              new_layout.right_buttons_has_spacer[i - j - 1];
         }
       for (; j < MAX_BUTTONS_PER_CORNER; j++)
         {
@@ -1511,7 +1495,7 @@ iso_next_group_handler (GVariant *value,
   return TRUE;
 }
 
-const PangoFontDescription*
+const PangoFontDescription *
 meta_prefs_get_titlebar_font (void)
 {
   if (use_system_font)
@@ -1539,7 +1523,7 @@ meta_prefs_get_disable_workarounds (void)
 }
 
 #ifdef WITH_VERBOSE_MODE
-const char*
+const char *
 meta_preference_to_string (MetaPreference pref)
 {
   /* TODO: better handled via GLib enum nicknames */
@@ -1654,7 +1638,7 @@ meta_prefs_set_num_workspaces (int n_workspaces)
 {
   MetaBasePreference *pref;
 
-  if (find_pref (preferences_int, sizeof(MetaIntPreference),
+  if (find_pref (preferences_int, sizeof (MetaIntPreference),
                  KEY_NUM_WORKSPACES, &pref))
     {
       g_settings_set_int (SETTINGS (pref->schema),
@@ -1683,7 +1667,7 @@ init_bindings (void)
   MetaKeyPref *pref;
 
   key_bindings = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
-                                        (GDestroyNotify)meta_key_pref_free);
+                                        (GDestroyNotify) meta_key_pref_free);
 
   pref = g_new0 (MetaKeyPref, 1);
   pref->name = g_strdup ("overlay-key");
@@ -1719,13 +1703,15 @@ update_binding (MetaKeyPref *binding,
         {
           meta_topic (META_DEBUG_KEYBINDINGS,
                       "Failed to parse new GSettings value\n");
-          meta_warning ("\"%s\" found in configuration database is not a valid value for keybinding 
\"%s\"\n",
-                        strokes[i], binding->name);
+          meta_warning (
+            "\"%s\" found in configuration database is not a valid value for keybinding \"%s\"\n",
+            strokes[i], binding->name);
 
           g_free (combo);
 
           /* Value is kept and will thus be removed next time we save the key.
-           * Changing the key in response to a modification could lead to cyclic calls. */
+           * Changing the key in response to a modification could lead to cyclic
+           *calls. */
           continue;
         }
 
@@ -1777,13 +1763,13 @@ update_key_binding (const char *key,
     return FALSE;
 }
 
-const char*
+const char *
 meta_prefs_get_workspace_name (int i)
 {
   const char *name;
 
   if (!workspace_names ||
-      g_strv_length (workspace_names) < (guint)i + 1 ||
+      g_strv_length (workspace_names) < (guint) i + 1 ||
       !*workspace_names[i])
     {
       char *generated_name = g_strdup_printf (_("Workspace %d"), i + 1);
@@ -1876,14 +1862,14 @@ meta_prefs_get_visual_bell_type (void)
 }
 
 gboolean
-meta_prefs_add_keybinding (const char           *name,
-                           GSettings            *settings,
-                           MetaKeyBindingAction  action,
-                           MetaKeyBindingFlags   flags)
+meta_prefs_add_keybinding (const char          *name,
+                           GSettings           *settings,
+                           MetaKeyBindingAction action,
+                           MetaKeyBindingFlags  flags)
 {
-  MetaKeyPref  *pref;
-  char        **strokes;
-  guint         id;
+  MetaKeyPref *pref;
+  char **strokes;
+  guint id;
 
   if (g_hash_table_lookup (key_bindings, name))
     {
@@ -1904,7 +1890,9 @@ meta_prefs_add_keybinding (const char           *name,
         {
           id = g_signal_connect (settings, "changed",
                                  G_CALLBACK (bindings_changed), NULL);
-          g_object_set_data (G_OBJECT (settings), "changed-signal", GUINT_TO_POINTER (id));
+          g_object_set_data (G_OBJECT (
+                               settings), "changed-signal", GUINT_TO_POINTER (
+                               id));
         }
     }
   else
@@ -1932,7 +1920,7 @@ gboolean
 meta_prefs_remove_keybinding (const char *name)
 {
   MetaKeyPref *pref;
-  guint        id;
+  guint id;
 
   pref = g_hash_table_lookup (key_bindings, name);
   if (!pref)
@@ -2041,19 +2029,19 @@ meta_prefs_get_keybinding_action (const char *name)
   MetaKeyPref *pref = g_hash_table_lookup (key_bindings, name);
 
   return pref ? pref->action
-              : META_KEYBINDING_ACTION_NONE;
+         : META_KEYBINDING_ACTION_NONE;
 }
 
 gint
 meta_prefs_get_mouse_button_resize (void)
 {
-  return resize_with_right_button ? 3: 2;
+  return resize_with_right_button ? 3 : 2;
 }
 
 gint
 meta_prefs_get_mouse_button_menu (void)
 {
-  return resize_with_right_button ? 2: 3;
+  return resize_with_right_button ? 2 : 3;
 }
 
 gboolean
diff --git a/src/core/restart-helper.c b/src/core/restart-helper.c
index 68ede2671..953aa050d 100644
--- a/src/core/restart-helper.c
+++ b/src/core/restart-helper.c
@@ -50,17 +50,18 @@ main (int    argc,
   XCompositeGetOverlayWindow (display, DefaultRootWindow (display));
 
   selection_window = XCreateWindow (display,
-                                   DefaultRootWindow (display),
-                                   -100, -100, 1, 1, 0,
-                                   0,
-                                   InputOnly,
-                                   DefaultVisual (display, DefaultScreen (display)),
-                                   mask, &xwa);
+                                    DefaultRootWindow (display),
+                                    -100, -100, 1, 1, 0,
+                                    0,
+                                    InputOnly,
+                                    DefaultVisual (display,
+                                                   DefaultScreen (display)),
+                                    mask, &xwa);
 
   XSetSelectionOwner (display,
-                     XInternAtom (display, "_MUTTER_RESTART_HELPER", False),
-                     selection_window,
-                     CurrentTime);
+                      XInternAtom (display, "_MUTTER_RESTART_HELPER", False),
+                      selection_window,
+                      CurrentTime);
 
   /* Mutter looks for an (arbitrary) line printed to stdout to know that
    * we have started and have a reference to the COW. XSync() so that
@@ -79,6 +80,6 @@ main (int    argc,
       /* Mutter restarted and unset the selection to indicate that
        * it has a reference on the COW again */
       if (xev.xany.type == SelectionClear)
-       return 0;
+        return 0;
     }
 }
diff --git a/src/core/restart.c b/src/core/restart.c
index b13e1dcf4..b4dacfb37 100644
--- a/src/core/restart.c
+++ b/src/core/restart.c
@@ -69,9 +69,11 @@ restart_helper_read_line_callback (GObject      *source_object,
 {
   GError *error = NULL;
   gsize length;
-  char *line = g_data_input_stream_read_line_finish_utf8 (G_DATA_INPUT_STREAM (source_object),
-                                                          res,
-                                                          &length, &error);
+  char *line =
+    g_data_input_stream_read_line_finish_utf8 (G_DATA_INPUT_STREAM (
+                                                 source_object),
+                                               res,
+                                               &length, &error);
   if (line == NULL)
     {
       meta_warning ("Failed to read output from restart helper%s%s\n",
@@ -111,13 +113,14 @@ restart_message_painted (gpointer data)
 void
 meta_restart (const char *message)
 {
-  MetaDisplay *display = meta_get_display();
+  MetaDisplay *display = meta_get_display ();
   GInputStream *unix_stream;
   GDataInputStream *data_stream;
   GError *error = NULL;
   int helper_out_fd;
 
-  static const char * const helper_argv[] = {
+  static const char * const helper_argv[] =
+  {
     MUTTER_LIBEXECDIR "/mutter-restart-helper", NULL
   };
 
@@ -140,7 +143,7 @@ meta_restart (const char *message)
    * reference to the Composite Overlay Window.
    */
   if (!g_spawn_async_with_pipes (NULL, /* working directory */
-                                 (char **)helper_argv,
+                                 (char **) helper_argv,
                                  NULL, /* envp */
                                  G_SPAWN_DEFAULT,
                                  NULL, NULL, /* child_setup */
@@ -170,7 +173,7 @@ meta_restart (const char *message)
 
   return;
 
- error:
+error:
   /* If starting the restart helper fails, then we just go ahead and restart
    * immediately. We won't get a smooth transition, since the overlay window
    * will be destroyed and recreated, but otherwise it will work fine.
diff --git a/src/core/stack-tracker.c b/src/core/stack-tracker.c
index 34e4698cd..cdea3bad8 100644
--- a/src/core/stack-tracker.c
+++ b/src/core/stack-tracker.c
@@ -81,20 +81,22 @@
 
 typedef union _MetaStackOp MetaStackOp;
 
-typedef enum {
+typedef enum
+{
   STACK_OP_ADD,
   STACK_OP_REMOVE,
   STACK_OP_RAISE_ABOVE,
   STACK_OP_LOWER_BELOW
 } MetaStackOpType;
 
-typedef enum {
+typedef enum
+{
   APPLY_DEFAULT = 0,
   /* Only do restacking that we can do locally without changing
    * the order of X windows. After we've received any stack
    * events from the X server, we apply the locally cached
    * ops in this mode to handle the non-X parts */
-  NO_RESTACK_X_WINDOWS =   1 << 0,
+  NO_RESTACK_X_WINDOWS = 1 << 0,
   /* If the stacking operation wouldn't change the order of X
    * windows, ignore it. We use this when applying events received
    * from X so that a spontaneous ConfigureNotify (for a move, say)
@@ -110,28 +112,33 @@ typedef enum {
  */
 union _MetaStackOp
 {
-  struct {
+  struct
+  {
     MetaStackOpType type;
     gulong serial;
     guint64 window;
   } any;
-  struct {
+  struct
+  {
     MetaStackOpType type;
     gulong serial;
     guint64 window;
   } add;
-  struct {
+  struct
+  {
     MetaStackOpType type;
     gulong serial;
     guint64 window;
   } remove;
-  struct {
+  struct
+  {
     MetaStackOpType type;
     gulong serial;
     guint64 window;
     guint64 sibling;
   } raise_above;
-  struct {
+  struct
+  {
     MetaStackOpType type;
     gulong serial;
     guint64 window;
@@ -182,8 +189,8 @@ get_window_desc (MetaStackTracker *tracker,
 static void
 meta_stack_op_dump (MetaStackTracker *tracker,
                     MetaStackOp      *op,
-                   const char       *prefix,
-                   const char       *suffix)
+                    const char       *prefix,
+                    const char       *suffix)
 {
 #ifdef WITH_VERBOSE_MODE
   const char *window_desc = get_window_desc (tracker, op->any.window);
@@ -193,32 +200,32 @@ meta_stack_op_dump (MetaStackTracker *tracker,
     {
     case STACK_OP_ADD:
       meta_topic (META_DEBUG_STACK, "%sADD(%s; %ld)%s",
-                 prefix, window_desc, op->any.serial, suffix);
+                  prefix, window_desc, op->any.serial, suffix);
       break;
     case STACK_OP_REMOVE:
       meta_topic (META_DEBUG_STACK, "%sREMOVE(%s; %ld)%s",
-                 prefix, window_desc, op->any.serial, suffix);
+                  prefix, window_desc, op->any.serial, suffix);
       break;
     case STACK_OP_RAISE_ABOVE:
-      {
-        meta_topic (META_DEBUG_STACK, "%sRAISE_ABOVE(%s, %s; %ld)%s",
-                    prefix,
-                    window_desc,
-                    get_window_desc (tracker, op->raise_above.sibling),
-                    op->any.serial,
-                    suffix);
-        break;
-      }
+    {
+      meta_topic (META_DEBUG_STACK, "%sRAISE_ABOVE(%s, %s; %ld)%s",
+                  prefix,
+                  window_desc,
+                  get_window_desc (tracker, op->raise_above.sibling),
+                  op->any.serial,
+                  suffix);
+      break;
+    }
     case STACK_OP_LOWER_BELOW:
-      {
-        meta_topic (META_DEBUG_STACK, "%sLOWER_BELOW(%s, %s; %ld)%s",
-                    prefix,
-                    window_desc,
-                    get_window_desc (tracker, op->lower_below.sibling),
-                    op->any.serial,
-                    suffix);
-        break;
-      }
+    {
+      meta_topic (META_DEBUG_STACK, "%sLOWER_BELOW(%s, %s; %ld)%s",
+                  prefix,
+                  window_desc,
+                  get_window_desc (tracker, op->lower_below.sibling),
+                  op->any.serial,
+                  suffix);
+      break;
+    }
     }
 }
 
@@ -248,7 +255,8 @@ meta_stack_tracker_dump (MetaStackTracker *tracker)
 
   meta_topic (META_DEBUG_STACK, "MetaStackTracker state\n");
   meta_push_no_msg_prefix ();
-  meta_topic (META_DEBUG_STACK, "  xserver_serial: %ld\n", tracker->xserver_serial);
+  meta_topic (META_DEBUG_STACK, "  xserver_serial: %ld\n",
+              tracker->xserver_serial);
   meta_topic (META_DEBUG_STACK, "  verified_stack: ");
   stack_dump (tracker, tracker->verified_stack);
   meta_topic (META_DEBUG_STACK, "  unverified_predictions: [");
@@ -274,8 +282,8 @@ meta_stack_op_free (MetaStackOp *op)
 }
 
 static int
-find_window (GArray  *window_stack,
-             guint64  window)
+find_window (GArray *window_stack,
+             guint64 window)
 {
   guint i;
 
@@ -299,7 +307,7 @@ move_window_above (GArray    *stack,
 {
   int i;
   gboolean can_restack_this_window =
-    (apply_flags & NO_RESTACK_X_WINDOWS) == 0  || !META_STACK_ID_IS_X11 (window);
+    (apply_flags & NO_RESTACK_X_WINDOWS) == 0 || !META_STACK_ID_IS_X11 (window);
 
   if (old_pos < above_pos)
     {
@@ -363,105 +371,107 @@ move_window_above (GArray    *stack,
 static gboolean
 meta_stack_op_apply (MetaStackTracker *tracker,
                      MetaStackOp      *op,
-                    GArray           *stack,
+                     GArray           *stack,
                      ApplyFlags        apply_flags)
 {
   switch (op->any.type)
     {
     case STACK_OP_ADD:
-      {
-        if (META_STACK_ID_IS_X11 (op->add.window) &&
-            (apply_flags & NO_RESTACK_X_WINDOWS) != 0)
+    {
+      if (META_STACK_ID_IS_X11 (op->add.window) &&
+          (apply_flags & NO_RESTACK_X_WINDOWS) != 0)
+        return FALSE;
+
+      int old_pos = find_window (stack, op->add.window);
+      if (old_pos >= 0)
+        {
+          g_warning ("STACK_OP_ADD: window %s already in stack",
+                     get_window_desc (tracker, op->add.window));
           return FALSE;
+        }
 
-       int old_pos = find_window (stack, op->add.window);
-       if (old_pos >= 0)
-         {
-           g_warning ("STACK_OP_ADD: window %s already in stack",
-                      get_window_desc (tracker, op->add.window));
-           return FALSE;
-         }
-
-       g_array_append_val (stack, op->add.window);
-       return TRUE;
-      }
+      g_array_append_val (stack, op->add.window);
+      return TRUE;
+    }
     case STACK_OP_REMOVE:
-      {
-        if (META_STACK_ID_IS_X11 (op->remove.window) &&
-            (apply_flags & NO_RESTACK_X_WINDOWS) != 0)
+    {
+      if (META_STACK_ID_IS_X11 (op->remove.window) &&
+          (apply_flags & NO_RESTACK_X_WINDOWS) != 0)
+        return FALSE;
+
+      int old_pos = find_window (stack, op->remove.window);
+      if (old_pos < 0)
+        {
+          g_warning ("STACK_OP_REMOVE: window %s not in stack",
+                     get_window_desc (tracker, op->remove.window));
           return FALSE;
+        }
 
-       int old_pos = find_window (stack, op->remove.window);
-       if (old_pos < 0)
-         {
-           g_warning ("STACK_OP_REMOVE: window %s not in stack",
-                      get_window_desc (tracker, op->remove.window));
-           return FALSE;
-         }
-
-       g_array_remove_index (stack, old_pos);
-       return TRUE;
-      }
+      g_array_remove_index (stack, old_pos);
+      return TRUE;
+    }
     case STACK_OP_RAISE_ABOVE:
-      {
-       int old_pos = find_window (stack, op->raise_above.window);
-       int above_pos;
-       if (old_pos < 0)
-         {
-           g_warning ("STACK_OP_RAISE_ABOVE: window %s not in stack",
-                      get_window_desc (tracker, op->raise_above.window));
-           return FALSE;
-         }
-
-        if (op->raise_above.sibling)
-         {
-           above_pos = find_window (stack, op->raise_above.sibling);
-           if (above_pos < 0)
-             {
-               g_warning ("STACK_OP_RAISE_ABOVE: sibling window %s not in stack",
-                           get_window_desc (tracker, op->raise_above.sibling));
-               return FALSE;
-             }
-         }
-       else
-         {
-           above_pos = -1;
-         }
-
-       return move_window_above (stack, op->raise_above.window, old_pos, above_pos,
-                                  apply_flags);
-      }
+    {
+      int old_pos = find_window (stack, op->raise_above.window);
+      int above_pos;
+      if (old_pos < 0)
+        {
+          g_warning ("STACK_OP_RAISE_ABOVE: window %s not in stack",
+                     get_window_desc (tracker, op->raise_above.window));
+          return FALSE;
+        }
+
+      if (op->raise_above.sibling)
+        {
+          above_pos = find_window (stack, op->raise_above.sibling);
+          if (above_pos < 0)
+            {
+              g_warning ("STACK_OP_RAISE_ABOVE: sibling window %s not in stack",
+                         get_window_desc (tracker, op->raise_above.sibling));
+              return FALSE;
+            }
+        }
+      else
+        {
+          above_pos = -1;
+        }
+
+      return move_window_above (stack, op->raise_above.window, old_pos,
+                                above_pos,
+                                apply_flags);
+    }
     case STACK_OP_LOWER_BELOW:
-      {
-       int old_pos = find_window (stack, op->lower_below.window);
-       int above_pos;
-       if (old_pos < 0)
-         {
-           g_warning ("STACK_OP_LOWER_BELOW: window %s not in stack",
-                      get_window_desc (tracker, op->lower_below.window));
-           return FALSE;
-         }
-
-        if (op->lower_below.sibling)
-         {
-           int below_pos = find_window (stack, op->lower_below.sibling);
-           if (below_pos < 0)
-             {
-               g_warning ("STACK_OP_LOWER_BELOW: sibling window %s not in stack",
-                          get_window_desc (tracker, op->lower_below.sibling));
-               return FALSE;
-             }
-
-           above_pos = below_pos - 1;
-         }
-       else
-         {
-           above_pos = stack->len - 1;
-         }
-
-       return move_window_above (stack, op->lower_below.window, old_pos, above_pos,
-                                  apply_flags);
-      }
+    {
+      int old_pos = find_window (stack, op->lower_below.window);
+      int above_pos;
+      if (old_pos < 0)
+        {
+          g_warning ("STACK_OP_LOWER_BELOW: window %s not in stack",
+                     get_window_desc (tracker, op->lower_below.window));
+          return FALSE;
+        }
+
+      if (op->lower_below.sibling)
+        {
+          int below_pos = find_window (stack, op->lower_below.sibling);
+          if (below_pos < 0)
+            {
+              g_warning ("STACK_OP_LOWER_BELOW: sibling window %s not in stack",
+                         get_window_desc (tracker, op->lower_below.sibling));
+              return FALSE;
+            }
+
+          above_pos = below_pos - 1;
+        }
+      else
+        {
+          above_pos = stack->len - 1;
+        }
+
+      return move_window_above (stack, op->lower_below.window, old_pos,
+                                above_pos,
+                                apply_flags);
+    }
     }
 
   g_assert_not_reached ();
@@ -537,12 +547,13 @@ meta_stack_tracker_free (MetaStackTracker *tracker)
   if (tracker->predicted_stack)
     g_array_free (tracker->predicted_stack, TRUE);
 
-  g_queue_foreach (tracker->unverified_predictions, (GFunc)meta_stack_op_free, NULL);
+  g_queue_foreach (tracker->unverified_predictions, (GFunc) meta_stack_op_free,
+                   NULL);
   g_queue_free (tracker->unverified_predictions);
   tracker->unverified_predictions = NULL;
 
   g_signal_handlers_disconnect_by_func (tracker->display,
-                                        (gpointer)query_xserver_stack,
+                                        (gpointer) query_xserver_stack,
                                         tracker);
 
   g_free (tracker);
@@ -550,7 +561,7 @@ meta_stack_tracker_free (MetaStackTracker *tracker)
 
 static void
 stack_tracker_apply_prediction (MetaStackTracker *tracker,
-                               MetaStackOp      *op)
+                                MetaStackOp      *op)
 {
   gboolean free_at_end = FALSE;
 
@@ -561,7 +572,8 @@ stack_tracker_apply_prediction (MetaStackTracker *tracker,
   if (op->any.serial == 0 &&
       tracker->unverified_predictions->length == 0)
     {
-      if (meta_stack_op_apply (tracker, op, tracker->verified_stack, APPLY_DEFAULT))
+      if (meta_stack_op_apply (tracker, op, tracker->verified_stack,
+                               APPLY_DEFAULT))
         meta_stack_tracker_queue_sync_stack (tracker);
 
       free_at_end = TRUE;
@@ -573,7 +585,8 @@ stack_tracker_apply_prediction (MetaStackTracker *tracker,
     }
 
   if (!tracker->predicted_stack ||
-      meta_stack_op_apply (tracker, op, tracker->predicted_stack, APPLY_DEFAULT))
+      meta_stack_op_apply (tracker, op, tracker->predicted_stack,
+                           APPLY_DEFAULT))
     meta_stack_tracker_queue_sync_stack (tracker);
 
   if (free_at_end)
@@ -585,7 +598,7 @@ stack_tracker_apply_prediction (MetaStackTracker *tracker,
 void
 meta_stack_tracker_record_add (MetaStackTracker *tracker,
                                guint64           window,
-                              gulong            serial)
+                               gulong            serial)
 {
   MetaStackOp *op = g_slice_new (MetaStackOp);
 
@@ -599,7 +612,7 @@ meta_stack_tracker_record_add (MetaStackTracker *tracker,
 void
 meta_stack_tracker_record_remove (MetaStackTracker *tracker,
                                   guint64           window,
-                                 gulong            serial)
+                                  gulong            serial)
 {
   MetaStackOp *op = g_slice_new (MetaStackOp);
 
@@ -614,7 +627,7 @@ static void
 meta_stack_tracker_record_raise_above (MetaStackTracker *tracker,
                                        guint64           window,
                                        guint64           sibling,
-                                      gulong            serial)
+                                       gulong            serial)
 {
   MetaStackOp *op = g_slice_new (MetaStackOp);
 
@@ -630,7 +643,7 @@ static void
 meta_stack_tracker_record_lower_below (MetaStackTracker *tracker,
                                        guint64           window,
                                        guint64           sibling,
-                                      gulong            serial)
+                                       gulong            serial)
 {
   MetaStackOp *op = g_slice_new (MetaStackOp);
 
@@ -644,7 +657,7 @@ meta_stack_tracker_record_lower_below (MetaStackTracker *tracker,
 
 static void
 stack_tracker_event_received (MetaStackTracker *tracker,
-                             MetaStackOp      *op)
+                              MetaStackOp      *op)
 {
   gboolean need_sync = FALSE;
 
@@ -662,10 +675,10 @@ stack_tracker_event_received (MetaStackTracker *tracker,
    */
   while (tracker->unverified_predictions->head)
     {
-      MetaStackOp *queued_op  = tracker->unverified_predictions->head->data;
+      MetaStackOp *queued_op = tracker->unverified_predictions->head->data;
 
       if (queued_op->any.serial >= op->any.serial)
-       break;
+        break;
 
       meta_stack_op_apply (tracker, queued_op, tracker->verified_stack,
                            NO_RESTACK_X_WINDOWS);
@@ -690,10 +703,10 @@ stack_tracker_event_received (MetaStackTracker *tracker,
    */
   while (tracker->unverified_predictions->head)
     {
-      MetaStackOp *queued_op  = tracker->unverified_predictions->head->data;
+      MetaStackOp *queued_op = tracker->unverified_predictions->head->data;
 
       if (queued_op->any.serial > op->any.serial)
-       break;
+        break;
 
       meta_stack_op_apply (tracker, queued_op, tracker->verified_stack,
                            NO_RESTACK_X_WINDOWS);
@@ -718,8 +731,8 @@ stack_tracker_event_received (MetaStackTracker *tracker,
 }
 
 void
-meta_stack_tracker_create_event (MetaStackTracker    *tracker,
-                                XCreateWindowEvent  *event)
+meta_stack_tracker_create_event (MetaStackTracker   *tracker,
+                                 XCreateWindowEvent *event)
 {
   MetaStackOp op;
 
@@ -732,7 +745,7 @@ meta_stack_tracker_create_event (MetaStackTracker    *tracker,
 
 void
 meta_stack_tracker_destroy_event (MetaStackTracker    *tracker,
-                                 XDestroyWindowEvent *event)
+                                  XDestroyWindowEvent *event)
 {
   MetaStackOp op;
 
@@ -744,8 +757,8 @@ meta_stack_tracker_destroy_event (MetaStackTracker    *tracker,
 }
 
 void
-meta_stack_tracker_reparent_event (MetaStackTracker    *tracker,
-                                  XReparentEvent      *event)
+meta_stack_tracker_reparent_event (MetaStackTracker *tracker,
+                                   XReparentEvent   *event)
 {
   if (event->parent == event->event)
     {
@@ -770,8 +783,8 @@ meta_stack_tracker_reparent_event (MetaStackTracker    *tracker,
 }
 
 void
-meta_stack_tracker_configure_event (MetaStackTracker    *tracker,
-                                   XConfigureEvent     *event)
+meta_stack_tracker_configure_event (MetaStackTracker *tracker,
+                                    XConfigureEvent  *event)
 {
   MetaStackOp op;
 
@@ -815,7 +828,7 @@ meta_stack_tracker_is_guard_window (MetaStackTracker *tracker,
 void
 meta_stack_tracker_get_stack (MetaStackTracker *tracker,
                               guint64         **windows,
-                             int              *n_windows)
+                              int              *n_windows)
 {
   GArray *stack;
 
@@ -833,7 +846,8 @@ meta_stack_tracker_get_stack (MetaStackTracker *tracker,
           for (l = tracker->unverified_predictions->head; l; l = l->next)
             {
               MetaStackOp *op = l->data;
-              meta_stack_op_apply (tracker, op, tracker->predicted_stack, APPLY_DEFAULT);
+              meta_stack_op_apply (tracker, op, tracker->predicted_stack,
+                                   APPLY_DEFAULT);
             }
         }
 
@@ -841,7 +855,7 @@ meta_stack_tracker_get_stack (MetaStackTracker *tracker,
     }
 
   if (windows)
-    *windows = (guint64 *)stack->data;
+    *windows = (guint64 *) stack->data;
   if (n_windows)
     *n_windows = stack->len;
 }
@@ -880,22 +894,30 @@ meta_stack_tracker_sync_stack (MetaStackTracker *tracker)
         {
           MetaX11Display *x11_display = tracker->display->x11_display;
           MetaWindow *meta_window =
-            meta_x11_display_lookup_x_window (x11_display, (Window)window);
-
-          /* When mapping back from xwindow to MetaWindow we have to be a bit careful;
-           * children of the root could include unmapped windows created by toolkits
-           * for internal purposes, including ones that we have registered in our
-           * XID => window table. (Wine uses a toplevel for _NET_WM_USER_TIME_WINDOW;
-           * see window-prop.c:reload_net_wm_user_time_window() for registration.)
+            meta_x11_display_lookup_x_window (x11_display, (Window) window);
+
+          /* When mapping back from xwindow to MetaWindow we have to be a bit
+           * careful;
+           * children of the root could include unmapped windows created by
+           *toolkits
+           * for internal purposes, including ones that we have registered in
+           *our
+           * XID => window table. (Wine uses a toplevel for
+           *_NET_WM_USER_TIME_WINDOW;
+           * see window-prop.c:reload_net_wm_user_time_window() for
+           *registration.)
            */
           if (meta_window &&
-              ((Window)window == meta_window->xwindow ||
-               (meta_window->frame && (Window)window == meta_window->frame->xwindow)))
+              ((Window) window == meta_window->xwindow ||
+               (meta_window->frame &&
+                (Window) window == meta_window->frame->xwindow)))
             meta_windows = g_list_prepend (meta_windows, meta_window);
         }
       else
         meta_windows = g_list_prepend (meta_windows,
-                                       meta_display_lookup_stamp (tracker->display, window));
+                                       meta_display_lookup_stamp (tracker->
+                                                                  display,
+                                                                  window));
     }
 
   meta_compositor_sync_stack (tracker->display->compositor,
@@ -952,7 +974,7 @@ find_x11_sibling_downwards (MetaStackTracker *tracker,
   int i;
 
   if (META_STACK_ID_IS_X11 (sibling))
-    return (Window)sibling;
+    return (Window) sibling;
 
   meta_stack_tracker_get_stack (tracker,
                                 &windows, &n_windows);
@@ -968,7 +990,7 @@ find_x11_sibling_downwards (MetaStackTracker *tracker,
   for (; i >= 0; i--)
     {
       if (META_STACK_ID_IS_X11 (windows[i]))
-        return (Window)windows[i];
+        return (Window) windows[i];
     }
 
   return None;
@@ -983,7 +1005,7 @@ find_x11_sibling_upwards (MetaStackTracker *tracker,
   int i;
 
   if (META_STACK_ID_IS_X11 (sibling))
-    return (Window)sibling;
+    return (Window) sibling;
 
   meta_stack_tracker_get_stack (tracker,
                                 &windows, &n_windows);
@@ -995,7 +1017,7 @@ find_x11_sibling_upwards (MetaStackTracker *tracker,
   for (; i < n_windows; i++)
     {
       if (META_STACK_ID_IS_X11 (windows[i]))
-        return (Window)windows[i];
+        return (Window) windows[i];
     }
 
   return None;
@@ -1012,7 +1034,8 @@ meta_stack_tracker_lower_below (MetaStackTracker *tracker,
   if (META_STACK_ID_IS_X11 (window))
     {
       XWindowChanges changes;
-      changes.sibling = sibling ? find_x11_sibling_upwards (tracker, sibling) : None;
+      changes.sibling =
+        sibling ? find_x11_sibling_upwards (tracker, sibling) : None;
 
       if (changes.sibling != find_x11_sibling_upwards (tracker, window))
         {
@@ -1047,7 +1070,8 @@ meta_stack_tracker_raise_above (MetaStackTracker *tracker,
   if (META_STACK_ID_IS_X11 (window))
     {
       XWindowChanges changes;
-      changes.sibling = sibling ? find_x11_sibling_downwards (tracker, sibling) : None;
+      changes.sibling =
+        sibling ? find_x11_sibling_downwards (tracker, sibling) : None;
 
       if (changes.sibling != find_x11_sibling_downwards (tracker, window))
         {
@@ -1058,7 +1082,7 @@ meta_stack_tracker_raise_above (MetaStackTracker *tracker,
           changes.stack_mode = changes.sibling ? Above : Below;
 
           XConfigureWindow (x11_display->xdisplay,
-                            (Window)window,
+                            (Window) window,
                             (changes.sibling ? CWSibling : 0) | CWStackMode,
                             &changes);
 
@@ -1107,7 +1131,8 @@ meta_stack_tracker_keep_override_redirect_on_top (MetaStackTracker *tracker)
       window = meta_display_lookup_stack_id (tracker->display, stack[i]);
       if (window && window->layer == META_LAYER_OVERRIDE_REDIRECT)
         {
-          meta_stack_tracker_raise_above (tracker, stack[i], stack[topmost_non_or]);
+          meta_stack_tracker_raise_above (tracker, stack[i],
+                                          stack[topmost_non_or]);
           meta_stack_tracker_get_stack (tracker, &stack, &n_windows);
           topmost_non_or -= 1;
         }
@@ -1136,8 +1161,10 @@ meta_stack_tracker_restack_managed (MetaStackTracker *tracker,
   old_pos = n_windows - 1;
   for (old_pos = n_windows - 1; old_pos >= 0; old_pos--)
     {
-      MetaWindow *old_window = meta_display_lookup_stack_id (tracker->display, windows[old_pos]);
-      if ((old_window && !old_window->override_redirect && !old_window->unmanaging) ||
+      MetaWindow *old_window = meta_display_lookup_stack_id (tracker->display,
+                                                             windows[old_pos]);
+      if ((old_window && !old_window->override_redirect &&
+           !old_window->unmanaging) ||
           windows[old_pos] == tracker->display->x11_display->guard_window)
         break;
     }
@@ -1146,10 +1173,13 @@ meta_stack_tracker_restack_managed (MetaStackTracker *tracker,
   new_pos = n_managed - 1;
   if (managed[new_pos] != windows[old_pos])
     {
-      /* Move the first managed window in the new stack above all managed windows */
-      meta_stack_tracker_raise_above (tracker, managed[new_pos], windows[old_pos]);
+      /* Move the first managed window in the new stack above all managed
+       * windows */
+      meta_stack_tracker_raise_above (tracker, managed[new_pos],
+                                      windows[old_pos]);
       meta_stack_tracker_get_stack (tracker, &windows, &n_windows);
-      /* Moving managed[new_pos] above windows[old_pos], moves the window at old_pos down by one */
+      /* Moving managed[new_pos] above windows[old_pos], moves the window at
+       * old_pos down by one */
     }
 
   old_pos--;
@@ -1167,16 +1197,20 @@ meta_stack_tracker_restack_managed (MetaStackTracker *tracker,
           continue;
         }
 
-      MetaWindow *old_window = meta_display_lookup_stack_id (tracker->display, windows[old_pos]);
-      if (!old_window || old_window->override_redirect || old_window->unmanaging)
+      MetaWindow *old_window = meta_display_lookup_stack_id (tracker->display,
+                                                             windows[old_pos]);
+      if (!old_window || old_window->override_redirect ||
+          old_window->unmanaging)
         {
           old_pos--;
           continue;
         }
 
-      meta_stack_tracker_lower_below (tracker, managed[new_pos], managed[new_pos + 1]);
+      meta_stack_tracker_lower_below (tracker, managed[new_pos],
+                                      managed[new_pos + 1]);
       meta_stack_tracker_get_stack (tracker, &windows, &n_windows);
-      /* Moving managed[new_pos] above windows[old_pos] moves the window at old_pos down by one,
+      /* Moving managed[new_pos] above windows[old_pos] moves the window at
+       * old_pos down by one,
        * we'll examine it again to see if it matches the next new window */
       old_pos--;
       new_pos--;
@@ -1184,7 +1218,8 @@ meta_stack_tracker_restack_managed (MetaStackTracker *tracker,
 
   while (new_pos > 0)
     {
-      meta_stack_tracker_lower_below (tracker, managed[new_pos], managed[new_pos - 1]);
+      meta_stack_tracker_lower_below (tracker, managed[new_pos],
+                                      managed[new_pos - 1]);
       new_pos--;
     }
 }
@@ -1207,7 +1242,8 @@ meta_stack_tracker_restack_at_bottom (MetaStackTracker *tracker,
           if (pos == 0)
             meta_stack_tracker_lower (tracker, new_order[pos]);
           else
-            meta_stack_tracker_raise_above (tracker, new_order[pos], new_order[pos - 1]);
+            meta_stack_tracker_raise_above (tracker, new_order[pos],
+                                            new_order[pos - 1]);
 
           meta_stack_tracker_get_stack (tracker, &windows, &n_windows);
         }
diff --git a/src/core/stack.c b/src/core/stack.c
index 28fd94c54..0dcfe6e96 100644
--- a/src/core/stack.c
+++ b/src/core/stack.c
@@ -43,11 +43,11 @@
 #include "x11/meta-x11-display-private.h"
 
 #define WINDOW_HAS_TRANSIENT_TYPE(w)                    \
-          (w->type == META_WINDOW_DIALOG ||             \
-          w->type == META_WINDOW_MODAL_DIALOG ||       \
-           w->type == META_WINDOW_TOOLBAR ||            \
-           w->type == META_WINDOW_MENU ||               \
-           w->type == META_WINDOW_UTILITY)
+  (w->type == META_WINDOW_DIALOG ||             \
+   w->type == META_WINDOW_MODAL_DIALOG ||       \
+   w->type == META_WINDOW_TOOLBAR ||            \
+   w->type == META_WINDOW_MENU ||               \
+   w->type == META_WINDOW_UTILITY)
 
 #define WINDOW_TRANSIENT_FOR_WHOLE_GROUP(w)                     \
   (WINDOW_HAS_TRANSIENT_TYPE (w) && w->transient_for == NULL)
@@ -57,9 +57,9 @@ static void meta_window_set_stack_position_no_sync (MetaWindow *window,
                                                     int         position);
 static void stack_do_window_deletions (MetaStack *stack);
 static void stack_do_window_additions (MetaStack *stack);
-static void stack_do_relayer          (MetaStack *stack);
-static void stack_do_constrain        (MetaStack *stack);
-static void stack_do_resort           (MetaStack *stack);
+static void stack_do_relayer (MetaStack *stack);
+static void stack_do_constrain (MetaStack *stack);
+static void stack_do_resort (MetaStack *stack);
 
 static void stack_ensure_sorted (MetaStack *stack);
 
@@ -107,7 +107,8 @@ meta_stack_add (MetaStack  *stack,
 
   g_return_if_fail (meta_window_is_stackable (window));
 
-  meta_topic (META_DEBUG_STACK, "Adding window %s to the stack\n", window->desc);
+  meta_topic (META_DEBUG_STACK, "Adding window %s to the stack\n",
+              window->desc);
 
   if (meta_window_is_in_stack (window))
     meta_bug ("Window %s had stack position already\n", window->desc);
@@ -121,7 +122,8 @@ meta_stack_add (MetaStack  *stack,
               window->desc, window->stack_position);
 
   stack_sync_to_xserver (stack);
-  meta_stack_update_window_tile_matches (stack, workspace_manager->active_workspace);
+  meta_stack_update_window_tile_matches (stack,
+                                         workspace_manager->active_workspace);
 }
 
 void
@@ -130,7 +132,8 @@ meta_stack_remove (MetaStack  *stack,
 {
   MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
 
-  meta_topic (META_DEBUG_STACK, "Removing window %s from the stack\n", window->desc);
+  meta_topic (META_DEBUG_STACK, "Removing window %s from the stack\n",
+              window->desc);
 
   /* Set window to top position, so removing it will not leave gaps
    * in the set of positions
@@ -155,11 +158,13 @@ meta_stack_remove (MetaStack  *stack,
                                        GUINT_TO_POINTER (window->xwindow));
       if (window->frame)
         stack->removed = g_list_prepend (stack->removed,
-                                         GUINT_TO_POINTER (window->frame->xwindow));
+                                         GUINT_TO_POINTER (window->frame->
+                                                           xwindow));
     }
 
   stack_sync_to_xserver (stack);
-  meta_stack_update_window_tile_matches (stack, workspace_manager->active_workspace);
+  meta_stack_update_window_tile_matches (stack,
+                                         workspace_manager->active_workspace);
 }
 
 void
@@ -170,7 +175,8 @@ meta_stack_update_layer (MetaStack  *stack,
   stack->need_relayer = TRUE;
 
   stack_sync_to_xserver (stack);
-  meta_stack_update_window_tile_matches (stack, workspace_manager->active_workspace);
+  meta_stack_update_window_tile_matches (stack,
+                                         workspace_manager->active_workspace);
 }
 
 void
@@ -181,7 +187,8 @@ meta_stack_update_transient (MetaStack  *stack,
   stack->need_constrain = TRUE;
 
   stack_sync_to_xserver (stack);
-  meta_stack_update_window_tile_matches (stack, workspace_manager->active_workspace);
+  meta_stack_update_window_tile_matches (stack,
+                                         workspace_manager->active_workspace);
 }
 
 /* raise/lower within a layer */
@@ -211,7 +218,8 @@ meta_stack_raise (MetaStack  *stack,
   meta_window_set_stack_position_no_sync (window, max_stack_position);
 
   stack_sync_to_xserver (stack);
-  meta_stack_update_window_tile_matches (stack, workspace_manager->active_workspace);
+  meta_stack_update_window_tile_matches (stack,
+                                         workspace_manager->active_workspace);
 }
 
 void
@@ -240,7 +248,8 @@ meta_stack_lower (MetaStack  *stack,
   meta_window_set_stack_position_no_sync (window, min_stack_position);
 
   stack_sync_to_xserver (stack);
-  meta_stack_update_window_tile_matches (stack, workspace_manager->active_workspace);
+  meta_stack_update_window_tile_matches (stack,
+                                         workspace_manager->active_workspace);
 }
 
 void
@@ -373,7 +382,7 @@ compute_layer (MetaWindow *window)
    * fullscreen.
    */
   if (window->layer != META_LAYER_DESKTOP &&
-      WINDOW_HAS_TRANSIENT_TYPE(window) &&
+      WINDOW_HAS_TRANSIENT_TYPE (window) &&
       window->transient_for == NULL)
     {
       /* We only do the group thing if the dialog is NOT transient for
@@ -395,7 +404,8 @@ compute_layer (MetaWindow *window)
         }
     }
 
-  meta_topic (META_DEBUG_STACK, "Window %s on layer %u type = %u has_focus = %d\n",
+  meta_topic (META_DEBUG_STACK,
+              "Window %s on layer %u type = %u has_focus = %d\n",
               window->desc, window->layer,
               window->type, window->has_focus);
 }
@@ -535,7 +545,8 @@ create_constraints (Constraint **constraints,
 
       if (!meta_window_is_in_stack (w))
         {
-          meta_topic (META_DEBUG_STACK, "Window %s not in the stack, not constraining it\n",
+          meta_topic (META_DEBUG_STACK,
+                      "Window %s not in the stack, not constraining it\n",
                       w->desc);
           tmp = tmp->next;
           continue;
@@ -570,18 +581,20 @@ create_constraints (Constraint **constraints,
 #if 0
               /* old way of doing it */
               if (!(meta_window_is_ancestor_of_transient (w, group_window)) &&
-                  !WINDOW_TRANSIENT_FOR_WHOLE_GROUP (group_window))  /* note */;/*note*/
+                  !WINDOW_TRANSIENT_FOR_WHOLE_GROUP (group_window))  /* note */
+                ;                                                               /*note*/
 #else
               /* better way I think, so transient-for-group are constrained
                * only above non-transient-type windows in their group
                */
               if (!WINDOW_HAS_TRANSIENT_TYPE (group_window))
 #endif
-                {
-                  meta_topic (META_DEBUG_STACK, "Constraining %s above %s as it's transient for its group\n",
-                              w->desc, group_window->desc);
-                  add_constraint (constraints, w, group_window);
-                }
+              {
+                meta_topic (META_DEBUG_STACK,
+                            "Constraining %s above %s as it's transient for its group\n",
+                            w->desc, group_window->desc);
+                add_constraint (constraints, w, group_window);
+              }
 
               tmp2 = tmp2->next;
             }
@@ -596,7 +609,8 @@ create_constraints (Constraint **constraints,
 
           if (parent && meta_window_is_in_stack (parent))
             {
-              meta_topic (META_DEBUG_STACK, "Constraining %s above %s due to transiency\n",
+              meta_topic (META_DEBUG_STACK,
+                          "Constraining %s above %s due to transiency\n",
                           w->desc, parent->desc);
               add_constraint (constraints, w, parent);
             }
@@ -680,12 +694,12 @@ static void
 ensure_above (MetaWindow *above,
               MetaWindow *below)
 {
-  if (WINDOW_HAS_TRANSIENT_TYPE(above) &&
+  if (WINDOW_HAS_TRANSIENT_TYPE (above) &&
       above->layer < below->layer)
     {
       meta_topic (META_DEBUG_STACK,
-                 "Promoting window %s from layer %u to %u due to contraint\n",
-                 above->desc, above->layer, below->layer);
+                  "Promoting window %s from layer %u to %u due to contraint\n",
+                  above->desc, above->layer, below->layer);
       above->layer = below->layer;
     }
 
@@ -803,7 +817,7 @@ stack_do_window_deletions (MetaStack *stack)
             }
         }
 
-    next:
+next:
       tmp = tmp->next;
     }
 
@@ -920,7 +934,7 @@ stack_do_constrain (MetaStack *stack)
   meta_topic (META_DEBUG_STACK,
               "Reapplying constraints\n");
 
-  constraints = g_new0 (Constraint*,
+  constraints = g_new0 (Constraint *,
                         stack->n_positions);
 
   create_constraints (constraints, stack->sorted);
@@ -1017,7 +1031,7 @@ stack_sync_to_xserver (MetaStack *stack)
   meta_topic (META_DEBUG_STACK, "Bottom to top: ");
   meta_push_no_msg_prefix ();
 
-  for (tmp = g_list_last(stack->sorted); tmp != NULL; tmp = tmp->prev)
+  for (tmp = g_list_last (stack->sorted); tmp != NULL; tmp = tmp->prev)
     {
       MetaWindow *w = tmp->data;
       guint64 top_level_window;
@@ -1027,15 +1041,15 @@ stack_sync_to_xserver (MetaStack *stack)
         continue;
 
       meta_topic (META_DEBUG_STACK, "%u:%d - %s ",
-                 w->layer, w->stack_position, w->desc);
+                  w->layer, w->stack_position, w->desc);
 
       if (w->client_type == META_WINDOW_CLIENT_TYPE_X11)
         g_array_append_val (x11_stacked, w->xwindow);
 
       if (w->frame)
-       top_level_window = w->frame->xwindow;
+        top_level_window = w->frame->xwindow;
       else
-       top_level_window = w->xwindow;
+        top_level_window = w->xwindow;
 
       if (w->client_type == META_WINDOW_CLIENT_TYPE_X11)
         stack_id = top_level_window;
@@ -1046,10 +1060,10 @@ stack_sync_to_xserver (MetaStack *stack)
        * reflected in the _NET hints. Hidden windows all get pushed below
        * the screens fullscreen guard_window. */
       if (w->hidden)
-       {
+        {
           g_array_append_val (hidden_stack_ids, stack_id);
-         continue;
-       }
+          continue;
+        }
 
       g_array_append_val (all_root_children_stacked, stack_id);
     }
@@ -1068,10 +1082,10 @@ stack_sync_to_xserver (MetaStack *stack)
               all_root_children_stacked->len);
 
   meta_stack_tracker_restack_managed (stack->display->stack_tracker,
-                                      (guint64 *)all_root_children_stacked->data,
+                                      (guint64 *) all_root_children_stacked->data,
                                       all_root_children_stacked->len);
   meta_stack_tracker_restack_at_bottom (stack->display->stack_tracker,
-                                        (guint64 *)hidden_stack_ids->data,
+                                        (guint64 *) hidden_stack_ids->data,
                                         hidden_stack_ids->len);
 
   /* Sync _NET_CLIENT_LIST and _NET_CLIENT_LIST_STACKING */
@@ -1081,14 +1095,14 @@ stack_sync_to_xserver (MetaStack *stack)
                    stack->display->x11_display->atom__NET_CLIENT_LIST,
                    XA_WINDOW,
                    32, PropModeReplace,
-                   (unsigned char *)stack->xwindows->data,
+                   (unsigned char *) stack->xwindows->data,
                    stack->xwindows->len);
   XChangeProperty (stack->display->x11_display->xdisplay,
                    stack->display->x11_display->xroot,
                    stack->display->x11_display->atom__NET_CLIENT_LIST_STACKING,
                    XA_WINDOW,
                    32, PropModeReplace,
-                   (unsigned char *)x11_stacked->data,
+                   (unsigned char *) x11_stacked->data,
                    x11_stacked->len);
 
   g_array_free (x11_stacked, TRUE);
@@ -1096,7 +1110,7 @@ stack_sync_to_xserver (MetaStack *stack)
   g_array_free (all_root_children_stacked, TRUE);
 }
 
-MetaWindow*
+MetaWindow *
 meta_stack_get_top (MetaStack *stack)
 {
   stack_ensure_sorted (stack);
@@ -1107,8 +1121,8 @@ meta_stack_get_top (MetaStack *stack)
     return NULL;
 }
 
-MetaWindow*
-meta_stack_get_bottom (MetaStack  *stack)
+MetaWindow *
+meta_stack_get_bottom (MetaStack *stack)
 {
   GList *link;
 
@@ -1121,10 +1135,10 @@ meta_stack_get_bottom (MetaStack  *stack)
     return NULL;
 }
 
-MetaWindow*
-meta_stack_get_above (MetaStack      *stack,
-                      MetaWindow     *window,
-                      gboolean        only_within_layer)
+MetaWindow *
+meta_stack_get_above (MetaStack  *stack,
+                      MetaWindow *window,
+                      gboolean    only_within_layer)
 {
   GList *link;
   MetaWindow *above;
@@ -1146,10 +1160,10 @@ meta_stack_get_above (MetaStack      *stack,
     return above;
 }
 
-MetaWindow*
-meta_stack_get_below (MetaStack      *stack,
-                      MetaWindow     *window,
-                      gboolean        only_within_layer)
+MetaWindow *
+meta_stack_get_below (MetaStack  *stack,
+                      MetaWindow *window,
+                      gboolean    only_within_layer)
 {
   GList *link;
   MetaWindow *below;
@@ -1184,7 +1198,7 @@ window_contains_point (MetaWindow *window,
   return POINT_IN_RECT (root_x, root_y, rect);
 }
 
-static MetaWindow*
+static MetaWindow *
 get_default_focus_window (MetaStack     *stack,
                           MetaWorkspace *workspace,
                           MetaWindow    *not_this_one,
@@ -1235,7 +1249,7 @@ get_default_focus_window (MetaStack     *stack,
   return NULL;
 }
 
-MetaWindow*
+MetaWindow *
 meta_stack_get_default_focus_window_at_point (MetaStack     *stack,
                                               MetaWorkspace *workspace,
                                               MetaWindow    *not_this_one,
@@ -1246,7 +1260,7 @@ meta_stack_get_default_focus_window_at_point (MetaStack     *stack,
                                    TRUE, root_x, root_y);
 }
 
-MetaWindow*
+MetaWindow *
 meta_stack_get_default_focus_window (MetaStack     *stack,
                                      MetaWorkspace *workspace,
                                      MetaWindow    *not_this_one)
@@ -1255,7 +1269,7 @@ meta_stack_get_default_focus_window (MetaStack     *stack,
                                    FALSE, 0, 0);
 }
 
-GList*
+GList *
 meta_stack_list_windows (MetaStack     *stack,
                          MetaWorkspace *workspace)
 {
@@ -1271,7 +1285,8 @@ meta_stack_list_windows (MetaStack     *stack,
       MetaWindow *window = link->data;
 
       if (window &&
-          (workspace == NULL || meta_window_located_on_workspace (window, workspace)))
+          (workspace == NULL ||
+           meta_window_located_on_workspace (window, workspace)))
         {
           workspace_windows = g_list_prepend (workspace_windows,
                                               window);
@@ -1319,7 +1334,7 @@ compare_just_window_stack_position (void *a,
     return 0; /* not reached */
 }
 
-GList*
+GList *
 meta_stack_get_positions (MetaStack *stack)
 {
   GList *tmp;
diff --git a/src/core/startup-notification.c b/src/core/startup-notification.c
index 88348f583..df06baa30 100644
--- a/src/core/startup-notification.c
+++ b/src/core/startup-notification.c
@@ -39,22 +39,26 @@
 #define STARTUP_TIMEOUT 15000000
 
 typedef struct _MetaStartupNotificationSequence MetaStartupNotificationSequence;
-typedef struct _MetaStartupNotificationSequenceClass MetaStartupNotificationSequenceClass;
+typedef struct _MetaStartupNotificationSequenceClass
+  MetaStartupNotificationSequenceClass;
 
-enum {
+enum
+{
   PROP_SN_0,
   PROP_SN_DISPLAY,
   N_SN_PROPS
 };
 
-enum {
+enum
+{
   PROP_SEQ_0,
   PROP_SEQ_ID,
   PROP_SEQ_TIMESTAMP,
   N_SEQ_PROPS
 };
 
-enum {
+enum
+{
   SN_CHANGED,
   N_SN_SIGNALS
 };
@@ -91,15 +95,17 @@ G_DECLARE_DERIVABLE_TYPE (MetaStartupNotificationSequence,
                           META, STARTUP_NOTIFICATION_SEQUENCE,
                           GObject)
 
-typedef struct {
+typedef struct
+{
   gchar *id;
   gint64 timestamp;
 } MetaStartupNotificationSequencePrivate;
 
-struct _MetaStartupNotificationSequenceClass {
+struct _MetaStartupNotificationSequenceClass
+{
   GObjectClass parent_class;
 
-  void (* complete) (MetaStartupNotificationSequence *sequence);
+  void (*complete) (MetaStartupNotificationSequence *sequence);
 };
 
 G_DEFINE_TYPE (MetaStartupNotification,
@@ -111,13 +117,15 @@ G_DEFINE_TYPE_WITH_PRIVATE (MetaStartupNotificationSequence,
 
 #ifdef HAVE_STARTUP_NOTIFICATION
 
-enum {
+enum
+{
   PROP_SEQ_X11_0,
   PROP_SEQ_X11_SEQ,
   N_SEQ_X11_PROPS
 };
 
-struct _MetaStartupNotificationSequenceX11 {
+struct _MetaStartupNotificationSequenceX11
+{
   MetaStartupNotificationSequence parent_instance;
   SnStartupSequence *seq;
 };
@@ -136,7 +144,8 @@ G_DEFINE_TYPE (MetaStartupNotificationSequenceX11,
                meta_startup_notification_sequence_x11,
                META_TYPE_STARTUP_NOTIFICATION_SEQUENCE)
 
-static void meta_startup_notification_ensure_timeout  (MetaStartupNotification *sn);
+static void meta_startup_notification_ensure_timeout (
+  MetaStartupNotification *sn);
 
 #endif
 
@@ -174,7 +183,8 @@ meta_startup_notification_sequence_finalize (GObject *object)
   priv = meta_startup_notification_sequence_get_instance_private (seq);
   g_free (priv->id);
 
-  G_OBJECT_CLASS (meta_startup_notification_sequence_parent_class)->finalize (object);
+  G_OBJECT_CLASS (meta_startup_notification_sequence_parent_class)->finalize (
+    object);
 }
 
 static void
@@ -230,7 +240,8 @@ meta_startup_notification_sequence_get_property (GObject    *object,
 }
 
 static void
-meta_startup_notification_sequence_class_init (MetaStartupNotificationSequenceClass *klass)
+meta_startup_notification_sequence_class_init (
+  MetaStartupNotificationSequenceClass *klass)
 {
   GObjectClass *object_class;
 
@@ -268,7 +279,8 @@ meta_startup_notification_sequence_get_id (MetaStartupNotificationSequence *seq)
 
 #ifdef HAVE_STARTUP_NOTIFICATION
 static gint64
-meta_startup_notification_sequence_get_timestamp (MetaStartupNotificationSequence *seq)
+meta_startup_notification_sequence_get_timestamp (
+  MetaStartupNotificationSequence *seq)
 {
   MetaStartupNotificationSequencePrivate *priv;
 
@@ -277,7 +289,8 @@ meta_startup_notification_sequence_get_timestamp (MetaStartupNotificationSequenc
 }
 
 static void
-meta_startup_notification_sequence_complete (MetaStartupNotificationSequence *seq)
+meta_startup_notification_sequence_complete (
+  MetaStartupNotificationSequence *seq)
 {
   MetaStartupNotificationSequenceClass *klass;
 
@@ -290,7 +303,8 @@ meta_startup_notification_sequence_complete (MetaStartupNotificationSequence *se
 
 #ifdef HAVE_STARTUP_NOTIFICATION
 static void
-meta_startup_notification_sequence_x11_complete (MetaStartupNotificationSequence *seq)
+meta_startup_notification_sequence_x11_complete (
+  MetaStartupNotificationSequence *seq)
 {
   MetaStartupNotificationSequenceX11 *seq_x11;
 
@@ -306,7 +320,8 @@ meta_startup_notification_sequence_x11_finalize (GObject *object)
   seq = META_STARTUP_NOTIFICATION_SEQUENCE_X11 (object);
   sn_startup_sequence_unref (seq->seq);
 
-  G_OBJECT_CLASS (meta_startup_notification_sequence_x11_parent_class)->finalize (object);
+  G_OBJECT_CLASS (meta_startup_notification_sequence_x11_parent_class)->finalize (
+    object);
 }
 
 static void
@@ -353,12 +368,14 @@ meta_startup_notification_sequence_x11_get_property (GObject    *object,
 }
 
 static void
-meta_startup_notification_sequence_x11_init (MetaStartupNotificationSequenceX11 *seq)
+meta_startup_notification_sequence_x11_init (
+  MetaStartupNotificationSequenceX11 *seq)
 {
 }
 
 static void
-meta_startup_notification_sequence_x11_class_init (MetaStartupNotificationSequenceX11Class *klass)
+meta_startup_notification_sequence_x11_class_init (
+  MetaStartupNotificationSequenceX11Class *klass)
 {
   MetaStartupNotificationSequenceClass *seq_class;
   GObjectClass *object_class;
@@ -368,8 +385,10 @@ meta_startup_notification_sequence_x11_class_init (MetaStartupNotificationSequen
 
   object_class = G_OBJECT_CLASS (klass);
   object_class->finalize = meta_startup_notification_sequence_x11_finalize;
-  object_class->set_property = meta_startup_notification_sequence_x11_set_property;
-  object_class->get_property = meta_startup_notification_sequence_x11_get_property;
+  object_class->set_property =
+    meta_startup_notification_sequence_x11_set_property;
+  object_class->get_property =
+    meta_startup_notification_sequence_x11_get_property;
 
   seq_x11_props[PROP_SEQ_X11_SEQ] =
     g_param_spec_pointer ("seq",
@@ -396,8 +415,9 @@ meta_startup_notification_sequence_x11_new (SnStartupSequence *seq)
 }
 
 static void
-meta_startup_notification_add_sequence_internal (MetaStartupNotification         *sn,
-                                                 MetaStartupNotificationSequence *seq)
+meta_startup_notification_add_sequence_internal (
+  MetaStartupNotification         *sn,
+  MetaStartupNotificationSequence *seq)
 {
   sn->startup_sequences = g_slist_prepend (sn->startup_sequences,
                                            g_object_ref (seq));
@@ -482,8 +502,9 @@ meta_startup_notification_ensure_timeout (MetaStartupNotification *sn)
 #endif
 
 static void
-meta_startup_notification_remove_sequence_internal (MetaStartupNotification         *sn,
-                                                    MetaStartupNotificationSequence *seq)
+meta_startup_notification_remove_sequence_internal (
+  MetaStartupNotification         *sn,
+  MetaStartupNotificationSequence *seq)
 {
   sn->startup_sequences = g_slist_remove (sn->startup_sequences, seq);
   meta_startup_notification_update_feedback (sn);
@@ -612,31 +633,32 @@ meta_startup_notification_sn_event (SnMonitorEvent *event,
   switch (sn_monitor_event_get_type (event))
     {
     case SN_MONITOR_EVENT_INITIATED:
-      {
-        const char *wmclass;
+    {
+      const char *wmclass;
 
-        wmclass = sn_startup_sequence_get_wmclass (sequence);
+      wmclass = sn_startup_sequence_get_wmclass (sequence);
 
-        meta_topic (META_DEBUG_STARTUP,
-                    "Received startup initiated for %s wmclass %s\n",
-                    sn_startup_sequence_get_id (sequence),
-                    wmclass ? wmclass : "(unset)");
+      meta_topic (META_DEBUG_STARTUP,
+                  "Received startup initiated for %s wmclass %s\n",
+                  sn_startup_sequence_get_id (sequence),
+                  wmclass ? wmclass : "(unset)");
 
-        seq = meta_startup_notification_sequence_x11_new (sequence);
-        meta_startup_notification_add_sequence_internal (sn, seq);
-        g_object_unref (seq);
-      }
-      break;
+      seq = meta_startup_notification_sequence_x11_new (sequence);
+      meta_startup_notification_add_sequence_internal (sn, seq);
+      g_object_unref (seq);
+    }
+    break;
 
     case SN_MONITOR_EVENT_COMPLETED:
-      {
-        meta_topic (META_DEBUG_STARTUP,
-                    "Received startup completed for %s\n",
-                    sn_startup_sequence_get_id (sequence));
+    {
+      meta_topic (META_DEBUG_STARTUP,
+                  "Received startup completed for %s\n",
+                  sn_startup_sequence_get_id (sequence));
 
-        meta_startup_notification_remove_sequence (sn, sn_startup_sequence_get_id (sequence));
-      }
-      break;
+      meta_startup_notification_remove_sequence (sn, sn_startup_sequence_get_id (
+                                                   sequence));
+    }
+    break;
 
     case SN_MONITOR_EVENT_CHANGED:
       meta_topic (META_DEBUG_STARTUP,
@@ -696,7 +718,7 @@ meta_startup_notification_constructed (GObject *object)
   sn->sn_context = NULL;
 
   g_signal_connect_object (sn->display,
-                          "x11-display-opened",
+                           "x11-display-opened",
                            G_CALLBACK (on_x11_display_opened),
                            sn,
                            G_CONNECT_SWAPPED);
diff --git a/src/core/util.c b/src/core/util.c
index 5febb0edf..1992555f5 100644
--- a/src/core/util.c
+++ b/src/core/util.c
@@ -46,7 +46,7 @@
 static void
 meta_topic_real_valist (MetaDebugTopic topic,
                         const char    *format,
-                        va_list        args) G_GNUC_PRINTF(2, 0);
+                        va_list        args) G_GNUC_PRINTF (2, 0);
 #endif
 
 static gboolean
@@ -59,7 +59,7 @@ static int no_prefix = 0;
 static gboolean is_wayland_compositor = FALSE;
 
 #ifdef WITH_VERBOSE_MODE
-static FILE* logfile = NULL;
+static FILE *logfile = NULL;
 
 static void
 ensure_logfile (void)
@@ -250,7 +250,7 @@ void
 meta_free_gslist_and_elements (GSList *list_to_deep_free)
 {
   g_slist_foreach (list_to_deep_free,
-                   (void (*)(gpointer,gpointer))&g_free, /* ew, for ugly */
+                   (void (*)(gpointer, gpointer)) & g_free, /* ew, for ugly */
                    NULL);
   g_slist_free (list_to_deep_free);
 }
@@ -297,7 +297,7 @@ meta_verbose_real (const char *format, ...)
 #endif /* WITH_VERBOSE_MODE */
 
 #ifdef WITH_VERBOSE_MODE
-static const char*
+static const char *
 topic_name (MetaDebugTopic topic)
 {
   switch (topic)
@@ -394,7 +394,7 @@ meta_topic_real_valist (MetaDebugTopic topic,
 
 void
 meta_topic_real (MetaDebugTopic topic,
-                 const char *format,
+                 const char    *format,
                  ...)
 {
   va_list args;
@@ -513,7 +513,6 @@ meta_pop_no_msg_prefix (void)
 void
 meta_exit (MetaExitCode code)
 {
-
   exit (code);
 }
 
@@ -521,13 +520,13 @@ gint
 meta_unsigned_long_equal (gconstpointer v1,
                           gconstpointer v2)
 {
-  return *((const gulong*) v1) == *((const gulong*) v2);
+  return *((const gulong *) v1) == *((const gulong *) v2);
 }
 
 guint
 meta_unsigned_long_hash  (gconstpointer v)
 {
-  gulong val = * (const gulong *) v;
+  gulong val = *(const gulong *) v;
 
   /* I'm not sure this works so well. */
 #if GLIB_SIZEOF_LONG > 4
@@ -537,7 +536,7 @@ meta_unsigned_long_hash  (gconstpointer v)
 #endif
 }
 
-const char*
+const char *
 meta_gravity_to_string (int gravity)
 {
   switch (gravity)
@@ -578,7 +577,7 @@ meta_gravity_to_string (int gravity)
     }
 }
 
-char*
+char *
 meta_external_binding_name_for_action (guint keybinding_action)
 {
   return g_strdup_printf ("external-grab-%u", keybinding_action);
@@ -625,9 +624,9 @@ meta_show_dialog (const char *type,
                   const char *ok_text,
                   const char *cancel_text,
                   const char *icon_name,
-                  const int transient_for,
-                  GSList *columns,
-                  GSList *entries)
+                  const int   transient_for,
+                  GSList     *columns,
+                  GSList     *entries)
 {
   GError *error = NULL;
   GSList *tmp;
@@ -662,7 +661,7 @@ meta_show_dialog (const char *type,
     {
       append_argument (args, "--ok-label");
       append_argument (args, ok_text);
-     }
+    }
 
   if (cancel_text)
     {
@@ -693,7 +692,7 @@ meta_show_dialog (const char *type,
 
   if (transient_for)
     {
-      gchar *env = g_strdup_printf("%d", transient_for);
+      gchar *env = g_strdup_printf ("%d", transient_for);
       setenv ("WINDOWID", env, 1);
       g_free (env);
 
@@ -703,14 +702,14 @@ meta_show_dialog (const char *type,
   g_ptr_array_add (args, NULL); /* NULL-terminate */
 
   g_spawn_async (
-                 "/",
-                 (gchar**) args->pdata,
-                 NULL,
-                 G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD,
-                 NULL, NULL,
-                 &child_pid,
-                 &error
-                 );
+    "/",
+    (gchar **) args->pdata,
+    NULL,
+    G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD,
+    NULL, NULL,
+    &child_pid,
+    &error
+    );
 
   if (transient_for)
     unsetenv ("WINDOWID");
@@ -744,7 +743,8 @@ typedef struct
   gboolean run_once;
 } MetaLater;
 
-static GSList *laters[] = {
+static GSList *laters[] =
+{
   NULL, /* META_LATER_RESIZE */
   NULL, /* META_LATER_CALC_SHOWING */
   NULL, /* META_LATER_CHECK_FULLSCREEN */
@@ -852,8 +852,9 @@ ensure_later_repaint_func (void)
     later_timeline = clutter_timeline_new (G_MAXUINT);
 
   if (later_repaint_func == 0)
-    later_repaint_func = clutter_threads_add_repaint_func (run_all_repaint_laters,
-                                                           NULL, NULL);
+    later_repaint_func = clutter_threads_add_repaint_func (
+      run_all_repaint_laters,
+      NULL, NULL);
 
   /* Make sure the repaint function gets run */
   clutter_timeline_start (later_timeline);
@@ -878,13 +879,16 @@ call_idle_later (gpointer data)
 
 /**
  * meta_later_add:
- * @when:     enumeration value determining the phase at which to run the callback
+ * @when:     enumeration value determining the phase at which to run the
+ *callback
  * @func:     callback to run later
  * @data:     data to pass to the callback
- * @notify:   function to call to destroy @data when it is no longer in use, or %NULL
+ * @notify:   function to call to destroy @data when it is no longer in use, or
+ *%NULL
  *
  * Sets up a callback  to be called at some later time. @when determines the
- * particular later occasion at which it is called. This is much like g_idle_add(),
+ * particular later occasion at which it is called. This is much like
+ *g_idle_add(),
  * except that the functions interact properly with clutter event handling.
  * If a "later" function is added from a clutter event handler, and is supposed
  * to be run before the stage is redrawn, it will be run before that redraw
@@ -921,7 +925,8 @@ meta_later_add (MetaLaterType  when,
        * handler will get hit first and we want to call this function
        * there so it will happen before GTK+ repaints.
        */
-      later->source = g_idle_add_full (META_PRIORITY_RESIZE, call_idle_later, later, NULL);
+      later->source = g_idle_add_full (META_PRIORITY_RESIZE, call_idle_later,
+                                       later, NULL);
       g_source_set_name_by_id (later->source, "[mutter] call_idle_later");
       ensure_later_repaint_func ();
       break;
@@ -932,7 +937,8 @@ meta_later_add (MetaLaterType  when,
       ensure_later_repaint_func ();
       break;
     case META_LATER_IDLE:
-      later->source = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, call_idle_later, later, NULL);
+      later->source = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, call_idle_later,
+                                       later, NULL);
       g_source_set_name_by_id (later->source, "[mutter] call_idle_later");
       break;
     }
@@ -1012,4 +1018,3 @@ meta_generate_random_id (GRand *rand,
 }
 
 /* eof util.c */
-
diff --git a/src/core/window.c b/src/core/window.c
index 4d9e51d8c..a3b6793ad 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -81,40 +81,40 @@ static int destroying_windows_disallowed = 0;
  * start after the end of the XID space so that, for stacking
  * we can keep a guint64 that represents one or the other
  */
-static guint64 next_window_stamp = G_GUINT64_CONSTANT(0x100000000);
+static guint64 next_window_stamp = G_GUINT64_CONSTANT (0x100000000);
 
-static void     invalidate_work_areas     (MetaWindow     *window);
-static void     set_wm_state              (MetaWindow     *window);
-static void     set_net_wm_state          (MetaWindow     *window);
-static void     meta_window_set_above     (MetaWindow     *window,
-                                           gboolean        new_value);
+static void     invalidate_work_areas (MetaWindow *window);
+static void     set_wm_state (MetaWindow *window);
+static void     set_net_wm_state (MetaWindow *window);
+static void     meta_window_set_above (MetaWindow *window,
+                                       gboolean    new_value);
 
-static void     meta_window_show          (MetaWindow     *window);
-static void     meta_window_hide          (MetaWindow     *window);
+static void     meta_window_show (MetaWindow *window);
+static void     meta_window_hide (MetaWindow *window);
 
-static void     meta_window_save_rect         (MetaWindow    *window);
+static void     meta_window_save_rect (MetaWindow *window);
 
 static void     ensure_mru_position_after (MetaWindow *window,
                                            MetaWindow *after_this_one);
 
-static void meta_window_move_resize_now (MetaWindow  *window);
+static void meta_window_move_resize_now (MetaWindow *window);
 
 static void meta_window_unqueue (MetaWindow *window, guint queuebits);
 
-static void     update_move           (MetaWindow   *window,
-                                       gboolean      snap,
-                                       int           x,
-                                       int           y);
-static gboolean update_move_timeout   (gpointer data);
-static void     update_resize         (MetaWindow   *window,
-                                       gboolean      snap,
-                                       int           x,
-                                       int           y,
-                                       gboolean      force);
+static void     update_move (MetaWindow *window,
+                             gboolean    snap,
+                             int         x,
+                             int         y);
+static gboolean update_move_timeout (gpointer data);
+static void     update_resize (MetaWindow *window,
+                               gboolean    snap,
+                               int         x,
+                               int         y,
+                               gboolean    force);
 static gboolean update_resize_timeout (gpointer data);
 static gboolean should_be_on_all_workspaces (MetaWindow *window);
 
-static void meta_window_flush_calc_showing   (MetaWindow *window);
+static void meta_window_flush_calc_showing (MetaWindow *window);
 
 static gboolean queue_calc_showing_func (MetaWindow *window,
                                          void       *data);
@@ -124,7 +124,7 @@ static void meta_window_move_between_rects (MetaWindow          *window,
                                             const MetaRectangle *old_area,
                                             const MetaRectangle *new_area);
 
-static void unmaximize_window_before_freeing (MetaWindow        *window);
+static void unmaximize_window_before_freeing (MetaWindow *window);
 static void unminimize_window_and_all_transient_parents (MetaWindow *window);
 
 static void meta_window_propagate_focus_appearance (MetaWindow *window,
@@ -136,8 +136,8 @@ static void set_workspace_state (MetaWindow    *window,
                                  gboolean       on_all_workspaces,
                                  MetaWorkspace *workspace);
 
-static MetaWindow * meta_window_find_tile_match (MetaWindow   *window,
-                                                 MetaTileMode  mode);
+static MetaWindow *meta_window_find_tile_match (MetaWindow  *window,
+                                                MetaTileMode mode);
 static void update_edge_constraints (MetaWindow *window);
 
 /* Idle handlers for the three queues (run with meta_later_add()). The
@@ -153,7 +153,8 @@ static gboolean idle_update_icon (gpointer data);
 
 G_DEFINE_ABSTRACT_TYPE (MetaWindow, meta_window, G_TYPE_OBJECT);
 
-enum {
+enum
+{
   PROP_0,
 
   PROP_TITLE,
@@ -318,10 +319,10 @@ meta_window_finalize (GObject *object)
 }
 
 static void
-meta_window_get_property(GObject         *object,
-                         guint            prop_id,
-                         GValue          *value,
-                         GParamSpec      *pspec)
+meta_window_get_property(GObject    *object,
+                         guint       prop_id,
+                         GValue     *value,
+                         GParamSpec *pspec)
 {
   MetaWindow *win = META_WINDOW (object);
 
@@ -409,10 +410,10 @@ meta_window_get_property(GObject         *object,
 }
 
 static void
-meta_window_set_property(GObject         *object,
-                         guint            prop_id,
-                         const GValue    *value,
-                         GParamSpec      *pspec)
+meta_window_set_property(GObject      *object,
+                         guint         prop_id,
+                         const GValue *value,
+                         GParamSpec   *pspec)
 {
   switch (prop_id)
     {
@@ -723,8 +724,9 @@ maybe_leave_show_desktop_mode (MetaWindow *window)
 
   if (!is_desktop_or_dock)
     {
-      meta_workspace_manager_minimize_all_on_active_workspace_except (workspace_manager,
-                                                                      window);
+      meta_workspace_manager_minimize_all_on_active_workspace_except (
+        workspace_manager,
+        window);
       meta_workspace_manager_unshow_desktop (workspace_manager);
     }
 }
@@ -786,7 +788,7 @@ sync_client_window_mapped (MetaWindow *window)
   else
     {
       XUnmapWindow (window->display->x11_display->xdisplay, window->xwindow);
-      window->unmaps_pending ++;
+      window->unmaps_pending++;
     }
   meta_x11_error_trap_pop (window->display->x11_display);
 }
@@ -795,7 +797,7 @@ static gboolean
 meta_window_update_flatpak_id (MetaWindow *window,
                                uint32_t    pid)
 {
-  g_autoptr(GKeyFile) key_file = NULL;
+  g_autoptr (GKeyFile) key_file = NULL;
   g_autofree char *info_filename = NULL;
 
   g_return_val_if_fail (pid != 0, FALSE);
@@ -804,10 +806,12 @@ meta_window_update_flatpak_id (MetaWindow *window,
   key_file = g_key_file_new ();
   info_filename = g_strdup_printf ("/proc/%u/root/.flatpak-info", pid);
 
-  if (!g_key_file_load_from_file (key_file, info_filename, G_KEY_FILE_NONE, NULL))
+  if (!g_key_file_load_from_file (key_file, info_filename, G_KEY_FILE_NONE,
+                                  NULL))
     return FALSE;
 
-  window->sandboxed_app_id = g_key_file_get_string (key_file, "Application", "name", NULL);
+  window->sandboxed_app_id = g_key_file_get_string (key_file, "Application",
+                                                    "name", NULL);
 
   return TRUE;
 }
@@ -842,7 +846,8 @@ meta_window_update_snap_id (MetaWindow *window,
    * while the desktop id will be name-space_binary-name.
    */
   security_label_contents_size -= sizeof (SNAP_SECURITY_LABEL_PREFIX) - 1;
-  contents_start = security_label_contents + sizeof (SNAP_SECURITY_LABEL_PREFIX) - 1;
+  contents_start = security_label_contents +
+                   sizeof (SNAP_SECURITY_LABEL_PREFIX) - 1;
   contents_end = strchr (contents_start, ' ');
 
   if (contents_end)
@@ -901,12 +906,13 @@ meta_window_update_desc (MetaWindow *window)
     }
   else
     {
-      guint64 small_stamp = window->stamp - G_GUINT64_CONSTANT(0x100000000);
+      guint64 small_stamp = window->stamp - G_GUINT64_CONSTANT (0x100000000);
 
       if (title)
-        window->desc = g_strdup_printf ("W%" G_GUINT64_FORMAT " (%s)", small_stamp, title);
+        window->desc = g_strdup_printf ("W%" G_GUINT64_FORMAT " (%s)",
+                                        small_stamp, title);
       else
-        window->desc = g_strdup_printf ("W%" G_GUINT64_FORMAT , small_stamp);
+        window->desc = g_strdup_printf ("W%" G_GUINT64_FORMAT, small_stamp);
     }
 }
 
@@ -961,7 +967,8 @@ _meta_window_shared_new (MetaDisplay         *display,
                 "IsUnviewable" :
                 "(unknown)");
 
-  if (client_type == META_WINDOW_CLIENT_TYPE_X11 && !meta_is_wayland_compositor ())
+  if (client_type == META_WINDOW_CLIENT_TYPE_X11 &&
+      !meta_is_wayland_compositor ())
     window = g_object_new (META_TYPE_WINDOW_X11, NULL);
 #ifdef HAVE_WAYLAND
   else if (client_type == META_WINDOW_CLIENT_TYPE_X11)
@@ -1051,7 +1058,8 @@ _meta_window_shared_new (MetaDisplay         *display,
   window->showing_for_first_time = !window->mapped;
   /* if already mapped we don't want to do the placement thing;
    * override-redirect windows are placed by the app */
-  window->placed = ((window->mapped && !window->hidden) || window->override_redirect);
+  window->placed =
+    ((window->mapped && !window->hidden) || window->override_redirect);
   window->denied_focus_and_not_transient = FALSE;
   window->unmanaging = FALSE;
   window->is_in_queues = 0;
@@ -1177,8 +1185,9 @@ _meta_window_shared_new (MetaDisplay         *display,
     {
       /* WM_STATE said minimized */
       window->minimized = TRUE;
-      meta_verbose ("Window %s had preexisting WM_STATE = IconicState, minimizing\n",
-                    window->desc);
+      meta_verbose (
+        "Window %s had preexisting WM_STATE = IconicState, minimizing\n",
+        window->desc);
 
       /* Assume window was previously placed, though perhaps it's
        * been iconic its whole life, we have no way of knowing.
@@ -1197,24 +1206,26 @@ _meta_window_shared_new (MetaDisplay         *display,
    * much we can do...except record the current time so that any children
    * can use this time as a fallback.
    */
-  if (!window->override_redirect && !window->net_wm_user_time_set) {
-    /* First, maybe the app was launched with startup notification using an
-     * obsolete version of the spec; use that timestamp if it exists.
-     */
-    if (window->initial_timestamp_set)
-      /* NOTE: Do NOT toggle net_wm_user_time_set to true; this is just
-       * being recorded as a fallback for potential transients
-       */
-      window->net_wm_user_time = window->initial_timestamp;
-    else if (window->transient_for != NULL)
-      meta_window_set_user_time (window, window->transient_for->net_wm_user_time);
-    else
-      /* NOTE: Do NOT toggle net_wm_user_time_set to true; this is just
-       * being recorded as a fallback for potential transients
+  if (!window->override_redirect && !window->net_wm_user_time_set)
+    {
+      /* First, maybe the app was launched with startup notification using an
+       * obsolete version of the spec; use that timestamp if it exists.
        */
-      window->net_wm_user_time =
-        meta_display_get_current_time_roundtrip (window->display);
-  }
+      if (window->initial_timestamp_set)
+        /* NOTE: Do NOT toggle net_wm_user_time_set to true; this is just
+         * being recorded as a fallback for potential transients
+         */
+        window->net_wm_user_time = window->initial_timestamp;
+      else if (window->transient_for != NULL)
+        meta_window_set_user_time (window,
+                                   window->transient_for->net_wm_user_time);
+      else
+        /* NOTE: Do NOT toggle net_wm_user_time_set to true; this is just
+         * being recorded as a fallback for potential transients
+         */
+        window->net_wm_user_time =
+          meta_display_get_current_time_roundtrip (window->display);
+    }
 
   window->attached = meta_window_should_attach_to_parent (window);
   if (window->attached)
@@ -1249,9 +1260,9 @@ _meta_window_shared_new (MetaDisplay         *display,
                       "Window %s is initially on all spaces\n",
                       window->desc);
 
-         /* need to set on_all_workspaces first so that it will be
-          * added to all the MRU lists
-          */
+          /* need to set on_all_workspaces first so that it will be
+           * added to all the MRU lists
+           */
           window->on_all_workspaces_requested = TRUE;
 
           on_all_workspaces = TRUE;
@@ -1262,8 +1273,9 @@ _meta_window_shared_new (MetaDisplay         *display,
                       "Window %s is initially on space %d\n",
                       window->desc, window->initial_workspace);
 
-          workspace = meta_workspace_manager_get_workspace_by_index (workspace_manager,
-                                                                     window->initial_workspace);
+          workspace = meta_workspace_manager_get_workspace_by_index (
+            workspace_manager,
+            window->initial_workspace);
         }
 
       set_workspace_state (window, on_all_workspaces, workspace);
@@ -1302,7 +1314,8 @@ _meta_window_shared_new (MetaDisplay         *display,
                       "Putting window %s on active workspace\n",
                       window->desc);
 
-          set_workspace_state (window, FALSE, workspace_manager->active_workspace);
+          set_workspace_state (window, FALSE,
+                               workspace_manager->active_workspace);
         }
 
       meta_window_update_struts (window);
@@ -1321,7 +1334,8 @@ _meta_window_shared_new (MetaDisplay         *display,
     meta_stack_add (window->display->stack,
                     window);
   else if (window->override_redirect)
-    window->layer = META_LAYER_OVERRIDE_REDIRECT; /* otherwise set by MetaStack */
+    window->layer = META_LAYER_OVERRIDE_REDIRECT; /* otherwise set by MetaStack
+                                                   * */
 
   if (!window->override_redirect)
     {
@@ -1399,8 +1413,8 @@ detach_foreach_func (MetaWindow *window,
 }
 
 void
-meta_window_unmanage (MetaWindow  *window,
-                      guint32      timestamp)
+meta_window_unmanage (MetaWindow *window,
+                      guint32     timestamp)
 {
   MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
   GList *tmp;
@@ -1528,8 +1542,8 @@ meta_window_unmanage (MetaWindow  *window,
     unmaximize_window_before_freeing (window);
 
   meta_window_unqueue (window, META_QUEUE_CALC_SHOWING |
-                               META_QUEUE_MOVE_RESIZE |
-                               META_QUEUE_UPDATE_ICON);
+                       META_QUEUE_MOVE_RESIZE |
+                       META_QUEUE_UPDATE_ICON);
   meta_window_free_delete_dialog (window);
 
   set_workspace_state (window, FALSE, NULL);
@@ -1652,7 +1666,7 @@ meta_window_showing_on_its_workspace (MetaWindow *window)
   MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
   gboolean showing;
   gboolean is_desktop_or_dock;
-  MetaWorkspace* workspace_of_window;
+  MetaWorkspace *workspace_of_window;
 
   showing = TRUE;
 
@@ -1679,8 +1693,9 @@ meta_window_showing_on_its_workspace (MetaWindow *window)
       workspace_of_window && workspace_of_window->showing_desktop &&
       !is_desktop_or_dock)
     {
-      meta_verbose ("We're showing the desktop on the workspace(s) that window %s is on\n",
-                    window->desc);
+      meta_verbose (
+        "We're showing the desktop on the workspace(s) that window %s is on\n",
+        window->desc);
       showing = FALSE;
     }
 
@@ -1699,7 +1714,7 @@ meta_window_showing_on_its_workspace (MetaWindow *window)
 }
 
 gboolean
-meta_window_should_be_showing (MetaWindow  *window)
+meta_window_should_be_showing (MetaWindow *window)
 {
   MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
 
@@ -1711,7 +1726,9 @@ meta_window_should_be_showing (MetaWindow  *window)
 
   /* Windows should be showing if they're located on the
    * active workspace and they're showing on their own workspace. */
-  return (meta_window_located_on_workspace (window, workspace_manager->active_workspace) &&
+  return (meta_window_located_on_workspace (window,
+                                            workspace_manager->active_workspace)
+          &&
           meta_window_showing_on_its_workspace (window));
 }
 
@@ -1750,7 +1767,7 @@ implement_showing (MetaWindow *window,
 }
 
 static void
-meta_window_calc_showing (MetaWindow  *window)
+meta_window_calc_showing (MetaWindow *window)
 {
   implement_showing (window, meta_window_should_be_showing (window));
 }
@@ -1914,8 +1931,8 @@ idle_calc_showing (gpointer data)
 }
 
 #ifdef WITH_VERBOSE_MODE
-static const gchar* meta_window_queue_names[NUMBER_OF_QUEUES] =
-  {"calc_showing", "move_resize", "update_icon"};
+static const gchar *meta_window_queue_names[NUMBER_OF_QUEUES] =
+{"calc_showing", "move_resize", "update_icon"};
 #endif
 
 static void
@@ -1923,23 +1940,23 @@ meta_window_unqueue (MetaWindow *window, guint queuebits)
 {
   gint queuenum;
 
-  for (queuenum=0; queuenum<NUMBER_OF_QUEUES; queuenum++)
+  for (queuenum = 0; queuenum < NUMBER_OF_QUEUES; queuenum++)
     {
-      if ((queuebits & 1<<queuenum) /* they have asked to unqueue */
+      if ((queuebits & 1 << queuenum) /* they have asked to unqueue */
           &&
-          (window->is_in_queues & 1<<queuenum)) /* it's in the queue */
+          (window->is_in_queues & 1 << queuenum)) /* it's in the queue */
         {
-
           meta_topic (META_DEBUG_WINDOW_STATE,
-              "Removing %s from the %s queue\n",
-              window->desc,
-              meta_window_queue_names[queuenum]);
+                      "Removing %s from the %s queue\n",
+                      window->desc,
+                      meta_window_queue_names[queuenum]);
 
           /* Note that window may not actually be in the queue
            * because it may have been in "copy" inside the idle handler
            */
-          queue_pending[queuenum] = g_slist_remove (queue_pending[queuenum], window);
-          window->is_in_queues &= ~(1<<queuenum);
+          queue_pending[queuenum] = g_slist_remove (queue_pending[queuenum],
+                                                    window);
+          window->is_in_queues &= ~(1 << queuenum);
 
           /* Okay, so maybe we've used up all the entries in the queue.
            * In that case, we should kill the function that deals with
@@ -1970,11 +1987,12 @@ meta_window_queue (MetaWindow *window, guint queuebits)
   guint queuenum;
 
   /* Easier to debug by checking here rather than in the idle */
-  g_return_if_fail (!window->override_redirect || (queuebits & META_QUEUE_MOVE_RESIZE) == 0);
+  g_return_if_fail (!window->override_redirect ||
+                    (queuebits & META_QUEUE_MOVE_RESIZE) == 0);
 
-  for (queuenum=0; queuenum<NUMBER_OF_QUEUES; queuenum++)
+  for (queuenum = 0; queuenum < NUMBER_OF_QUEUES; queuenum++)
     {
-      if (queuebits & 1<<queuenum)
+      if (queuebits & 1 << queuenum)
         {
           /* Data which varies between queues.
            * Yes, these do look a lot like associative arrays:
@@ -1982,18 +2000,18 @@ meta_window_queue (MetaWindow *window, guint queuebits)
            */
 
           const MetaLaterType window_queue_later_when[NUMBER_OF_QUEUES] =
-            {
-              META_LATER_CALC_SHOWING, /* CALC_SHOWING */
-              META_LATER_RESIZE,        /* MOVE_RESIZE */
-              META_LATER_BEFORE_REDRAW  /* UPDATE_ICON */
-            };
+          {
+            META_LATER_CALC_SHOWING,   /* CALC_SHOWING */
+            META_LATER_RESIZE,          /* MOVE_RESIZE */
+            META_LATER_BEFORE_REDRAW    /* UPDATE_ICON */
+          };
 
           const GSourceFunc window_queue_later_handler[NUMBER_OF_QUEUES] =
-            {
-              idle_calc_showing,
-              idle_move_resize,
-              idle_update_icon,
-            };
+          {
+            idle_calc_showing,
+            idle_move_resize,
+            idle_update_icon,
+          };
 
           /* If we're about to drop the window, there's no point in putting
            * it on a queue.
@@ -2004,16 +2022,16 @@ meta_window_queue (MetaWindow *window, guint queuebits)
           /* If the window already claims to be in that queue, there's no
            * point putting it in the queue.
            */
-          if (window->is_in_queues & 1<<queuenum)
+          if (window->is_in_queues & 1 << queuenum)
             break;
 
           meta_topic (META_DEBUG_WINDOW_STATE,
-              "Putting %s in the %s queue\n",
-              window->desc,
-              meta_window_queue_names[queuenum]);
+                      "Putting %s in the %s queue\n",
+                      window->desc,
+                      meta_window_queue_names[queuenum]);
 
           /* So, mark it as being in this queue. */
-          window->is_in_queues |= 1<<queuenum;
+          window->is_in_queues |= 1 << queuenum;
 
           /* There's not a lot of point putting things into a queue if
            * nobody's on the other end pulling them out. Therefore,
@@ -2023,18 +2041,18 @@ meta_window_queue (MetaWindow *window, guint queuebits)
 
           if (queue_later[queuenum] == 0)
             queue_later[queuenum] = meta_later_add
-              (
-                window_queue_later_when[queuenum],
-                window_queue_later_handler[queuenum],
-                GUINT_TO_POINTER(queuenum),
-                NULL
-              );
+                                    (
+              window_queue_later_when[queuenum],
+              window_queue_later_handler[queuenum],
+              GUINT_TO_POINTER (queuenum),
+              NULL
+                                    );
 
           /* And now we actually put it on the queue. */
           queue_pending[queuenum] = g_slist_prepend (queue_pending[queuenum],
                                                      window);
-      }
-  }
+        }
+    }
 }
 
 static gboolean
@@ -2072,10 +2090,10 @@ intervening_user_event_occurred (MetaWindow *window)
    * deal with that case rapidly, we use special case it--this is
    * merely a preliminary optimization.  :)
    */
-  if ( ((window->net_wm_user_time_set == TRUE) &&
+  if (((window->net_wm_user_time_set == TRUE) &&
        (window->net_wm_user_time == 0))
       ||
-       ((window->initial_timestamp_set == TRUE) &&
+      ((window->initial_timestamp_set == TRUE) &&
        (window->initial_timestamp == 0)))
     {
       meta_topic (META_DEBUG_STARTUP,
@@ -2192,8 +2210,8 @@ window_is_terminal (MetaWindow *window)
  */
 static void
 window_state_on_map (MetaWindow *window,
-                     gboolean *takes_focus,
-                     gboolean *places_on_top)
+                     gboolean   *takes_focus,
+                     gboolean   *places_on_top)
 {
   gboolean intervening_events;
 
@@ -2220,7 +2238,8 @@ window_state_on_map (MetaWindow *window,
    * approximation to enforce so we do that.
    */
   if (*takes_focus &&
-      meta_prefs_get_focus_new_windows () == G_DESKTOP_FOCUS_NEW_WINDOWS_STRICT &&
+      meta_prefs_get_focus_new_windows () ==
+      G_DESKTOP_FOCUS_NEW_WINDOWS_STRICT &&
       !window->display->allow_terminal_deactivation &&
       window_is_terminal (window->display->focus_window) &&
       !meta_window_is_ancestor_of_transient (window->display->focus_window,
@@ -2288,7 +2307,7 @@ windows_overlap (const MetaWindow *w1, const MetaWindow *w2)
 static gboolean
 window_would_be_covered (const MetaWindow *newbie)
 {
-  MetaWorkspace *workspace = meta_window_get_workspace ((MetaWindow *)newbie);
+  MetaWorkspace *workspace = meta_window_get_workspace ((MetaWindow *) newbie);
   GList *tmp, *windows;
 
   windows = meta_workspace_list_windows (workspace);
@@ -2392,10 +2411,11 @@ meta_window_show (MetaWindow *window)
    * probably rather be a term in the "if" condition below.
    */
 
-  if ( focus_window != NULL && window->showing_for_first_time &&
-      ( (!place_on_top_on_map && !takes_focus_on_map) ||
-      window_would_be_covered (window) )
-    ) {
+  if (focus_window != NULL && window->showing_for_first_time &&
+      ((!place_on_top_on_map && !takes_focus_on_map) ||
+       window_would_be_covered (window))
+      )
+    {
       if (!meta_window_is_ancestor_of_transient (focus_window, window))
         {
           needs_stacking_adjustment = TRUE;
@@ -2407,14 +2427,18 @@ meta_window_show (MetaWindow *window)
   if (!window->placed)
     {
       if (window->monitor &&
-          meta_prefs_get_auto_maximize() &&
+          meta_prefs_get_auto_maximize () &&
           window->showing_for_first_time &&
           window->has_maximize_func)
         {
           MetaRectangle work_area;
-          meta_window_get_work_area_for_monitor (window, window->monitor->number, &work_area);
-          /* Automaximize windows that map with a size > MAX_UNMAXIMIZED_WINDOW_AREA of the work area */
-          if (window->rect.width * window->rect.height > work_area.width * work_area.height * 
MAX_UNMAXIMIZED_WINDOW_AREA)
+          meta_window_get_work_area_for_monitor (window,
+                                                 window->monitor->number,
+                                                 &work_area);
+          /* Automaximize windows that map with a size >
+           * MAX_UNMAXIMIZED_WINDOW_AREA of the work area */
+          if (window->rect.width * window->rect.height >
+              work_area.width * work_area.height * MAX_UNMAXIMIZED_WINDOW_AREA)
             {
               window->maximize_horizontally_after_placement = TRUE;
               window->maximize_vertically_after_placement = TRUE;
@@ -2525,7 +2549,7 @@ meta_window_show (MetaWindow *window)
       window->showing_for_first_time = FALSE;
       if (takes_focus_on_map)
         {
-          guint32     timestamp;
+          guint32 timestamp;
 
           timestamp = meta_display_get_current_time_roundtrip (window->display);
 
@@ -2572,7 +2596,8 @@ meta_window_show (MetaWindow *window)
 
   if (notify_demands_attention)
     {
-      g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_DEMANDS_ATTENTION]);
+      g_object_notify_by_pspec (G_OBJECT (window),
+                                obj_props[PROP_DEMANDS_ATTENTION]);
       g_signal_emit_by_name (window->display, "window-demands-attention",
                              window);
     }
@@ -2643,7 +2668,8 @@ meta_window_hide (MetaWindow *window)
     {
       MetaWindow *not_this_one = NULL;
       MetaWorkspace *my_workspace = meta_window_get_workspace (window);
-      guint32 timestamp = meta_display_get_current_time_roundtrip (window->display);
+      guint32 timestamp = meta_display_get_current_time_roundtrip (
+        window->display);
 
       /*
        * If this window is modal, passing the not_this_one window to
@@ -2672,12 +2698,12 @@ static gboolean
 queue_calc_showing_func (MetaWindow *window,
                          void       *data)
 {
-  meta_window_queue(window, META_QUEUE_CALC_SHOWING);
+  meta_window_queue (window, META_QUEUE_CALC_SHOWING);
   return TRUE;
 }
 
 void
-meta_window_minimize (MetaWindow  *window)
+meta_window_minimize (MetaWindow *window)
 {
   g_return_if_fail (!window->override_redirect);
 
@@ -2685,7 +2711,7 @@ meta_window_minimize (MetaWindow  *window)
     {
       window->minimized = TRUE;
       window->pending_compositor_effect = META_COMP_EFFECT_MINIMIZE;
-      meta_window_queue(window, META_QUEUE_CALC_SHOWING);
+      meta_window_queue (window, META_QUEUE_CALC_SHOWING);
 
       meta_window_foreach_transient (window,
                                      queue_calc_showing_func,
@@ -2709,7 +2735,7 @@ meta_window_minimize (MetaWindow  *window)
 }
 
 void
-meta_window_unminimize (MetaWindow  *window)
+meta_window_unminimize (MetaWindow *window)
 {
   g_return_if_fail (!window->override_redirect);
 
@@ -2717,7 +2743,7 @@ meta_window_unminimize (MetaWindow  *window)
     {
       window->minimized = FALSE;
       window->pending_compositor_effect = META_COMP_EFFECT_UNMINIMIZE;
-      meta_window_queue(window, META_QUEUE_CALC_SHOWING);
+      meta_window_queue (window, META_QUEUE_CALC_SHOWING);
 
       meta_window_foreach_transient (window,
                                      queue_calc_showing_func,
@@ -2735,67 +2761,72 @@ ensure_size_hints_satisfied (MetaRectangle    *rect,
   int basew, baseh, winc, hinc; /* base width/height, width/height increment */
   int extra_width, extra_height;
 
-  minw  = size_hints->min_width;  minh  = size_hints->min_height;
-  maxw  = size_hints->max_width;  maxh  = size_hints->max_height;
-  basew = size_hints->base_width; baseh = size_hints->base_height;
-  winc  = size_hints->width_inc;  hinc  = size_hints->height_inc;
+  minw = size_hints->min_width;
+  minh = size_hints->min_height;
+  maxw = size_hints->max_width;
+  maxh = size_hints->max_height;
+  basew = size_hints->base_width;
+  baseh = size_hints->base_height;
+  winc = size_hints->width_inc;
+  hinc = size_hints->height_inc;
 
   /* First, enforce min/max size constraints */
-  rect->width  = CLAMP (rect->width,  minw, maxw);
+  rect->width = CLAMP (rect->width, minw, maxw);
   rect->height = CLAMP (rect->height, minh, maxh);
 
   /* Now, verify size increment constraints are satisfied, or make them be */
-  extra_width  = (rect->width  - basew) % winc;
+  extra_width = (rect->width - basew) % winc;
   extra_height = (rect->height - baseh) % hinc;
 
-  rect->width  -= extra_width;
+  rect->width -= extra_width;
   rect->height -= extra_height;
 
   /* Adjusting width/height down, as done above, may violate minimum size
    * constraints, so one last fix.
    */
-  if (rect->width  < minw)
-    rect->width  += ((minw - rect->width)/winc  + 1)*winc;
+  if (rect->width < minw)
+    rect->width += ((minw - rect->width) / winc + 1) * winc;
   if (rect->height < minh)
-    rect->height += ((minh - rect->height)/hinc + 1)*hinc;
+    rect->height += ((minh - rect->height) / hinc + 1) * hinc;
 }
 
 static void
 meta_window_save_rect (MetaWindow *window)
 {
-  if (!(META_WINDOW_MAXIMIZED (window) || META_WINDOW_TILED_SIDE_BY_SIDE (window) || window->fullscreen))
+  if (!(META_WINDOW_MAXIMIZED (window) ||
+        META_WINDOW_TILED_SIDE_BY_SIDE (window) || window->fullscreen))
     {
       /* save size/pos as appropriate args for move_resize */
       if (!window->maximized_horizontally)
         {
-          window->saved_rect.x      = window->rect.x;
-          window->saved_rect.width  = window->rect.width;
+          window->saved_rect.x = window->rect.x;
+          window->saved_rect.width = window->rect.width;
         }
       if (!window->maximized_vertically)
         {
-          window->saved_rect.y      = window->rect.y;
+          window->saved_rect.y = window->rect.y;
           window->saved_rect.height = window->rect.height;
         }
     }
 }
 
 void
-meta_window_maximize_internal (MetaWindow        *window,
-                               MetaMaximizeFlags  directions,
-                               MetaRectangle     *saved_rect)
+meta_window_maximize_internal (MetaWindow       *window,
+                               MetaMaximizeFlags directions,
+                               MetaRectangle    *saved_rect)
 {
   /* At least one of the two directions ought to be set */
   gboolean maximize_horizontally, maximize_vertically;
   maximize_horizontally = directions & META_MAXIMIZE_HORIZONTAL;
-  maximize_vertically   = directions & META_MAXIMIZE_VERTICAL;
+  maximize_vertically = directions & META_MAXIMIZE_VERTICAL;
   g_assert (maximize_horizontally || maximize_vertically);
 
   meta_topic (META_DEBUG_WINDOW_OPS,
               "Maximizing %s%s\n",
               window->desc,
               maximize_horizontally && maximize_vertically ? "" :
-                maximize_horizontally ? " horizontally" :
-                  maximize_vertically ? " vertically" : "BUGGGGG");
+              maximize_horizontally ? " horizontally" :
+              maximize_vertically ? " vertically" : "BUGGGGG");
 
   if (saved_rect != NULL)
     window->saved_rect = *saved_rect;
@@ -2808,10 +2839,10 @@ meta_window_maximize_internal (MetaWindow        *window,
   window->maximized_horizontally =
     window->maximized_horizontally || maximize_horizontally;
   window->maximized_vertically =
-    window->maximized_vertically   || maximize_vertically;
+    window->maximized_vertically || maximize_vertically;
 
   /* Update the edge constraints */
-  update_edge_constraints (window);;
+  update_edge_constraints (window);
 
   meta_window_recalc_features (window);
   set_net_wm_state (window);
@@ -2820,14 +2851,16 @@ meta_window_maximize_internal (MetaWindow        *window,
     meta_display_queue_check_fullscreen (window->display);
 
   g_object_freeze_notify (G_OBJECT (window));
-  g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_MAXIMIZED_HORIZONTALLY]);
-  g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_MAXIMIZED_VERTICALLY]);
+  g_object_notify_by_pspec (G_OBJECT (window),
+                            obj_props[PROP_MAXIMIZED_HORIZONTALLY]);
+  g_object_notify_by_pspec (G_OBJECT (window),
+                            obj_props[PROP_MAXIMIZED_VERTICALLY]);
   g_object_thaw_notify (G_OBJECT (window));
 }
 
 void
-meta_window_maximize (MetaWindow        *window,
-                      MetaMaximizeFlags  directions)
+meta_window_maximize (MetaWindow       *window,
+                      MetaMaximizeFlags directions)
 {
   MetaRectangle *saved_rect = NULL;
   gboolean maximize_horizontally, maximize_vertically;
@@ -2836,14 +2869,14 @@ meta_window_maximize (MetaWindow        *window,
 
   /* At least one of the two directions ought to be set */
   maximize_horizontally = directions & META_MAXIMIZE_HORIZONTAL;
-  maximize_vertically   = directions & META_MAXIMIZE_VERTICAL;
+  maximize_vertically = directions & META_MAXIMIZE_VERTICAL;
   g_assert (maximize_horizontally || maximize_vertically);
 
   /* Only do something if the window isn't already maximized in the
    * given direction(s).
    */
   if ((maximize_horizontally && !window->maximized_horizontally) ||
-      (maximize_vertically   && !window->maximized_vertically))
+      (maximize_vertically && !window->maximized_vertically))
     {
       if (window->shaded && maximize_vertically)
         {
@@ -2858,15 +2891,15 @@ meta_window_maximize (MetaWindow        *window,
       /* if the window hasn't been placed yet, we'll maximize it then
        */
       if (!window->placed)
-       {
-         window->maximize_horizontally_after_placement =
+        {
+          window->maximize_horizontally_after_placement =
             window->maximize_horizontally_after_placement ||
             maximize_horizontally;
-         window->maximize_vertically_after_placement =
+          window->maximize_vertically_after_placement =
             window->maximize_vertically_after_placement ||
             maximize_vertically;
-         return;
-       }
+          return;
+        }
 
       if (window->tile_mode != META_TILE_NONE)
         {
@@ -2973,7 +3006,9 @@ meta_window_is_monitor_sized (MetaWindow *window)
       MetaRectangle window_rect, monitor_rect;
 
       meta_window_get_frame_rect (window, &window_rect);
-      meta_display_get_monitor_geometry (window->display, window->monitor->number, &monitor_rect);
+      meta_display_get_monitor_geometry (window->display,
+                                         window->monitor->number,
+                                         &monitor_rect);
 
       if (meta_rectangle_equal (&window_rect, &monitor_rect))
         return TRUE;
@@ -3021,9 +3056,9 @@ meta_window_requested_dont_bypass_compositor (MetaWindow *window)
 }
 
 static void
-meta_window_get_tile_fraction (MetaWindow   *window,
-                               MetaTileMode  tile_mode,
-                               double       *fraction)
+meta_window_get_tile_fraction (MetaWindow  *window,
+                               MetaTileMode tile_mode,
+                               double      *fraction)
 {
   MetaWindow *tile_match;
 
@@ -3063,7 +3098,7 @@ meta_window_update_tile_fraction (MetaWindow *window,
   meta_window_get_work_area_for_monitor (window,
                                          window->tile_monitor_number,
                                          &work_area);
-  window->tile_hfraction = (double)new_w / work_area.width;
+  window->tile_hfraction = (double) new_w / work_area.width;
 
   if (tile_match && window->display->grab_window == window)
     meta_window_tile (tile_match, tile_match->tile_mode);
@@ -3127,8 +3162,8 @@ update_edge_constraints (MetaWindow *window)
 }
 
 void
-meta_window_tile (MetaWindow   *window,
-                  MetaTileMode  tile_mode)
+meta_window_tile (MetaWindow  *window,
+                  MetaTileMode tile_mode)
 {
   MetaMaximizeFlags directions;
   MetaRectangle old_frame_rect, old_buffer_rect;
@@ -3170,10 +3205,10 @@ meta_window_tile (MetaWindow   *window,
 }
 
 void
-meta_window_restore_tile (MetaWindow   *window,
-                          MetaTileMode  mode,
-                          int           width,
-                          int           height)
+meta_window_restore_tile (MetaWindow  *window,
+                          MetaTileMode mode,
+                          int          width,
+                          int          height)
 {
   meta_window_update_tile_fraction (window, width, height);
   meta_window_tile (window, mode);
@@ -3211,7 +3246,7 @@ meta_window_can_tile_side_by_side (MetaWindow *window)
 }
 
 static void
-unmaximize_window_before_freeing (MetaWindow        *window)
+unmaximize_window_before_freeing (MetaWindow *window)
 {
   meta_topic (META_DEBUG_WINDOW_OPS,
               "Unmaximizing %s just before freeing\n",
@@ -3245,8 +3280,8 @@ unmaximize_window_before_freeing (MetaWindow        *window)
 }
 
 void
-meta_window_unmaximize (MetaWindow        *window,
-                        MetaMaximizeFlags  directions)
+meta_window_unmaximize (MetaWindow       *window,
+                        MetaMaximizeFlags directions)
 {
   gboolean unmaximize_horizontally, unmaximize_vertically;
 
@@ -3254,7 +3289,7 @@ meta_window_unmaximize (MetaWindow        *window,
 
   /* At least one of the two directions ought to be set */
   unmaximize_horizontally = directions & META_MAXIMIZE_HORIZONTAL;
-  unmaximize_vertically   = directions & META_MAXIMIZE_VERTICAL;
+  unmaximize_vertically = directions & META_MAXIMIZE_VERTICAL;
   g_assert (unmaximize_horizontally || unmaximize_vertically);
 
   if (unmaximize_horizontally && unmaximize_vertically)
@@ -3264,14 +3299,15 @@ meta_window_unmaximize (MetaWindow        *window,
    * given direction(s).
    */
   if ((unmaximize_horizontally && window->maximized_horizontally) ||
-      (unmaximize_vertically   && window->maximized_vertically))
+      (unmaximize_vertically && window->maximized_vertically))
     {
       MetaRectangle *desired_rect;
       MetaRectangle target_rect;
       MetaRectangle work_area;
       MetaRectangle old_frame_rect, old_buffer_rect;
 
-      meta_window_get_work_area_for_monitor (window, window->monitor->number, &work_area);
+      meta_window_get_work_area_for_monitor (window, window->monitor->number,
+                                             &work_area);
       meta_window_get_frame_rect (window, &old_frame_rect);
       meta_window_get_buffer_rect (window, &old_buffer_rect);
 
@@ -3282,13 +3318,13 @@ meta_window_unmaximize (MetaWindow        *window,
                   "Unmaximizing %s%s\n",
                   window->desc,
                   unmaximize_horizontally && unmaximize_vertically ? "" :
-                    unmaximize_horizontally ? " horizontally" :
-                      unmaximize_vertically ? " vertically" : "BUGGGGG");
+                  unmaximize_horizontally ? " horizontally" :
+                  unmaximize_vertically ? " vertically" : "BUGGGGG");
 
       window->maximized_horizontally =
         window->maximized_horizontally && !unmaximize_horizontally;
       window->maximized_vertically =
-        window->maximized_vertically   && !unmaximize_vertically;
+        window->maximized_vertically && !unmaximize_vertically;
 
       /* Update the edge constraints */
       update_edge_constraints (window);
@@ -3307,43 +3343,57 @@ meta_window_unmaximize (MetaWindow        *window,
       target_rect = old_frame_rect;
 
       /* Avoid unmaximizing to "almost maximized" size when the previous size
-       * is greater then 80% of the work area use MAX_UNMAXIMIZED_WINDOW_AREA of the work area as upper limit
+       * is greater then 80% of the work area use MAX_UNMAXIMIZED_WINDOW_AREA of
+       *the work area as upper limit
        * while maintaining the aspect ratio.
        */
       if (unmaximize_horizontally && unmaximize_vertically &&
-          desired_rect->width * desired_rect->height > work_area.width * work_area.height * 
MAX_UNMAXIMIZED_WINDOW_AREA)
+          desired_rect->width * desired_rect->height >
+          work_area.width * work_area.height * MAX_UNMAXIMIZED_WINDOW_AREA)
         {
           if (desired_rect->width > desired_rect->height)
             {
-              float aspect = (float)desired_rect->height / (float)desired_rect->width;
-              desired_rect->width = MAX (work_area.width * sqrt (MAX_UNMAXIMIZED_WINDOW_AREA), 
window->size_hints.min_width);
-              desired_rect->height = MAX (desired_rect->width * aspect, window->size_hints.min_height);
+              float aspect = (float) desired_rect->height /
+                             (float) desired_rect->width;
+              desired_rect->width =
+                MAX (work_area.width * sqrt (
+                       MAX_UNMAXIMIZED_WINDOW_AREA),
+                     window->size_hints.min_width);
+              desired_rect->height = MAX (desired_rect->width * aspect,
+                                          window->size_hints.min_height);
             }
           else
             {
-              float aspect = (float)desired_rect->width / (float)desired_rect->height;
-              desired_rect->height = MAX (work_area.height * sqrt (MAX_UNMAXIMIZED_WINDOW_AREA), 
window->size_hints.min_height);
-              desired_rect->width = MAX (desired_rect->height * aspect, window->size_hints.min_width);
+              float aspect = (float) desired_rect->width /
+                             (float) desired_rect->height;
+              desired_rect->height =
+                MAX (work_area.height * sqrt (
+                       MAX_UNMAXIMIZED_WINDOW_AREA),
+                     window->size_hints.min_height);
+              desired_rect->width = MAX (desired_rect->height * aspect,
+                                         window->size_hints.min_width);
             }
         }
 
       if (unmaximize_horizontally)
         {
-          target_rect.x     = desired_rect->x;
+          target_rect.x = desired_rect->x;
           target_rect.width = desired_rect->width;
         }
       if (unmaximize_vertically)
         {
-          target_rect.y      = desired_rect->y;
+          target_rect.y = desired_rect->y;
           target_rect.height = desired_rect->height;
         }
 
       /* Window's size hints may have changed while maximized, making
        * saved_rect invalid.  #329152
        */
-      meta_window_frame_rect_to_client_rect (window, &target_rect, &target_rect);
+      meta_window_frame_rect_to_client_rect (window, &target_rect,
+                                             &target_rect);
       ensure_size_hints_satisfied (&target_rect, &window->size_hints);
-      meta_window_client_rect_to_frame_rect (window, &target_rect, &target_rect);
+      meta_window_client_rect_to_frame_rect (window, &target_rect,
+                                             &target_rect);
 
       meta_compositor_size_change_window (window->display->compositor, window,
                                           META_SIZE_CHANGE_UNMAXIMIZE,
@@ -3375,13 +3425,15 @@ meta_window_unmaximize (MetaWindow        *window,
     }
 
   g_object_freeze_notify (G_OBJECT (window));
-  g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_MAXIMIZED_HORIZONTALLY]);
-  g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_MAXIMIZED_VERTICALLY]);
+  g_object_notify_by_pspec (G_OBJECT (window),
+                            obj_props[PROP_MAXIMIZED_HORIZONTALLY]);
+  g_object_notify_by_pspec (G_OBJECT (window),
+                            obj_props[PROP_MAXIMIZED_VERTICALLY]);
   g_object_thaw_notify (G_OBJECT (window));
 }
 
 void
-meta_window_make_above (MetaWindow  *window)
+meta_window_make_above (MetaWindow *window)
 {
   g_return_if_fail (!window->override_redirect);
 
@@ -3390,7 +3442,7 @@ meta_window_make_above (MetaWindow  *window)
 }
 
 void
-meta_window_unmake_above (MetaWindow  *window)
+meta_window_unmake_above (MetaWindow *window)
 {
   g_return_if_fail (!window->override_redirect);
 
@@ -3414,7 +3466,7 @@ meta_window_set_above (MetaWindow *window,
 }
 
 void
-meta_window_make_fullscreen_internal (MetaWindow  *window)
+meta_window_make_fullscreen_internal (MetaWindow *window)
 {
   if (!window->fullscreen)
     {
@@ -3451,7 +3503,7 @@ meta_window_make_fullscreen_internal (MetaWindow  *window)
 }
 
 void
-meta_window_make_fullscreen (MetaWindow  *window)
+meta_window_make_fullscreen (MetaWindow *window)
 {
   g_return_if_fail (!window->override_redirect);
 
@@ -3477,7 +3529,7 @@ meta_window_make_fullscreen (MetaWindow  *window)
 }
 
 void
-meta_window_unmake_fullscreen (MetaWindow  *window)
+meta_window_unmake_fullscreen (MetaWindow *window)
 {
   g_return_if_fail (!window->override_redirect);
 
@@ -3498,9 +3550,11 @@ meta_window_unmake_fullscreen (MetaWindow  *window)
       /* Window's size hints may have changed while maximized, making
        * saved_rect invalid.  #329152
        */
-      meta_window_frame_rect_to_client_rect (window, &target_rect, &target_rect);
+      meta_window_frame_rect_to_client_rect (window, &target_rect,
+                                             &target_rect);
       ensure_size_hints_satisfied (&target_rect, &window->size_hints);
-      meta_window_client_rect_to_frame_rect (window, &target_rect, &target_rect);
+      meta_window_client_rect_to_frame_rect (window, &target_rect,
+                                             &target_rect);
 
       /* Need to update window->has_resize_func before we move_resize()
        */
@@ -3554,7 +3608,7 @@ meta_window_update_fullscreen_monitors (MetaWindow         *window,
 
   if (window->fullscreen)
     {
-      meta_window_queue(window, META_QUEUE_MOVE_RESIZE);
+      meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
     }
 }
 
@@ -3565,8 +3619,8 @@ meta_window_has_fullscreen_monitors (MetaWindow *window)
 }
 
 void
-meta_window_shade (MetaWindow  *window,
-                   guint32      timestamp)
+meta_window_shade (MetaWindow *window,
+                   guint32     timestamp)
 {
   g_return_if_fail (!window->override_redirect);
 
@@ -3576,7 +3630,8 @@ meta_window_shade (MetaWindow  *window,
     {
       window->shaded = TRUE;
 
-      meta_window_queue(window, META_QUEUE_MOVE_RESIZE | META_QUEUE_CALC_SHOWING);
+      meta_window_queue (window,
+                         META_QUEUE_MOVE_RESIZE | META_QUEUE_CALC_SHOWING);
       meta_window_frame_size_changed (window);
 
       /* After queuing the calc showing, since _focus flushes it,
@@ -3592,8 +3647,8 @@ meta_window_shade (MetaWindow  *window,
 }
 
 void
-meta_window_unshade (MetaWindow  *window,
-                     guint32      timestamp)
+meta_window_unshade (MetaWindow *window,
+                     guint32     timestamp)
 {
   g_return_if_fail (!window->override_redirect);
 
@@ -3602,7 +3657,8 @@ meta_window_unshade (MetaWindow  *window,
   if (window->shaded)
     {
       window->shaded = FALSE;
-      meta_window_queue(window, META_QUEUE_MOVE_RESIZE | META_QUEUE_CALC_SHOWING);
+      meta_window_queue (window,
+                         META_QUEUE_MOVE_RESIZE | META_QUEUE_CALC_SHOWING);
       meta_window_frame_size_changed (window);
 
       /* focus the window */
@@ -3631,10 +3687,10 @@ unminimize_window_and_all_transient_parents (MetaWindow *window)
 }
 
 void
-meta_window_activate_full (MetaWindow     *window,
-                           guint32         timestamp,
-                           MetaClientType  source_indication,
-                           MetaWorkspace  *workspace)
+meta_window_activate_full (MetaWindow    *window,
+                           guint32        timestamp,
+                           MetaClientType source_indication,
+                           MetaWorkspace *workspace)
 {
   MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
   gboolean allow_workspace_switch;
@@ -3651,7 +3707,7 @@ meta_window_activate_full (MetaWindow     *window,
                   "last_user_time (%u) is more recent; ignoring "
                   " _NET_ACTIVE_WINDOW message.\n",
                   window->display->last_user_time);
-      meta_window_set_demands_attention(window);
+      meta_window_set_demands_attention (window);
       return;
     }
 
@@ -3668,8 +3724,8 @@ meta_window_activate_full (MetaWindow     *window,
     workspace = workspace_manager->active_workspace;
 
   /* For non-transient windows, we just set up a pulsing indicator,
-     rather than move windows or workspaces.
-     See http://bugzilla.gnome.org/show_bug.cgi?id=482354 */
+   *  rather than move windows or workspaces.
+   *  See http://bugzilla.gnome.org/show_bug.cgi?id=482354 */
   if (window->transient_for == NULL &&
       !allow_workspace_switch &&
       !meta_window_located_on_workspace (window, workspace))
@@ -3680,8 +3736,9 @@ meta_window_activate_full (MetaWindow     *window,
     }
   else if (window->transient_for != NULL)
     {
-      /* Move transients to current workspace - preference dialogs should appear over
-         the source window.  */
+      /* Move transients to current workspace - preference dialogs should appear
+       * over
+       *  the source window.  */
       meta_window_change_workspace (window, workspace);
     }
 
@@ -3711,8 +3768,8 @@ meta_window_activate_full (MetaWindow     *window,
  * type for itself.  ;-)
  */
 void
-meta_window_activate (MetaWindow     *window,
-                      guint32         timestamp)
+meta_window_activate (MetaWindow *window,
+                      guint32     timestamp)
 {
   g_return_if_fail (!window->override_redirect);
 
@@ -3724,13 +3781,14 @@ meta_window_activate (MetaWindow     *window,
 }
 
 void
-meta_window_activate_with_workspace (MetaWindow     *window,
-                                     guint32         timestamp,
-                                     MetaWorkspace  *workspace)
+meta_window_activate_with_workspace (MetaWindow    *window,
+                                     guint32        timestamp,
+                                     MetaWorkspace *workspace)
 {
   g_return_if_fail (!window->override_redirect);
 
-  meta_window_activate_full (window, timestamp, META_CLIENT_TYPE_APPLICATION, workspace);
+  meta_window_activate_full (window, timestamp, META_CLIENT_TYPE_APPLICATION,
+                             workspace);
 }
 
 /**
@@ -3877,8 +3935,8 @@ meta_window_update_for_monitors_changed (MetaWindow *window)
 }
 
 void
-meta_window_update_monitor (MetaWindow                   *window,
-                            MetaWindowUpdateMonitorFlags  flags)
+meta_window_update_monitor (MetaWindow                  *window,
+                            MetaWindowUpdateMonitorFlags flags)
 {
   MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
   const MetaLogicalMonitor *old;
@@ -3889,34 +3947,42 @@ meta_window_update_monitor (MetaWindow                   *window,
     {
       meta_window_on_all_workspaces_changed (window);
 
-      /* If workspaces only on primary and we moved back to primary due to a user action,
-       * ensure that the window is now in that workspace. We do this because while
-       * the window is on a non-primary monitor it is always visible, so it would be
+      /* If workspaces only on primary and we moved back to primary due to a
+       * user action,
+       * ensure that the window is now in that workspace. We do this because
+       *while
+       * the window is on a non-primary monitor it is always visible, so it
+       *would be
        * very jarring if it disappeared when it crossed the monitor border.
-       * The one time we want it to both change to the primary monitor and a non-active
-       * workspace is when dropping the window on some other workspace thumbnail directly.
-       * That should be handled by explicitly moving the window before changing the
+       * The one time we want it to both change to the primary monitor and a
+       *non-active
+       * workspace is when dropping the window on some other workspace thumbnail
+       *directly.
+       * That should be handled by explicitly moving the window before changing
+       *the
        * workspace.
        */
       if (meta_prefs_get_workspaces_only_on_primary () &&
           flags & META_WINDOW_UPDATE_MONITOR_FLAGS_USER_OP &&
-          meta_window_is_on_primary_monitor (window)  &&
+          meta_window_is_on_primary_monitor (window) &&
           workspace_manager->active_workspace != window->workspace)
-        meta_window_change_workspace (window, workspace_manager->active_workspace);
+        meta_window_change_workspace (window,
+                                      workspace_manager->active_workspace);
 
       meta_window_main_monitor_changed (window, old);
 
-      /* If we're changing monitors, we need to update the has_maximize_func flag,
+      /* If we're changing monitors, we need to update the has_maximize_func
+       * flag,
        * as the working area has changed. */
       meta_window_recalc_features (window);
     }
 }
 
 void
-meta_window_move_resize_internal (MetaWindow          *window,
-                                  MetaMoveResizeFlags  flags,
-                                  int                  gravity,
-                                  MetaRectangle        frame_rect)
+meta_window_move_resize_internal (MetaWindow         *window,
+                                  MetaMoveResizeFlags flags,
+                                  int                 gravity,
+                                  MetaRectangle       frame_rect)
 {
   /* The rectangle here that's passed in *always* in "frame rect"
    * coordinates. That means the position of the frame's visible bounds,
@@ -3950,14 +4016,17 @@ meta_window_move_resize_internal (MetaWindow          *window,
   /* The action has to be a move, a resize or the wayland client
    * acking our choice of size.
    */
-  g_assert (flags & (META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION | 
META_MOVE_RESIZE_WAYLAND_RESIZE));
+  g_assert (flags &
+            (META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION |
+             META_MOVE_RESIZE_WAYLAND_RESIZE));
 
   did_placement = !window->placed && window->calc_placement;
 
   /* We don't need it in the idle queue anymore. */
   meta_window_unqueue (window, META_QUEUE_MOVE_RESIZE);
 
-  if ((flags & META_MOVE_RESIZE_RESIZE_ACTION) && (flags & META_MOVE_RESIZE_MOVE_ACTION))
+  if ((flags & META_MOVE_RESIZE_RESIZE_ACTION) &&
+      (flags & META_MOVE_RESIZE_MOVE_ACTION))
     {
       /* We're both moving and resizing. Just use the passed in rect. */
       unconstrained_rect = frame_rect;
@@ -4017,7 +4086,10 @@ meta_window_move_resize_internal (MetaWindow          *window,
     }
 
   /* Do the protocol-specific move/resize logic */
-  META_WINDOW_GET_CLASS (window)->move_resize_internal (window, gravity, unconstrained_rect, 
constrained_rect, flags, &result);
+  META_WINDOW_GET_CLASS (window)->move_resize_internal (window, gravity,
+                                                        unconstrained_rect,
+                                                        constrained_rect, flags,
+                                                        &result);
 
   if (result & META_MOVE_RESIZE_RESULT_MOVED)
     {
@@ -4059,7 +4131,8 @@ meta_window_move_resize_internal (MetaWindow          *window,
       meta_window_update_monitor (window, update_monitor_flags);
 
       if (old_output_winsys_id != window->monitor->winsys_id &&
-          flags & META_MOVE_RESIZE_MOVE_ACTION && flags & META_MOVE_RESIZE_USER_ACTION)
+          flags & META_MOVE_RESIZE_MOVE_ACTION &&
+          flags & META_MOVE_RESIZE_USER_ACTION)
         window->preferred_output_winsys_id = window->monitor->winsys_id;
     }
   else
@@ -4067,7 +4140,8 @@ meta_window_move_resize_internal (MetaWindow          *window,
       meta_window_update_monitor (window, update_monitor_flags);
     }
 
-  if ((result & META_MOVE_RESIZE_RESULT_FRAME_SHAPE_CHANGED) && window->frame_bounds)
+  if ((result & META_MOVE_RESIZE_RESULT_FRAME_SHAPE_CHANGED) &&
+      window->frame_bounds)
     {
       cairo_region_destroy (window->frame_bounds);
       window->frame_bounds = NULL;
@@ -4102,12 +4176,13 @@ meta_window_move_frame (MetaWindow *window,
 
   g_return_if_fail (!window->override_redirect);
 
-  flags = (user_op ? META_MOVE_RESIZE_USER_ACTION : 0) | META_MOVE_RESIZE_MOVE_ACTION;
+  flags = (user_op ? META_MOVE_RESIZE_USER_ACTION : 0) |
+          META_MOVE_RESIZE_MOVE_ACTION;
   meta_window_move_resize_internal (window, flags, NorthWestGravity, rect);
 }
 
 static void
-meta_window_move_between_rects (MetaWindow  *window,
+meta_window_move_between_rects (MetaWindow          *window,
                                 MetaMoveResizeFlags  move_resize_flags,
                                 const MetaRectangle *old_area,
                                 const MetaRectangle *new_area)
@@ -4119,8 +4194,8 @@ meta_window_move_between_rects (MetaWindow  *window,
     {
       rel_x = window->unconstrained_rect.x - old_area->x;
       rel_y = window->unconstrained_rect.y - old_area->y;
-      scale_x = (double)new_area->width / old_area->width;
-      scale_y = (double)new_area->height / old_area->height;
+      scale_x = (double) new_area->width / old_area->width;
+      scale_y = (double) new_area->height / old_area->height;
     }
   else
     {
@@ -4153,19 +4228,20 @@ meta_window_move_between_rects (MetaWindow  *window,
  * fit within the given rect
  */
 void
-meta_window_move_resize_frame (MetaWindow  *window,
-                               gboolean     user_op,
-                               int          root_x_nw,
-                               int          root_y_nw,
-                               int          w,
-                               int          h)
+meta_window_move_resize_frame (MetaWindow *window,
+                               gboolean    user_op,
+                               int         root_x_nw,
+                               int         root_y_nw,
+                               int         w,
+                               int         h)
 {
   MetaMoveResizeFlags flags;
   MetaRectangle rect = { root_x_nw, root_y_nw, w, h };
 
   g_return_if_fail (!window->override_redirect);
 
-  flags = (user_op ? META_MOVE_RESIZE_USER_ACTION : 0) | META_MOVE_RESIZE_MOVE_ACTION | 
META_MOVE_RESIZE_RESIZE_ACTION;
+  flags = (user_op ? META_MOVE_RESIZE_USER_ACTION : 0) |
+          META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION;
 
   meta_window_move_resize_internal (window, flags, NorthWestGravity, rect);
 }
@@ -4179,8 +4255,8 @@ meta_window_move_resize_frame (MetaWindow  *window,
  * the relative position of the window's top left corner.
  */
 void
-meta_window_move_to_monitor (MetaWindow  *window,
-                             int          monitor)
+meta_window_move_to_monitor (MetaWindow *window,
+                             int         monitor)
 {
   MetaRectangle old_area, new_area;
 
@@ -4225,29 +4301,30 @@ adjust_size_for_tile_match (MetaWindow *window,
   if (!META_WINDOW_TILED_SIDE_BY_SIDE (window) || !tile_match)
     return;
 
-  meta_window_get_work_area_for_monitor (window, window->tile_monitor_number, &work_area);
+  meta_window_get_work_area_for_monitor (window, window->tile_monitor_number,
+                                         &work_area);
 
   /* Make sure the resize does not break minimum sizes */
   rect = work_area;
   rect.width = *new_w;
 
   meta_window_frame_rect_to_client_rect (window, &rect, &rect);
-  *new_w += MAX(0, window->size_hints.min_width - rect.width);
+  *new_w += MAX (0, window->size_hints.min_width - rect.width);
 
   /* Make sure we're not resizing the tile match below its min width */
   rect = work_area;
   rect.width = work_area.width - *new_w;
 
   meta_window_frame_rect_to_client_rect (tile_match, &rect, &rect);
-  *new_w -= MAX(0, tile_match->size_hints.min_width - rect.width);
+  *new_w -= MAX (0, tile_match->size_hints.min_width - rect.width);
 }
 
 void
 meta_window_resize_frame_with_gravity (MetaWindow *window,
-                                       gboolean     user_op,
-                                       int          w,
-                                       int          h,
-                                       int          gravity)
+                                       gboolean    user_op,
+                                       int         w,
+                                       int         h,
+                                       int         gravity)
 {
   MetaMoveResizeFlags flags;
   MetaRectangle rect;
@@ -4265,12 +4342,13 @@ meta_window_resize_frame_with_gravity (MetaWindow *window,
       meta_window_update_tile_fraction (window, w, h);
     }
 
-  flags = (user_op ? META_MOVE_RESIZE_USER_ACTION : 0) | META_MOVE_RESIZE_RESIZE_ACTION;
+  flags = (user_op ? META_MOVE_RESIZE_USER_ACTION : 0) |
+          META_MOVE_RESIZE_RESIZE_ACTION;
   meta_window_move_resize_internal (window, flags, gravity, rect);
 }
 
 static void
-meta_window_move_resize_now (MetaWindow  *window)
+meta_window_move_resize_now (MetaWindow *window)
 {
   meta_window_move_resize_frame (window, FALSE,
                                  window->unconstrained_rect.x,
@@ -4320,10 +4398,10 @@ idle_move_resize (gpointer data)
 }
 
 void
-meta_window_get_gravity_position (MetaWindow  *window,
-                                  int          gravity,
-                                  int         *root_x,
-                                  int         *root_y)
+meta_window_get_gravity_position (MetaWindow *window,
+                                  int         gravity,
+                                  int        *root_x,
+                                  int        *root_y)
 {
   MetaRectangle frame_extents;
   int w, h;
@@ -4404,20 +4482,20 @@ meta_window_get_gravity_position (MetaWindow  *window,
 }
 
 void
-meta_window_get_session_geometry (MetaWindow  *window,
-                                  int         *x,
-                                  int         *y,
-                                  int         *width,
-                                  int         *height)
+meta_window_get_session_geometry (MetaWindow *window,
+                                  int        *x,
+                                  int        *y,
+                                  int        *width,
+                                  int        *height)
 {
   meta_window_get_gravity_position (window,
                                     window->size_hints.win_gravity,
                                     x, y);
 
   *width = (window->rect.width - window->size_hints.base_width) /
-    window->size_hints.width_inc;
+           window->size_hints.width_inc;
   *height = (window->rect.height - window->size_hints.base_height) /
-    window->size_hints.height_inc;
+            window->size_hints.height_inc;
 }
 
 /**
@@ -4444,7 +4522,8 @@ meta_window_get_buffer_rect (const MetaWindow *window,
  * meta_window_client_rect_to_frame_rect:
  * @window: a #MetaWindow
  * @client_rect: client rectangle in root coordinates
- * @frame_rect: (out): location to store the computed corresponding frame bounds.
+ * @frame_rect: (out): location to store the computed corresponding frame
+ *bounds.
  *
  * Converts a desired bounds of the client window into the corresponding bounds
  * of the window frame (excluding invisible borders and client side shadows.)
@@ -4473,7 +4552,7 @@ meta_window_client_rect_to_frame_rect (MetaWindow    *window,
       if (frame_rect->width != G_MAXINT)
         frame_rect->width += borders.visible.left + borders.visible.right;
       if (frame_rect->height != G_MAXINT)
-        frame_rect->height += borders.visible.top  + borders.visible.bottom;
+        frame_rect->height += borders.visible.top + borders.visible.bottom;
     }
   else
     {
@@ -4491,7 +4570,8 @@ meta_window_client_rect_to_frame_rect (MetaWindow    *window,
  * meta_window_frame_rect_to_client_rect:
  * @window: a #MetaWindow
  * @frame_rect: desired frame bounds for the window
- * @client_rect: (out): location to store the computed corresponding client rectangle.
+ * @client_rect: (out): location to store the computed corresponding client
+ *rectangle.
  *
  * Converts a desired frame bounds for a window into the bounds of the client
  * window.
@@ -4513,8 +4593,8 @@ meta_window_frame_rect_to_client_rect (MetaWindow    *window,
 
       client_rect->x += borders.visible.left;
       client_rect->y += borders.visible.top;
-      client_rect->width  -= borders.visible.left + borders.visible.right;
-      client_rect->height -= borders.visible.top  + borders.visible.bottom;
+      client_rect->width -= borders.visible.left + borders.visible.right;
+      client_rect->height -= borders.visible.top + borders.visible.bottom;
     }
   else
     {
@@ -4563,11 +4643,13 @@ meta_window_get_client_area_rect (const MetaWindow      *window,
   rect->x = borders.total.left;
   rect->y = borders.total.top;
 
-  rect->width = window->buffer_rect.width - borders.total.left - borders.total.right;
+  rect->width = window->buffer_rect.width - borders.total.left -
+                borders.total.right;
   if (window->shaded)
     rect->height = 0;
   else
-    rect->height = window->buffer_rect.height - borders.total.top - borders.total.bottom;
+    rect->height = window->buffer_rect.height - borders.total.top -
+                   borders.total.bottom;
 }
 
 void
@@ -4592,7 +4674,7 @@ meta_window_get_titlebar_rect (MetaWindow    *window,
     }
 }
 
-const char*
+const char *
 meta_window_get_startup_id (MetaWindow *window)
 {
   if (window->startup_id == NULL)
@@ -4608,7 +4690,7 @@ meta_window_get_startup_id (MetaWindow *window)
   return window->startup_id;
 }
 
-static MetaWindow*
+static MetaWindow *
 get_modal_transient (MetaWindow *window)
 {
   GSList *windows;
@@ -4659,8 +4741,8 @@ meta_window_transient_can_focus (MetaWindow *window)
 
 /* XXX META_EFFECT_FOCUS */
 void
-meta_window_focus (MetaWindow  *window,
-                   guint32      timestamp)
+meta_window_focus (MetaWindow *window,
+                   guint32     timestamp)
 {
   MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
   MetaWindow *modal_transient;
@@ -4693,8 +4775,10 @@ meta_window_focus (MetaWindow  *window,
       meta_topic (META_DEBUG_FOCUS,
                   "%s has %s as a modal transient, so focusing it instead.\n",
                   window->desc, modal_transient->desc);
-      if (!meta_window_located_on_workspace (modal_transient, workspace_manager->active_workspace))
-        meta_window_change_workspace (modal_transient, workspace_manager->active_workspace);
+      if (!meta_window_located_on_workspace (modal_transient,
+                                             workspace_manager->active_workspace))
+        meta_window_change_workspace (modal_transient,
+                                      workspace_manager->active_workspace);
       window = modal_transient;
     }
 
@@ -4722,7 +4806,7 @@ meta_window_focus (MetaWindow  *window,
     meta_close_dialog_focus (window->close_dialog);
 
   if (window->wm_state_demands_attention)
-    meta_window_unset_demands_attention(window);
+    meta_window_unset_demands_attention (window);
 
 /*  meta_effect_run_focus(window, NULL, NULL); */
 }
@@ -4755,7 +4839,8 @@ set_workspace_state (MetaWindow    *window,
    * to mark as on_all_workspaces, or when unmanaging to remove all the
    * workspaces. */
   if (window->override_redirect)
-    g_return_if_fail ((window->constructing && on_all_workspaces) || window->unmanaging);
+    g_return_if_fail (
+      (window->constructing && on_all_workspaces) || window->unmanaging);
 
   if (on_all_workspaces == window->on_all_workspaces &&
       workspace == window->workspace &&
@@ -4796,7 +4881,8 @@ set_workspace_state (MetaWindow    *window,
     meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
   meta_window_queue (window, META_QUEUE_CALC_SHOWING);
   meta_window_current_workspace_changed (window);
-  g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_ON_ALL_WORKSPACES]);
+  g_object_notify_by_pspec (G_OBJECT (window),
+                            obj_props[PROP_ON_ALL_WORKSPACES]);
   g_signal_emit (window, window_signals[WORKSPACE_CHANGED], 0);
 }
 
@@ -4889,7 +4975,7 @@ meta_window_change_workspace (MetaWindow    *window,
 }
 
 static void
-window_stick_impl (MetaWindow  *window)
+window_stick_impl (MetaWindow *window)
 {
   meta_verbose ("Sticking window %s current on_all_workspaces = %d\n",
                 window->desc, window->on_all_workspaces);
@@ -4906,7 +4992,7 @@ window_stick_impl (MetaWindow  *window)
 }
 
 static void
-window_unstick_impl (MetaWindow  *window)
+window_unstick_impl (MetaWindow *window)
 {
   if (!window->on_all_workspaces_requested)
     return;
@@ -4923,7 +5009,7 @@ stick_foreach_func (MetaWindow *window,
 {
   gboolean stick;
 
-  stick = *(gboolean*)data;
+  stick = *(gboolean *) data;
   if (stick)
     window_stick_impl (window);
   else
@@ -4932,7 +5018,7 @@ stick_foreach_func (MetaWindow *window,
 }
 
 void
-meta_window_stick (MetaWindow  *window)
+meta_window_stick (MetaWindow *window)
 {
   gboolean stick = TRUE;
 
@@ -4945,7 +5031,7 @@ meta_window_stick (MetaWindow  *window)
 }
 
 void
-meta_window_unstick (MetaWindow  *window)
+meta_window_unstick (MetaWindow *window)
 {
   gboolean stick = FALSE;
 
@@ -4997,7 +5083,7 @@ meta_window_find_root_ancestor (MetaWindow *window)
 }
 
 void
-meta_window_raise (MetaWindow  *window)
+meta_window_raise (MetaWindow *window)
 {
   MetaWindow *ancestor;
 
@@ -5023,10 +5109,10 @@ meta_window_raise (MetaWindow  *window)
   else
     {
       meta_warning (
-                    "Either stacks aren't per screen or some window has a weird "
-                    "transient_for hint; window->display->stack != "
-                    "ancestor->screen->stack.  window = %s, ancestor = %s.\n",
-                    window->desc, ancestor->desc);
+        "Either stacks aren't per screen or some window has a weird "
+        "transient_for hint; window->display->stack != "
+        "ancestor->screen->stack.  window = %s, ancestor = %s.\n",
+        window->desc, ancestor->desc);
       /* We could raise the window here, but don't want to do that twice and
        * so we let the case below handle that.
        */
@@ -5044,7 +5130,7 @@ meta_window_raise (MetaWindow  *window)
 }
 
 void
-meta_window_lower (MetaWindow  *window)
+meta_window_lower (MetaWindow *window)
 {
   g_return_if_fail (!window->override_redirect);
 
@@ -5065,7 +5151,7 @@ meta_window_change_workspace_by_index (MetaWindow *window,
 {
   MetaWorkspaceManager *workspace_manager;
   MetaWorkspace *workspace;
-  MetaDisplay   *display;
+  MetaDisplay *display;
 
   g_return_if_fail (!window->override_redirect);
 
@@ -5079,10 +5165,13 @@ meta_window_change_workspace_by_index (MetaWindow *window,
   workspace_manager = display->workspace_manager;
 
   workspace =
-    meta_workspace_manager_get_workspace_by_index (workspace_manager, space_index);
+    meta_workspace_manager_get_workspace_by_index (workspace_manager,
+                                                   space_index);
 
   if (!workspace && append)
-    workspace = meta_workspace_manager_append_new_workspace (workspace_manager, FALSE, META_CURRENT_TIME);
+    workspace = meta_workspace_manager_append_new_workspace (workspace_manager,
+                                                             FALSE,
+                                                             META_CURRENT_TIME);
 
   if (workspace)
     meta_window_change_workspace (window, workspace);
@@ -5202,7 +5291,7 @@ meta_window_set_focused_internal (MetaWindow *window,
           meta_window_located_on_workspace (window,
                                             workspace_manager->active_workspace))
         {
-          GList* link;
+          GList *link;
           link = g_list_find (workspace_manager->active_workspace->mru_list,
                               window);
           g_assert (link);
@@ -5234,11 +5323,11 @@ meta_window_set_focused_internal (MetaWindow *window,
        * There is dicussion in bugs 102209, 115072, and 461577
        */
       if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_CLICK ||
-          !meta_prefs_get_raise_on_click())
+          !meta_prefs_get_raise_on_click ())
         {
           meta_display_ungrab_focus_window_button (window->display, window);
           /* Since we ungrab with XIAnyModifier above, all button
-             grabs go way so we need to re-grab the window buttons. */
+           *  grabs go way so we need to re-grab the window buttons. */
           meta_display_grab_window_buttons (window->display, window->xwindow);
         }
 
@@ -5383,7 +5472,8 @@ meta_window_update_icon_now (MetaWindow *window,
 
   g_return_if_fail (!window->override_redirect);
 
-  changed = META_WINDOW_GET_CLASS (window)->update_icon (window, &icon, &mini_icon);
+  changed = META_WINDOW_GET_CLASS (window)->update_icon (window, &icon,
+                                                         &mini_icon);
 
   if (changed || force)
     {
@@ -5453,7 +5543,7 @@ idle_update_icon (gpointer data)
   return FALSE;
 }
 
-GList*
+GList *
 meta_window_get_workspaces (MetaWindow *window)
 {
   MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
@@ -5493,7 +5583,7 @@ static void
 meta_window_type_changed (MetaWindow *window)
 {
   gboolean old_decorated = window->decorated;
-  GObject  *object = G_OBJECT (window);
+  GObject *object = G_OBJECT (window);
 
   window->attached = meta_window_should_attach_to_parent (window);
   meta_window_recalc_features (window);
@@ -5523,8 +5613,8 @@ meta_window_type_changed (MetaWindow *window)
 }
 
 void
-meta_window_set_type (MetaWindow     *window,
-                      MetaWindowType  type)
+meta_window_set_type (MetaWindow    *window,
+                      MetaWindowType type)
 {
   if (window->type == type)
     return;
@@ -5545,7 +5635,9 @@ meta_window_get_default_skip_hints (MetaWindow *window,
                                     gboolean   *skip_taskbar_out,
                                     gboolean   *skip_pager_out)
 {
-  META_WINDOW_GET_CLASS (window)->get_default_skip_hints (window, skip_taskbar_out, skip_pager_out);
+  META_WINDOW_GET_CLASS (window)->get_default_skip_hints (window,
+                                                          skip_taskbar_out,
+                                                          skip_pager_out);
 }
 
 static void
@@ -5553,7 +5645,7 @@ meta_window_recalc_skip_features (MetaWindow *window)
 {
   switch (window->type)
     {
-      /* Force skip taskbar/pager on these window types */
+    /* Force skip taskbar/pager on these window types */
     case META_WINDOW_DESKTOP:
     case META_WINDOW_DOCK:
     case META_WINDOW_TOOLBAR:
@@ -5574,7 +5666,7 @@ meta_window_recalc_skip_features (MetaWindow *window)
     case META_WINDOW_DIALOG:
     case META_WINDOW_MODAL_DIALOG:
       /* only skip taskbar if we have a real transient parent
-         (and ignore the application hints) */
+       *  (and ignore the application hints) */
       if (window->transient_for != NULL)
         window->skip_taskbar = TRUE;
       else
@@ -5582,13 +5674,14 @@ meta_window_recalc_skip_features (MetaWindow *window)
       break;
 
     case META_WINDOW_NORMAL:
-      {
-        gboolean skip_taskbar_hint, skip_pager_hint;
-        meta_window_get_default_skip_hints (window, &skip_taskbar_hint, &skip_pager_hint);
-        window->skip_taskbar = skip_taskbar_hint;
-        window->skip_pager = skip_pager_hint;
-      }
-      break;
+    {
+      gboolean skip_taskbar_hint, skip_pager_hint;
+      meta_window_get_default_skip_hints (window, &skip_taskbar_hint,
+                                          &skip_pager_hint);
+      window->skip_taskbar = skip_taskbar_hint;
+      window->skip_pager = skip_pager_hint;
+    }
+    break;
     }
 }
 
@@ -5638,12 +5731,13 @@ meta_window_recalc_features (MetaWindow *window)
        * about these apps but make them work.
        */
 
-      meta_warning ("Window %s sets an MWM hint indicating it isn't resizable, but sets min size %d x %d and 
max size %d x %d; this doesn't make much sense.\n",
-                    window->desc,
-                    window->size_hints.min_width,
-                    window->size_hints.min_height,
-                    window->size_hints.max_width,
-                    window->size_hints.max_height);
+      meta_warning (
+        "Window %s sets an MWM hint indicating it isn't resizable, but sets min size %d x %d and max size %d 
x %d; this doesn't make much sense.\n",
+        window->desc,
+        window->size_hints.min_width,
+        window->size_hints.min_height,
+        window->size_hints.max_width,
+        window->size_hints.max_height);
     }
 
   window->has_shade_func = TRUE;
@@ -5775,12 +5869,12 @@ meta_window_recalc_features (MetaWindow *window)
    * The fix is to only recalc_features when something has
    * actually changed.
    */
-  if (window->constructing                               ||
-      old_has_close_func != window->has_close_func       ||
+  if (window->constructing ||
+      old_has_close_func != window->has_close_func ||
       old_has_minimize_func != window->has_minimize_func ||
-      old_has_move_func != window->has_move_func         ||
-      old_has_resize_func != window->has_resize_func     ||
-      old_has_shade_func != window->has_shade_func       ||
+      old_has_move_func != window->has_move_func ||
+      old_has_resize_func != window->has_resize_func ||
+      old_has_shade_func != window->has_shade_func ||
       old_always_sticky != window->always_sticky)
     set_allowed_actions_hint (window);
 
@@ -5795,31 +5889,33 @@ meta_window_recalc_features (MetaWindow *window)
 }
 
 void
-meta_window_show_menu (MetaWindow         *window,
-                       MetaWindowMenuType  menu,
-                       int                 x,
-                       int                 y)
+meta_window_show_menu (MetaWindow        *window,
+                       MetaWindowMenuType menu,
+                       int                x,
+                       int                y)
 {
   g_return_if_fail (!window->override_redirect);
-  meta_compositor_show_window_menu (window->display->compositor, window, menu, x, y);
+  meta_compositor_show_window_menu (window->display->compositor, window, menu,
+                                    x, y);
 }
 
 void
-meta_window_show_menu_for_rect (MetaWindow         *window,
-                                MetaWindowMenuType  menu,
-                                MetaRectangle      *rect)
+meta_window_show_menu_for_rect (MetaWindow        *window,
+                                MetaWindowMenuType menu,
+                                MetaRectangle     *rect)
 {
   g_return_if_fail (!window->override_redirect);
-  meta_compositor_show_window_menu_for_rect (window->display->compositor, window, menu, rect);
+  meta_compositor_show_window_menu_for_rect (window->display->compositor,
+                                             window, menu, rect);
 }
 
 void
 meta_window_shove_titlebar_onscreen (MetaWindow *window)
 {
   MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
-  MetaRectangle  frame_rect;
-  GList         *onscreen_region;
-  int            horiz_amount, vert_amount;
+  MetaRectangle frame_rect;
+  GList *onscreen_region;
+  int horiz_amount, vert_amount;
 
   g_return_if_fail (!window->override_redirect);
 
@@ -5836,15 +5932,15 @@ meta_window_shove_titlebar_onscreen (MetaWindow *window)
    * normal.
    */
   horiz_amount = frame_rect.width;
-  vert_amount  = frame_rect.height;
+  vert_amount = frame_rect.height;
   meta_rectangle_expand_region (onscreen_region,
                                 horiz_amount,
                                 horiz_amount,
                                 0,
                                 vert_amount);
-  meta_rectangle_shove_into_region(onscreen_region,
-                                   FIXED_DIRECTION_X,
-                                   &frame_rect);
+  meta_rectangle_shove_into_region (onscreen_region,
+                                    FIXED_DIRECTION_X,
+                                    &frame_rect);
   meta_rectangle_expand_region (onscreen_region,
                                 -horiz_amount,
                                 -horiz_amount,
@@ -5858,12 +5954,12 @@ gboolean
 meta_window_titlebar_is_onscreen (MetaWindow *window)
 {
   MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
-  MetaRectangle  titlebar_rect, frame_rect;
-  GList         *onscreen_region;
-  gboolean       is_onscreen;
+  MetaRectangle titlebar_rect, frame_rect;
+  GList *onscreen_region;
+  gboolean is_onscreen;
 
-  const int min_height_needed  = 8;
-  const float min_width_percent  = 0.5;
+  const int min_height_needed = 8;
+  const float min_width_percent = 0.5;
   const int min_width_absolute = 50;
 
   /* Titlebar can't be offscreen if there is no titlebar... */
@@ -5890,8 +5986,8 @@ meta_window_titlebar_is_onscreen (MetaWindow *window)
 
       meta_rectangle_intersect (&titlebar_rect, spanning_rect, &overlap);
       if (overlap.height > MIN (titlebar_rect.height, min_height_needed) &&
-          overlap.width  > MIN (titlebar_rect.width * min_width_percent,
-                                min_width_absolute))
+          overlap.width > MIN (titlebar_rect.width * min_width_percent,
+                               min_width_absolute))
         {
           is_onscreen = TRUE;
           break;
@@ -5911,7 +6007,7 @@ timeval_to_ms (const GTimeVal *timeval)
 
 static double
 time_diff (const GTimeVal *first,
-          const GTimeVal *second)
+           const GTimeVal *second)
 {
   double first_ms = timeval_to_ms (first);
   double second_ms = timeval_to_ms (second);
@@ -5921,7 +6017,7 @@ time_diff (const GTimeVal *first,
 
 static gboolean
 check_moveresize_frequency (MetaWindow *window,
-                           gdouble    *remaining)
+                            gdouble    *remaining)
 {
   GTimeVal current_time;
   const double max_resizes_per_second = 25.0;
@@ -5936,7 +6032,8 @@ check_moveresize_frequency (MetaWindow *window,
       window->sync_request_alarm != None)
     return TRUE;
 
-  elapsed = time_diff (&current_time, &window->display->grab_last_moveresize_time);
+  elapsed = time_diff (&current_time,
+                       &window->display->grab_last_moveresize_time);
 
   if (elapsed >= 0.0 && elapsed < ms_between_resizes)
     {
@@ -6026,10 +6123,10 @@ update_move_maybe_tile (MetaWindow *window,
 }
 
 static void
-update_move (MetaWindow  *window,
-             gboolean     snap,
-             int          x,
-             int          y)
+update_move (MetaWindow *window,
+             gboolean    snap,
+             int         x,
+             int         y)
 {
   int dx, dy;
   int new_x, new_y;
@@ -6067,12 +6164,12 @@ update_move (MetaWindow  *window,
    */
 #define DRAG_THRESHOLD_TO_SHAKE_THRESHOLD_FACTOR 6
   shake_threshold = meta_prefs_get_drag_threshold () *
-    DRAG_THRESHOLD_TO_SHAKE_THRESHOLD_FACTOR;
+                    DRAG_THRESHOLD_TO_SHAKE_THRESHOLD_FACTOR;
 
   if (snap)
     {
       /* We don't want to tile while snapping. Also, clear any previous tile
-         request. */
+       *  request. */
       display->preview_tile_mode = META_TILE_NONE;
       window->tile_monitor_number = -1;
     }
@@ -6089,7 +6186,8 @@ update_move (MetaWindow  *window,
    */
 
   if ((META_WINDOW_MAXIMIZED (window) && ABS (dy) >= shake_threshold) ||
-      (META_WINDOW_TILED_SIDE_BY_SIDE (window) && (MAX (ABS (dx), ABS (dy)) >= shake_threshold)))
+      (META_WINDOW_TILED_SIDE_BY_SIDE (window) &&
+       (MAX (ABS (dx), ABS (dy)) >= shake_threshold)))
     {
       double prop;
 
@@ -6102,8 +6200,8 @@ update_move (MetaWindow  *window,
 
       /* move the unmaximized window to the cursor */
       prop =
-        ((double)(x - display->grab_initial_window_pos.x)) /
-        ((double)display->grab_initial_window_pos.width);
+        ((double) (x - display->grab_initial_window_pos.x)) /
+        ((double) display->grab_initial_window_pos.width);
 
       display->grab_initial_window_pos.x = x - window->saved_rect.width * prop;
 
@@ -6114,7 +6212,8 @@ update_move (MetaWindow  *window,
         {
           MetaRectangle titlebar_rect;
           meta_window_get_titlebar_rect (window, &titlebar_rect);
-          display->grab_anchor_root_y = display->grab_initial_window_pos.y + titlebar_rect.height / 2;
+          display->grab_anchor_root_y = display->grab_initial_window_pos.y +
+                                        titlebar_rect.height / 2;
         }
 
       window->saved_rect.x = display->grab_initial_window_pos.x;
@@ -6128,7 +6227,8 @@ update_move (MetaWindow  *window,
    * loose or it is still maximized (then move straight)
    */
   else if ((window->shaken_loose || META_WINDOW_MAXIMIZED (window)) &&
-           window->tile_mode != META_TILE_LEFT && window->tile_mode != META_TILE_RIGHT)
+           window->tile_mode != META_TILE_LEFT &&
+           window->tile_mode != META_TILE_RIGHT)
     {
       MetaBackend *backend = meta_get_backend ();
       MetaMonitorManager *monitor_manager =
@@ -6226,7 +6326,7 @@ update_resize_timeout (gpointer data)
 
 static void
 update_resize (MetaWindow *window,
-               gboolean    snap,
+               gboolean snap,
                int x, int y,
                gboolean force)
 {
@@ -6264,7 +6364,8 @@ update_resize (MetaWindow *window,
 
   if (window->display->grab_op == META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN)
     {
-      MetaGrabOp op = META_GRAB_OP_WINDOW_BASE | META_GRAB_OP_WINDOW_FLAG_KEYBOARD;
+      MetaGrabOp op = META_GRAB_OP_WINDOW_BASE |
+                      META_GRAB_OP_WINDOW_FLAG_KEYBOARD;
 
       if (dx > 0)
         op |= META_GRAB_OP_WINDOW_DIR_EAST;
@@ -6306,12 +6407,12 @@ update_resize (MetaWindow *window,
        * generates another event.
        */
       if (!window->display->grab_resize_timeout_id)
-       {
-         window->display->grab_resize_timeout_id =
-           g_timeout_add ((int)remaining, update_resize_timeout, window);
-         g_source_set_name_by_id (window->display->grab_resize_timeout_id,
+        {
+          window->display->grab_resize_timeout_id =
+            g_timeout_add ((int) remaining, update_resize_timeout, window);
+          g_source_set_name_by_id (window->display->grab_resize_timeout_id,
                                    "[mutter] update_resize_timeout");
-       }
+        }
 
       return;
     }
@@ -6330,10 +6431,12 @@ update_resize (MetaWindow *window,
    * to avoid some nasty flicker, we enforce that.
    */
 
-  if ((window->display->grab_op & (META_GRAB_OP_WINDOW_DIR_WEST | META_GRAB_OP_WINDOW_DIR_EAST)) == 0)
+  if ((window->display->grab_op &
+       (META_GRAB_OP_WINDOW_DIR_WEST | META_GRAB_OP_WINDOW_DIR_EAST)) == 0)
     new_w = old.width;
 
-  if ((window->display->grab_op & (META_GRAB_OP_WINDOW_DIR_NORTH | META_GRAB_OP_WINDOW_DIR_SOUTH)) == 0)
+  if ((window->display->grab_op &
+       (META_GRAB_OP_WINDOW_DIR_NORTH | META_GRAB_OP_WINDOW_DIR_SOUTH)) == 0)
     new_h = old.height;
 
   /* compute gravity of client during operation */
@@ -6376,7 +6479,7 @@ maybe_maximize_tiled_window (MetaWindow *window)
 
 void
 meta_window_update_resize (MetaWindow *window,
-                           gboolean    snap,
+                           gboolean snap,
                            int x, int y,
                            gboolean force)
 {
@@ -6384,7 +6487,7 @@ meta_window_update_resize (MetaWindow *window,
 }
 
 static void
-end_grab_op (MetaWindow *window,
+end_grab_op (MetaWindow         *window,
              const ClutterEvent *event)
 {
   ClutterModifierType modifiers;
@@ -6435,48 +6538,52 @@ meta_window_handle_mouse_grab_op_event  (MetaWindow         *window,
   switch (event->type)
     {
     case CLUTTER_BUTTON_PRESS:
-      {
-        ClutterModifierType grab_mods = meta_display_get_window_grab_modifiers (window->display);
+    {
+      ClutterModifierType grab_mods = meta_display_get_window_grab_modifiers (
+        window->display);
 
-        /* This is the keybinding or menu case where we've
-         * been dragging around the window without the button
-         * pressed. */
+      /* This is the keybinding or menu case where we've
+       * been dragging around the window without the button
+       * pressed. */
 
-        if ((meta_grab_op_is_mouse (window->display->grab_op) &&
-             (event->button.modifier_state & grab_mods) == grab_mods &&
-             window->display->grab_button != (int) event->button.button) ||
-            meta_grab_op_is_keyboard (window->display->grab_op))
-          {
-            end_grab_op (window, event);
-            return FALSE;
-          }
-        return TRUE;
-      }
+      if ((meta_grab_op_is_mouse (window->display->grab_op) &&
+           (event->button.modifier_state & grab_mods) == grab_mods &&
+           window->display->grab_button != (int) event->button.button) ||
+          meta_grab_op_is_keyboard (window->display->grab_op))
+        {
+          end_grab_op (window, event);
+          return FALSE;
+        }
+      return TRUE;
+    }
 
     case CLUTTER_TOUCH_END:
-      if (meta_display_is_pointer_emulating_sequence (window->display, sequence))
+      if (meta_display_is_pointer_emulating_sequence (window->display,
+                                                      sequence))
         end_grab_op (window, event);
 
       return TRUE;
 
     case CLUTTER_BUTTON_RELEASE:
       if (event->button.button == 1 ||
-          event->button.button == (unsigned int) meta_prefs_get_mouse_button_resize ())
+          event->button.button ==
+          (unsigned int) meta_prefs_get_mouse_button_resize ())
         end_grab_op (window, event);
 
       return TRUE;
 
     case CLUTTER_TOUCH_BEGIN:
-      /* This will only catch the keybinding and menu cases, just deal with this
-       * like a CLUTTER_TOUCH_UPDATE rather than a CLUTTER_BUTTON_PRESS, and
-       * wait until CLUTTER_TOUCH_END to undo the grab, just so the window
-       * doesn't warp below the finger and remain there.
-       */
+    /* This will only catch the keybinding and menu cases, just deal with this
+     * like a CLUTTER_TOUCH_UPDATE rather than a CLUTTER_BUTTON_PRESS, and
+     * wait until CLUTTER_TOUCH_END to undo the grab, just so the window
+     * doesn't warp below the finger and remain there.
+     */
     case CLUTTER_TOUCH_UPDATE:
-      if (!meta_display_is_pointer_emulating_sequence (window->display, sequence))
+      if (!meta_display_is_pointer_emulating_sequence (window->display,
+                                                       sequence))
         return FALSE;
 
-      /* Fall through */
+    /* Fall through */
     case CLUTTER_MOTION:
       modifier_state = clutter_event_get_state (event);
       clutter_event_get_coords (event, &x, &y);
@@ -6564,7 +6671,8 @@ meta_window_get_work_area_for_monitor (MetaWindow    *window,
                                        MetaRectangle *area)
 {
   MetaBackend *backend = meta_get_backend ();
-  MetaMonitorManager *monitor_manager = meta_backend_get_monitor_manager (backend);
+  MetaMonitorManager *monitor_manager = meta_backend_get_monitor_manager (
+    backend);
   MetaLogicalMonitor *logical_monitor;
 
   g_return_if_fail (which_monitor >= 0);
@@ -6621,7 +6729,9 @@ meta_window_get_current_tile_monitor_number (MetaWindow *window)
 
   if (tile_monitor_number < 0)
     {
-      meta_warning ("%s called with an invalid monitor number; using 0 instead\n", G_STRFUNC);
+      meta_warning (
+        "%s called with an invalid monitor number; using 0 instead\n",
+        G_STRFUNC);
       tile_monitor_number = 0;
     }
 
@@ -6641,7 +6751,8 @@ meta_window_get_tile_area (MetaWindow    *window,
 
   tile_monitor_number = meta_window_get_current_tile_monitor_number (window);
 
-  meta_window_get_work_area_for_monitor (window, tile_monitor_number, &work_area);
+  meta_window_get_work_area_for_monitor (window, tile_monitor_number,
+                                         &work_area);
   meta_window_get_tile_fraction (window, tile_mode, &fraction);
 
   *tile_area = work_area;
@@ -6655,13 +6766,13 @@ gboolean
 meta_window_same_application (MetaWindow *window,
                               MetaWindow *other_window)
 {
-  MetaGroup *group       = meta_window_get_group (window);
+  MetaGroup *group = meta_window_get_group (window);
   MetaGroup *other_group = meta_window_get_group (other_window);
 
   return
-    group!=NULL &&
-    other_group!=NULL &&
-    group==other_group;
+    group != NULL &&
+    other_group != NULL &&
+    group == other_group;
 }
 
 /**
@@ -6695,7 +6806,8 @@ meta_window_is_client_decorated (MetaWindow *window)
 /**
  * meta_window_foreach_transient:
  * @window: a #MetaWindow
- * @func: (scope call) (closure user_data): Called for each window which is a transient of @window 
(transitively)
+ * @func: (scope call) (closure user_data): Called for each window which is a
+ *transient of @window (transitively)
  * @user_data: User data
  *
  * Call @func for every window which is either transient for @window, or is
@@ -6705,9 +6817,9 @@ meta_window_is_client_decorated (MetaWindow *window)
  * Iteration will stop if @func at any point returns %FALSE.
  */
 void
-meta_window_foreach_transient (MetaWindow            *window,
-                               MetaWindowForeachFunc  func,
-                               void                  *user_data)
+meta_window_foreach_transient (MetaWindow           *window,
+                               MetaWindowForeachFunc func,
+                               void                 *user_data)
 {
   GSList *windows;
   GSList *tmp;
@@ -6721,7 +6833,7 @@ meta_window_foreach_transient (MetaWindow            *window,
 
       if (meta_window_is_ancestor_of_transient (window, transient))
         {
-          if (!(* func) (transient, user_data))
+          if (!(*func)(transient, user_data))
             break;
         }
 
@@ -6734,16 +6846,18 @@ meta_window_foreach_transient (MetaWindow            *window,
 /**
  * meta_window_foreach_ancestor:
  * @window: a #MetaWindow
- * @func: (scope call) (closure user_data): Called for each window which is a transient parent of @window
+ * @func: (scope call) (closure user_data): Called for each window which is a
+ *transient parent of @window
  * @user_data: User data
  *
  * If @window is transient, call @func with the window for which it's transient,
- * repeatedly until either we find a non-transient window, or @func returns %FALSE.
+ * repeatedly until either we find a non-transient window, or @func returns
+ *%FALSE.
  */
 void
-meta_window_foreach_ancestor (MetaWindow            *window,
-                              MetaWindowForeachFunc  func,
-                              void                  *user_data)
+meta_window_foreach_ancestor (MetaWindow           *window,
+                              MetaWindowForeachFunc func,
+                              void                 *user_data)
 {
   MetaWindow *w;
 
@@ -6755,7 +6869,7 @@ meta_window_foreach_ancestor (MetaWindow            *window,
 
       w = w->transient_for;
     }
-  while (w && (* func) (w, user_data));
+  while (w && (*func)(w, user_data));
 }
 
 typedef struct
@@ -6808,10 +6922,10 @@ meta_window_is_ancestor_of_transient (MetaWindow *window,
  * return root coordinates where pointer ended up.
  */
 static gboolean
-warp_grab_pointer (MetaWindow          *window,
-                   MetaGrabOp           grab_op,
-                   int                 *x,
-                   int                 *y)
+warp_grab_pointer (MetaWindow *window,
+                   MetaGrabOp  grab_op,
+                   int        *x,
+                   int        *y)
 {
   MetaRectangle rect;
   MetaRectangle display_rect = { 0 };
@@ -6956,12 +7070,12 @@ ensure_mru_position_after (MetaWindow *window,
    */
 
   MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
-  GList* active_mru_list;
-  GList* window_position;
-  GList* after_this_one_position;
+  GList *active_mru_list;
+  GList *window_position;
+  GList *after_this_one_position;
 
-  active_mru_list         = workspace_manager->active_workspace->mru_list;
-  window_position         = g_list_find (active_mru_list, window);
+  active_mru_list = workspace_manager->active_workspace->mru_list;
+  window_position = g_list_find (active_mru_list, window);
   after_this_one_position = g_list_find (active_mru_list, after_this_one);
 
   /* after_this_one_position is NULL when we switch workspaces, but in
@@ -6994,7 +7108,7 @@ void
 meta_window_stack_just_below (MetaWindow *window,
                               MetaWindow *below_this_one)
 {
-  g_return_if_fail (window         != NULL);
+  g_return_if_fail (window != NULL);
   g_return_if_fail (below_this_one != NULL);
 
   if (window->stack_position > below_this_one->stack_position)
@@ -7018,7 +7132,7 @@ void
 meta_window_stack_just_above (MetaWindow *window,
                               MetaWindow *above_this_one)
 {
-  g_return_if_fail (window         != NULL);
+  g_return_if_fail (window != NULL);
   g_return_if_fail (above_this_one != NULL);
 
   if (window->stack_position < above_this_one->stack_position)
@@ -7047,8 +7161,10 @@ meta_window_stack_just_above (MetaWindow *window,
  * for non-override-redirect windows.
  *
  * The property is set by Mutter initially upon window creation,
- * and updated thereafter on input events (key and button presses) seen by Mutter,
- * client updates to the _NET_WM_USER_TIME property (if later than the current time)
+ * and updated thereafter on input events (key and button presses) seen by
+ *Mutter,
+ * client updates to the _NET_WM_USER_TIME property (if later than the current
+ *time)
  * and when focusing the window.
  *
  * Returns: The last time the user interacted with this window.
@@ -7092,7 +7208,8 @@ meta_window_set_user_time (MetaWindow *window,
       /* If this is a terminal, user interaction with it means the user likely
        * doesn't want to have focus transferred for now due to new windows.
        */
-      if (meta_prefs_get_focus_new_windows () == G_DESKTOP_FOCUS_NEW_WINDOWS_STRICT &&
+      if (meta_prefs_get_focus_new_windows () ==
+          G_DESKTOP_FOCUS_NEW_WINDOWS_STRICT &&
           window_is_terminal (window))
         window->display->allow_terminal_deactivation = FALSE;
     }
@@ -7178,7 +7295,8 @@ meta_window_set_demands_attention (MetaWindow *window)
 
       window->wm_state_demands_attention = TRUE;
       set_net_wm_state (window);
-      g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_DEMANDS_ATTENTION]);
+      g_object_notify_by_pspec (G_OBJECT (window),
+                                obj_props[PROP_DEMANDS_ATTENTION]);
       g_signal_emit_by_name (window->display, "window-demands-attention",
                              window);
     }
@@ -7187,9 +7305,9 @@ meta_window_set_demands_attention (MetaWindow *window)
       /* If the window's in full view, there's no point setting the flag. */
 
       meta_topic (META_DEBUG_WINDOW_OPS,
-                 "Not marking %s as needing attention because "
-                 "it's in full view\n",
-                 window->desc);
+                  "Not marking %s as needing attention because "
+                  "it's in full view\n",
+                  window->desc);
     }
 }
 
@@ -7197,13 +7315,14 @@ void
 meta_window_unset_demands_attention (MetaWindow *window)
 {
   meta_topic (META_DEBUG_WINDOW_OPS,
-      "Marking %s as not needing attention\n", window->desc);
+              "Marking %s as not needing attention\n", window->desc);
 
   if (window->wm_state_demands_attention)
     {
       window->wm_state_demands_attention = FALSE;
       set_net_wm_state (window);
-      g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_DEMANDS_ATTENTION]);
+      g_object_notify_by_pspec (G_OBJECT (window),
+                                obj_props[PROP_DEMANDS_ATTENTION]);
     }
 }
 
@@ -7709,8 +7828,10 @@ meta_window_get_frame_type (MetaWindow *window)
       return META_FRAME_TYPE_LAST;
     }
   else if (window->border_only ||
-           (window->hide_titlebar_when_maximized && META_WINDOW_MAXIMIZED (window)) ||
-           (window->hide_titlebar_when_maximized && META_WINDOW_TILED_SIDE_BY_SIDE (window)))
+           (window->hide_titlebar_when_maximized &&
+            META_WINDOW_MAXIMIZED (window)) ||
+           (window->hide_titlebar_when_maximized &&
+            META_WINDOW_TILED_SIDE_BY_SIDE (window)))
     {
       /* override base frame type */
       return META_FRAME_TYPE_BORDER;
@@ -7788,8 +7909,8 @@ meta_window_compute_tile_match (MetaWindow *window)
 }
 
 static MetaWindow *
-meta_window_find_tile_match (MetaWindow   *window,
-                             MetaTileMode  current_mode)
+meta_window_find_tile_match (MetaWindow  *window,
+                             MetaTileMode current_mode)
 {
   MetaWindow *match;
   MetaStack *stack;
@@ -7815,7 +7936,8 @@ meta_window_find_tile_match (MetaWindow   *window,
           !match->minimized &&
           match->tile_mode == match_tile_mode &&
           match->tile_monitor_number == window->tile_monitor_number &&
-          meta_window_get_workspace (match) == meta_window_get_workspace (window))
+          meta_window_get_workspace (match) ==
+          meta_window_get_workspace (window))
         break;
     }
 
@@ -7849,8 +7971,10 @@ meta_window_find_tile_match (MetaWindow   *window,
             window->tile_match != NULL))
         {
           int threshold = meta_prefs_get_drag_threshold ();
-          if (ABS (topmost_rect.x - bottommost_rect.x - bottommost_rect.width) > threshold &&
-              ABS (bottommost_rect.x - topmost_rect.x - topmost_rect.width) > threshold)
+          if (ABS (topmost_rect.x - bottommost_rect.x - bottommost_rect.width) >
+              threshold &&
+              ABS (bottommost_rect.x - topmost_rect.x - topmost_rect.width) >
+              threshold)
             return NULL;
         }
 
@@ -7864,7 +7988,8 @@ meta_window_find_tile_match (MetaWindow   *window,
         {
           if (above->minimized ||
               above->monitor != window->monitor ||
-              meta_window_get_workspace (above) != meta_window_get_workspace (window))
+              meta_window_get_workspace (above) !=
+              meta_window_get_workspace (window))
             continue;
 
           meta_window_get_frame_rect (above, &above_rect);
@@ -7920,27 +8045,33 @@ meta_window_set_gtk_dbus_properties (MetaWindow *window,
 
   g_free (window->gtk_application_id);
   window->gtk_application_id = g_strdup (application_id);
-  g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_GTK_APPLICATION_ID]);
+  g_object_notify_by_pspec (G_OBJECT (
+                              window), obj_props[PROP_GTK_APPLICATION_ID]);
 
   g_free (window->gtk_unique_bus_name);
   window->gtk_unique_bus_name = g_strdup (unique_bus_name);
-  g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_GTK_UNIQUE_BUS_NAME]);
+  g_object_notify_by_pspec (G_OBJECT (window),
+                            obj_props[PROP_GTK_UNIQUE_BUS_NAME]);
 
   g_free (window->gtk_app_menu_object_path);
   window->gtk_app_menu_object_path = g_strdup (appmenu_path);
-  g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_GTK_APP_MENU_OBJECT_PATH]);
+  g_object_notify_by_pspec (G_OBJECT (window),
+                            obj_props[PROP_GTK_APP_MENU_OBJECT_PATH]);
 
   g_free (window->gtk_menubar_object_path);
   window->gtk_menubar_object_path = g_strdup (menubar_path);
-  g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_GTK_MENUBAR_OBJECT_PATH]);
+  g_object_notify_by_pspec (G_OBJECT (window),
+                            obj_props[PROP_GTK_MENUBAR_OBJECT_PATH]);
 
   g_free (window->gtk_application_object_path);
   window->gtk_application_object_path = g_strdup (application_object_path);
-  g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_GTK_APPLICATION_OBJECT_PATH]);
+  g_object_notify_by_pspec (G_OBJECT (window),
+                            obj_props[PROP_GTK_APPLICATION_OBJECT_PATH]);
 
   g_free (window->gtk_window_object_path);
   window->gtk_window_object_path = g_strdup (window_object_path);
-  g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_GTK_WINDOW_OBJECT_PATH]);
+  g_object_notify_by_pspec (G_OBJECT (window),
+                            obj_props[PROP_GTK_WINDOW_OBJECT_PATH]);
 
   g_object_thaw_notify (G_OBJECT (window));
 }
@@ -7952,7 +8083,7 @@ check_transient_for_loop (MetaWindow *window,
   while (parent)
     {
       if (parent == window)
-          return TRUE;
+        return TRUE;
       parent = parent->transient_for;
     }
 
@@ -8024,7 +8155,8 @@ meta_window_set_transient_for (MetaWindow *window,
     meta_window_group_leader_changed (window);
 
   if (!window->constructing && !window->override_redirect)
-    meta_window_queue (window, META_QUEUE_MOVE_RESIZE | META_QUEUE_CALC_SHOWING);
+    meta_window_queue (window,
+                       META_QUEUE_MOVE_RESIZE | META_QUEUE_CALC_SHOWING);
 
   if (meta_window_appears_focused (window) && window->transient_for != NULL)
     meta_window_propagate_focus_appearance (window, TRUE);
@@ -8060,8 +8192,8 @@ typedef struct
 } MetaFocusData;
 
 static void
-mouse_mode_focus (MetaWindow  *window,
-                  guint32      timestamp)
+mouse_mode_focus (MetaWindow *window,
+                  guint32     timestamp)
 {
   MetaDisplay *display = window->display;
 
@@ -8091,7 +8223,7 @@ mouse_mode_focus (MetaWindow  *window,
        * EnterNotify events on override-redirect windows, this
        * alternative mechanism works great.
        */
-      if (meta_prefs_get_focus_mode() == G_DESKTOP_FOCUS_MODE_MOUSE &&
+      if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_MOUSE &&
           display->focus_window != NULL)
         {
           meta_topic (META_DEBUG_FOCUS,
@@ -8181,7 +8313,7 @@ window_focus_on_pointer_rest_callback (gpointer data)
   timestamp = meta_display_get_current_time_roundtrip (display);
   mouse_mode_focus (window, timestamp);
 
- out:
+out:
   display->focus_timeout_id = 0;
   return G_SOURCE_REMOVE;
 }
@@ -8219,10 +8351,10 @@ queue_focus_callback (MetaDisplay *display,
 }
 
 void
-meta_window_handle_enter (MetaWindow  *window,
-                          guint32      timestamp,
-                          guint        root_x,
-                          guint        root_y)
+meta_window_handle_enter (MetaWindow *window,
+                          guint32     timestamp,
+                          guint       root_x,
+                          guint       root_y)
 {
   MetaDisplay *display = window->display;
 
@@ -8233,7 +8365,7 @@ meta_window_handle_enter (MetaWindow  *window,
       display->mouse_mode = TRUE;
       if (window->type != META_WINDOW_DOCK)
         {
-          if (meta_prefs_get_focus_change_on_pointer_rest())
+          if (meta_prefs_get_focus_change_on_pointer_rest ())
             queue_focus_callback (display, window, root_x, root_y);
           else
             mouse_mode_focus (window, timestamp);
@@ -8268,7 +8400,8 @@ meta_window_handle_ungrabbed_event (MetaWindow         *window,
   gfloat x, y;
   guint button;
 
-  if (window->frame && meta_ui_frame_handle_event (window->frame->ui_frame, event))
+  if (window->frame &&
+      meta_ui_frame_handle_event (window->frame->ui_frame, event))
     return;
 
   if (event->type != CLUTTER_BUTTON_PRESS &&
@@ -8281,7 +8414,8 @@ meta_window_handle_ungrabbed_event (MetaWindow         *window,
 
       button = 1;
       sequence = clutter_event_get_event_sequence (event);
-      if (!meta_display_is_pointer_emulating_sequence (window->display, sequence))
+      if (!meta_display_is_pointer_emulating_sequence (window->display,
+                                                       sequence))
         return;
     }
   else
@@ -8348,7 +8482,8 @@ meta_window_handle_ungrabbed_event (MetaWindow         *window,
         meta_topic (META_DEBUG_FOCUS,
                     "Not raising window on click due to don't-raise-on-click option\n");
     }
-  else if (is_window_grab && (int) button == meta_prefs_get_mouse_button_resize ())
+  else if (is_window_grab &&
+           (int) button == meta_prefs_get_mouse_button_resize ())
     {
       if (window->has_resize_func)
         {
@@ -8385,7 +8520,8 @@ meta_window_handle_ungrabbed_event (MetaWindow         *window,
                                         x, y);
         }
     }
-  else if (is_window_grab && (int) button == meta_prefs_get_mouse_button_menu ())
+  else if (is_window_grab &&
+           (int) button == meta_prefs_get_mouse_button_menu ())
     {
       if (meta_prefs_get_raise_on_click ())
         meta_window_raise (window);
diff --git a/src/core/workspace.c b/src/core/workspace.c
index 1f129fd12..58678f729 100644
--- a/src/core/workspace.c
+++ b/src/core/workspace.c
@@ -51,16 +51,17 @@
 #include "meta/prefs.h"
 #include "x11/meta-x11-display-private.h"
 
-void meta_workspace_queue_calc_showing   (MetaWorkspace *workspace);
+void meta_workspace_queue_calc_showing (MetaWorkspace *workspace);
 static void focus_ancestor_or_top_window (MetaWorkspace *workspace,
                                           MetaWindow    *not_this_one,
                                           guint32        timestamp);
-static void free_this                    (gpointer candidate,
-                                          gpointer dummy);
+static void free_this (gpointer candidate,
+                       gpointer dummy);
 
 G_DEFINE_TYPE (MetaWorkspace, meta_workspace, G_TYPE_OBJECT);
 
-enum {
+enum
+{
   PROP_0,
 
   PROP_N_WINDOWS,
@@ -157,10 +158,10 @@ meta_workspace_set_property (GObject      *object,
 }
 
 static void
-meta_workspace_get_property (GObject      *object,
-                             guint         prop_id,
-                             GValue       *value,
-                             GParamSpec   *pspec)
+meta_workspace_get_property (GObject    *object,
+                             guint       prop_id,
+                             GValue     *value,
+                             GParamSpec *pspec)
 {
   MetaWorkspace *ws = META_WORKSPACE (object);
 
@@ -186,7 +187,7 @@ static void
 meta_workspace_class_init (MetaWorkspaceClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  object_class->finalize     = meta_workspace_finalize;
+  object_class->finalize = meta_workspace_finalize;
   object_class->get_property = meta_workspace_get_property;
   object_class->set_property = meta_workspace_set_property;
 
@@ -209,12 +210,14 @@ meta_workspace_class_init (MetaWorkspaceClass *klass)
                                                  "N Windows",
                                                  "Number of windows",
                                                  0, G_MAXUINT, 0,
-                                                 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+                                                 G_PARAM_READABLE |
+                                                 G_PARAM_STATIC_STRINGS);
   obj_props[PROP_WORKSPACE_INDEX] = g_param_spec_uint ("workspace-index",
                                                        "Workspace index",
                                                        "The workspace's index",
                                                        0, G_MAXUINT, 0,
-                                                       G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+                                                       G_PARAM_READABLE |
+                                                       G_PARAM_STATIC_STRINGS);
 
   g_object_class_install_properties (object_class, PROP_LAST, obj_props);
 }
@@ -447,8 +450,8 @@ workspace_switch_sound(MetaWorkspace *from,
   const char *e;
 
   nw = meta_workspace_manager_get_n_workspaces (from->manager);
-  fi = meta_workspace_index(from);
-  ti = meta_workspace_index(to);
+  fi = meta_workspace_index (from);
+  ti = meta_workspace_index (to);
 
   meta_workspace_manager_calc_workspace_layout (from->manager,
                                                 nw,
@@ -461,7 +464,7 @@ workspace_switch_sound(MetaWorkspace *from,
 
   if (i >= nw)
     {
-      meta_bug("Failed to find destination workspace in layout\n");
+      meta_bug ("Failed to find destination workspace in layout\n");
       goto finish;
     }
 
@@ -469,11 +472,11 @@ workspace_switch_sound(MetaWorkspace *from,
   x = i % layout.cols;
 
   /* We priorize horizontal over vertical movements here. The
-     rationale for this is that horizontal movements are probably more
-     interesting for sound effects because speakers are usually
-     positioned on a horizontal and not a vertical axis. i.e. your
-     spatial "Woosh!" effects will easily be able to encode horizontal
-     movement but not such much vertical movement. */
+   *  rationale for this is that horizontal movements are probably more
+   *  interesting for sound effects because speakers are usually
+   *  positioned on a horizontal and not a vertical axis. i.e. your
+   *  spatial "Woosh!" effects will easily be able to encode horizontal
+   *  movement but not such much vertical movement. */
 
   if (x < layout.current_col)
     e = "desktop-switch-left";
@@ -485,17 +488,17 @@ workspace_switch_sound(MetaWorkspace *from,
     e = "desktop-switch-down";
   else
     {
-      meta_bug("Uh, origin and destination workspace at same logic position!\n");
+      meta_bug ("Uh, origin and destination workspace at same logic position!\n");
       goto finish;
     }
 
-  ca_context_play(ca_gtk_context_get(), 1,
-                  CA_PROP_EVENT_ID, e,
-                  CA_PROP_EVENT_DESCRIPTION, "Desktop switched",
-                  CA_PROP_CANBERRA_CACHE_CONTROL, "permanent",
-                  NULL);
+  ca_context_play (ca_gtk_context_get (), 1,
+                   CA_PROP_EVENT_ID, e,
+                   CA_PROP_EVENT_DESCRIPTION, "Desktop switched",
+                   CA_PROP_CANBERRA_CACHE_CONTROL, "permanent",
+                   NULL);
 
- finish:
+finish:
   meta_workspace_manager_free_workspace_layout (&layout);
 #endif /* HAVE_LIBCANBERRA */
 }
@@ -524,8 +527,8 @@ meta_workspace_activate_with_focus (MetaWorkspace *workspace,
                                     MetaWindow    *focus_this,
                                     guint32        timestamp)
 {
-  MetaWorkspace  *old;
-  MetaWindow     *move_window;
+  MetaWorkspace *old;
+  MetaWindow *move_window;
   MetaCompositor *comp;
   MetaWorkspaceLayout layout1, layout2;
   gint num_workspaces, current_space, new_space;
@@ -581,60 +584,62 @@ meta_workspace_activate_with_focus (MetaWorkspace *workspace,
   meta_workspace_queue_calc_showing (old);
   meta_workspace_queue_calc_showing (workspace);
 
-   /*
-    * Notify the compositor that the active workspace is changing.
-    */
-   comp = meta_display_get_compositor (workspace->display);
-   direction = 0;
-
-   current_space = meta_workspace_index (old);
-   new_space     = meta_workspace_index (workspace);
-   num_workspaces = meta_workspace_manager_get_n_workspaces (workspace->manager);
-   meta_workspace_manager_calc_workspace_layout (workspace->manager, num_workspaces,
-                                                 current_space, &layout1);
-
-   meta_workspace_manager_calc_workspace_layout (workspace->manager, num_workspaces,
-                                                 new_space, &layout2);
-
-   if (meta_get_locale_direction () == META_LOCALE_DIRECTION_RTL)
-     {
-       if (layout1.current_col > layout2.current_col)
-         direction = META_MOTION_RIGHT;
-       else if (layout1.current_col < layout2.current_col)
-         direction = META_MOTION_LEFT;
-     }
-   else
+  /*
+   * Notify the compositor that the active workspace is changing.
+   */
+  comp = meta_display_get_compositor (workspace->display);
+  direction = 0;
+
+  current_space = meta_workspace_index (old);
+  new_space = meta_workspace_index (workspace);
+  num_workspaces = meta_workspace_manager_get_n_workspaces (workspace->manager);
+  meta_workspace_manager_calc_workspace_layout (workspace->manager,
+                                                num_workspaces,
+                                                current_space, &layout1);
+
+  meta_workspace_manager_calc_workspace_layout (workspace->manager,
+                                                num_workspaces,
+                                                new_space, &layout2);
+
+  if (meta_get_locale_direction () == META_LOCALE_DIRECTION_RTL)
     {
-       if (layout1.current_col < layout2.current_col)
-         direction = META_MOTION_RIGHT;
-       else if (layout1.current_col > layout2.current_col)
-         direction = META_MOTION_LEFT;
+      if (layout1.current_col > layout2.current_col)
+        direction = META_MOTION_RIGHT;
+      else if (layout1.current_col < layout2.current_col)
+        direction = META_MOTION_LEFT;
+    }
+  else
+    {
+      if (layout1.current_col < layout2.current_col)
+        direction = META_MOTION_RIGHT;
+      else if (layout1.current_col > layout2.current_col)
+        direction = META_MOTION_LEFT;
     }
 
-   if (layout1.current_row < layout2.current_row)
-     {
-       if (!direction)
-         direction = META_MOTION_DOWN;
-       else if (direction == META_MOTION_RIGHT)
-         direction = META_MOTION_DOWN_RIGHT;
-       else
-         direction = META_MOTION_DOWN_LEFT;
-     }
-
-   if (layout1.current_row > layout2.current_row)
-     {
-       if (!direction)
-         direction = META_MOTION_UP;
-       else if (direction == META_MOTION_RIGHT)
-         direction = META_MOTION_UP_RIGHT;
-       else
-         direction = META_MOTION_UP_LEFT;
-     }
-
-   meta_workspace_manager_free_workspace_layout (&layout1);
-   meta_workspace_manager_free_workspace_layout (&layout2);
-
-   meta_compositor_switch_workspace (comp, old, workspace, direction);
+  if (layout1.current_row < layout2.current_row)
+    {
+      if (!direction)
+        direction = META_MOTION_DOWN;
+      else if (direction == META_MOTION_RIGHT)
+        direction = META_MOTION_DOWN_RIGHT;
+      else
+        direction = META_MOTION_DOWN_LEFT;
+    }
+
+  if (layout1.current_row > layout2.current_row)
+    {
+      if (!direction)
+        direction = META_MOTION_UP;
+      else if (direction == META_MOTION_RIGHT)
+        direction = META_MOTION_UP_RIGHT;
+      else
+        direction = META_MOTION_UP_LEFT;
+    }
+
+  meta_workspace_manager_free_workspace_layout (&layout1);
+  meta_workspace_manager_free_workspace_layout (&layout2);
+
+  meta_compositor_switch_workspace (comp, old, workspace, direction);
 
   /* This needs to be done after telling the compositor we are switching
    * workspaces since focusing a window will cause it to be immediately
@@ -651,12 +656,13 @@ meta_workspace_activate_with_focus (MetaWorkspace *workspace,
     }
   else
     {
-      meta_topic (META_DEBUG_FOCUS, "Focusing default window on new workspace\n");
+      meta_topic (META_DEBUG_FOCUS,
+                  "Focusing default window on new workspace\n");
       meta_workspace_focus_default_window (workspace, NULL, timestamp);
     }
 
-   meta_workspace_manager_workspace_switched (workspace->manager, current_space,
-                                              new_space, direction);
+  meta_workspace_manager_workspace_switched (workspace->manager, current_space,
+                                             new_space, direction);
 }
 
 void
@@ -689,7 +695,8 @@ meta_workspace_index_changed (MetaWorkspace *workspace)
       meta_window_current_workspace_changed (win);
     }
 
-  g_object_notify_by_pspec (G_OBJECT (workspace), obj_props[PROP_WORKSPACE_INDEX]);
+  g_object_notify_by_pspec (G_OBJECT (
+                              workspace), obj_props[PROP_WORKSPACE_INDEX]);
 }
 
 /**
@@ -699,9 +706,10 @@ meta_workspace_index_changed (MetaWorkspace *workspace)
  * Gets windows contained on the workspace, including workspace->windows
  * and also sticky windows. Override-redirect windows are not included.
  *
- * Return value: (transfer container) (element-type MetaWindow): the list of windows.
+ * Return value: (transfer container) (element-type MetaWindow): the list of
+ *windows.
  */
-GList*
+GList *
 meta_workspace_list_windows (MetaWorkspace *workspace)
 {
   GSList *display_windows, *l;
@@ -777,7 +785,7 @@ meta_workspace_invalidate_work_area (MetaWorkspace *workspace)
 static MetaStrut *
 copy_strut(MetaStrut *original)
 {
-  return g_memdup(original, sizeof(MetaStrut));
+  return g_memdup (original, sizeof (MetaStrut));
 }
 
 static GSList *
@@ -825,17 +833,18 @@ ensure_work_areas_validated (MetaWorkspace *workspace)
       MetaWindow *win = tmp->data;
       GSList *s_iter;
 
-      for (s_iter = win->struts; s_iter != NULL; s_iter = s_iter->next) {
-        workspace->all_struts = g_slist_prepend (workspace->all_struts,
-                                                 copy_strut(s_iter->data));
-      }
+      for (s_iter = win->struts; s_iter != NULL; s_iter = s_iter->next)
+        {
+          workspace->all_struts = g_slist_prepend (workspace->all_struts,
+                                                   copy_strut (s_iter->data));
+        }
     }
   g_list_free (windows);
 
   /* STEP 2: Get the maximal/spanning rects for the onscreen and
    *         on-single-monitor regions
    */
-  g_assert (workspace->screen_region   == NULL);
+  g_assert (workspace->screen_region == NULL);
 
   logical_monitors =
     meta_monitor_manager_get_logical_monitors (monitor_manager);
@@ -877,34 +886,36 @@ ensure_work_areas_validated (MetaWorkspace *workspace)
     {
       meta_warning ("struts occupy an unusually large percentage of the screen; "
                     "available remaining width = %d < %d",
-                    work_area.width, MIN_SANE_AREA);
+                    work_area.width,
+                    MIN_SANE_AREA);
       if (work_area.width < 1)
         {
-          work_area.x = (display_rect.width - MIN_SANE_AREA)/2;
+          work_area.x = (display_rect.width - MIN_SANE_AREA) / 2;
           work_area.width = MIN_SANE_AREA;
         }
       else
         {
-          int amount = (MIN_SANE_AREA - work_area.width)/2;
-          work_area.x     -=   amount;
-          work_area.width += 2*amount;
+          int amount = (MIN_SANE_AREA - work_area.width) / 2;
+          work_area.x -= amount;
+          work_area.width += 2 * amount;
         }
     }
   if (work_area.height < MIN_SANE_AREA)
     {
       meta_warning ("struts occupy an unusually large percentage of the screen; "
                     "available remaining height = %d < %d",
-                    work_area.height, MIN_SANE_AREA);
+                    work_area.height,
+                    MIN_SANE_AREA);
       if (work_area.height < 1)
         {
-          work_area.y = (display_rect.height - MIN_SANE_AREA)/2;
+          work_area.y = (display_rect.height - MIN_SANE_AREA) / 2;
           work_area.height = MIN_SANE_AREA;
         }
       else
         {
-          int amount = (MIN_SANE_AREA - work_area.height)/2;
-          work_area.y      -=   amount;
-          work_area.height += 2*amount;
+          int amount = (MIN_SANE_AREA - work_area.height) / 2;
+          work_area.y -= amount;
+          work_area.height += 2 * amount;
         }
     }
   workspace->work_area_screen = work_area;
@@ -961,8 +972,8 @@ ensure_work_areas_validated (MetaWorkspace *workspace)
     }
 
   /* STEP 5: Cache screen and monitor edges for edge resistance and snapping */
-  g_assert (workspace->screen_edges    == NULL);
-  g_assert (workspace->monitor_edges  == NULL);
+  g_assert (workspace->screen_edges == NULL);
+  g_assert (workspace->monitor_edges == NULL);
   workspace->screen_edges =
     meta_rectangle_find_onscreen_edges (&display_rect,
                                         workspace->all_struts);
@@ -975,7 +986,7 @@ ensure_work_areas_validated (MetaWorkspace *workspace)
     }
   workspace->monitor_edges =
     meta_rectangle_find_nonintersected_monitor_edges (tmp,
-                                                       workspace->all_struts);
+                                                      workspace->all_struts);
   g_list_free (tmp);
 
   /* We're all done, YAAY!  Record that everything has been validated. */
@@ -1105,7 +1116,7 @@ meta_workspace_get_work_area_for_monitor (MetaWorkspace *workspace,
                                           int            which_monitor,
                                           MetaRectangle *area)
 {
-  MetaBackend *backend = meta_get_backend();
+  MetaBackend *backend = meta_get_backend ();
   MetaMonitorManager *monitor_manager =
     meta_backend_get_monitor_manager (backend);
   MetaLogicalMonitor *logical_monitor;
@@ -1140,7 +1151,7 @@ meta_workspace_get_work_area_all_monitors (MetaWorkspace *workspace,
   *area = workspace->work_area_screen;
 }
 
-GList*
+GList *
 meta_workspace_get_onscreen_region (MetaWorkspace *workspace)
 {
   ensure_work_areas_validated (workspace);
@@ -1201,7 +1212,7 @@ meta_motion_direction_to_string (MetaMotionDirection direction)
  * Returns: (transfer none): the workspace next to @workspace, or
  *   @workspace itself if the neighbor would be outside the layout
  */
-MetaWorkspace*
+MetaWorkspace *
 meta_workspace_get_neighbor (MetaWorkspace      *workspace,
                              MetaMotionDirection direction)
 {
@@ -1211,7 +1222,8 @@ meta_workspace_get_neighbor (MetaWorkspace      *workspace,
 
   current_space = meta_workspace_index (workspace);
   num_workspaces = meta_workspace_manager_get_n_workspaces (workspace->manager);
-  meta_workspace_manager_calc_workspace_layout (workspace->manager, num_workspaces,
+  meta_workspace_manager_calc_workspace_layout (workspace->manager,
+                                                num_workspaces,
                                                 current_space, &layout);
 
   meta_verbose ("Getting neighbor of %d in direction %s\n",
@@ -1251,8 +1263,9 @@ meta_workspace_get_neighbor (MetaWorkspace      *workspace,
     i = current_space;
 
   if (i >= num_workspaces)
-    meta_bug ("calc_workspace_layout left an invalid (too-high) workspace number %d in the grid\n",
-              i);
+    meta_bug (
+      "calc_workspace_layout left an invalid (too-high) workspace number %d in the grid\n",
+      i);
 
   meta_verbose ("Neighbor workspace is %d at row %d col %d\n",
                 i, layout.current_row, layout.current_col);
@@ -1262,7 +1275,7 @@ meta_workspace_get_neighbor (MetaWorkspace      *workspace,
   return meta_workspace_manager_get_workspace_by_index (workspace->manager, i);
 }
 
-const char*
+const char *
 meta_workspace_get_name (MetaWorkspace *workspace)
 {
   return meta_prefs_get_workspace_name (meta_workspace_index (workspace));
@@ -1282,15 +1295,15 @@ meta_workspace_focus_default_window (MetaWorkspace *workspace,
     focus_ancestor_or_top_window (workspace, not_this_one, timestamp);
   else
     {
-      MetaWindow * window;
-      window = meta_display_get_pointer_window (workspace->display, not_this_one);
+      MetaWindow *window;
+      window =
+        meta_display_get_pointer_window (workspace->display, not_this_one);
       if (window &&
           window->type != META_WINDOW_DOCK &&
           window->type != META_WINDOW_DESKTOP)
         {
           if (timestamp == META_CURRENT_TIME)
             {
-
               /* We would like for this to never happen.  However, if
                * it does happen then we kludge since using META_CURRENT_TIME
                * can mean ugly race conditions--and we can avoid these
@@ -1299,7 +1312,8 @@ meta_workspace_focus_default_window (MetaWorkspace *workspace,
                */
 
               meta_topic (META_DEBUG_FOCUS,
-                          "Not focusing mouse window %s because EnterNotify events should handle that\n", 
window->desc);
+                          "Not focusing mouse window %s because EnterNotify events should handle that\n",
+                          window->desc);
             }
           else
             {
@@ -1311,7 +1325,8 @@ meta_workspace_focus_default_window (MetaWorkspace *workspace,
           if (workspace->display->autoraise_window != window &&
               meta_prefs_get_auto_raise ())
             {
-              meta_display_queue_autoraise_callback (workspace->display, window);
+              meta_display_queue_autoraise_callback (workspace->display,
+                                                     window);
             }
         }
       else if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_SLOPPY)
@@ -1321,8 +1336,9 @@ meta_workspace_focus_default_window (MetaWorkspace *workspace,
           meta_topic (META_DEBUG_FOCUS,
                       "Setting focus to no_focus_window, since no valid "
                       "window to focus found.\n");
-          meta_x11_display_focus_the_no_focus_window (workspace->display->x11_display,
-                                                      timestamp);
+          meta_x11_display_focus_the_no_focus_window (
+            workspace->display->x11_display,
+            timestamp);
         }
     }
 }
@@ -1393,9 +1409,11 @@ focus_ancestor_or_top_window (MetaWorkspace *workspace,
     }
   else
     {
-      meta_topic (META_DEBUG_FOCUS, "No MRU window to focus found; focusing no_focus_window.\n");
-      meta_x11_display_focus_the_no_focus_window (workspace->display->x11_display,
-                                                  timestamp);
+      meta_topic (META_DEBUG_FOCUS,
+                  "No MRU window to focus found; focusing no_focus_window.\n");
+      meta_x11_display_focus_the_no_focus_window (
+        workspace->display->x11_display,
+        timestamp);
     }
 }
 
diff --git a/src/tests/boxes-tests.c b/src/tests/boxes-tests.c
index 4f648a344..2bea7f738 100644
--- a/src/tests/boxes-tests.c
+++ b/src/tests/boxes-tests.c
@@ -45,42 +45,42 @@ get_random_rect (MetaRectangle *rect)
 {
   rect->x = rand () % 1600;
   rect->y = rand () % 1200;
-  rect->width  = rand () % 1600 + 1;
+  rect->width = rand () % 1600 + 1;
   rect->height = rand () % 1200 + 1;
 }
 
-static MetaRectangle*
+static MetaRectangle *
 new_meta_rect (int x, int y, int width, int height)
 {
-  MetaRectangle* temporary;
+  MetaRectangle *temporary;
   temporary = g_new (MetaRectangle, 1);
   temporary->x = x;
   temporary->y = y;
-  temporary->width  = width;
+  temporary->width = width;
   temporary->height = height;
 
   return temporary;
 }
 
-static MetaStrut*
+static MetaStrut *
 new_meta_strut (int x, int y, int width, int height, int side)
 {
-  MetaStrut* temporary;
+  MetaStrut *temporary;
   temporary = g_new (MetaStrut, 1);
-  temporary->rect = meta_rect(x, y, width, height);
+  temporary->rect = meta_rect (x, y, width, height);
   temporary->side = side;
 
   return temporary;
 }
 
-static MetaEdge*
+static MetaEdge *
 new_screen_edge (int x, int y, int width, int height, int side_type)
 {
-  MetaEdge* temporary;
+  MetaEdge *temporary;
   temporary = g_new (MetaEdge, 1);
   temporary->rect.x = x;
   temporary->rect.y = y;
-  temporary->rect.width  = width;
+  temporary->rect.width = width;
   temporary->rect.height = height;
   temporary->side_type = side_type;
   temporary->edge_type = META_EDGE_SCREEN;
@@ -88,14 +88,14 @@ new_screen_edge (int x, int y, int width, int height, int side_type)
   return temporary;
 }
 
-static MetaEdge*
+static MetaEdge *
 new_monitor_edge (int x, int y, int width, int height, int side_type)
 {
-  MetaEdge* temporary;
+  MetaEdge *temporary;
   temporary = g_new (MetaEdge, 1);
   temporary->rect.x = x;
   temporary->rect.y = y;
-  temporary->rect.width  = width;
+  temporary->rect.width = width;
   temporary->rect.height = height;
   temporary->side_type = side_type;
   temporary->edge_type = META_EDGE_MONITOR;
@@ -121,10 +121,10 @@ test_area (void)
 static void
 test_intersect (void)
 {
-  MetaRectangle a = {100, 200,  50,  40};
-  MetaRectangle b = {  0,  50, 110, 152};
-  MetaRectangle c = {  0,   0,  10,  10};
-  MetaRectangle d = {100, 100,  50,  50};
+  MetaRectangle a = {100, 200, 50, 40};
+  MetaRectangle b = {  0, 50, 110, 152};
+  MetaRectangle c = {  0, 0, 10, 10};
+  MetaRectangle d = {100, 100, 50, 50};
   MetaRectangle b_intersect_d = {100, 100, 10, 50};
   MetaRectangle temp;
   MetaRectangle temp2;
@@ -154,7 +154,7 @@ test_equal (void)
   MetaRectangle e = {10, 62, 4, 18};
   MetaRectangle f = {27, 12, 4, 18};
 
-  g_assert ( meta_rectangle_equal (&a, &b));
+  g_assert (meta_rectangle_equal (&a, &b));
   g_assert (!meta_rectangle_equal (&a, &c));
   g_assert (!meta_rectangle_equal (&a, &d));
   g_assert (!meta_rectangle_equal (&a, &e));
@@ -175,11 +175,11 @@ test_overlap_funcs (void)
                  meta_rectangle_vert_overlap (&temp1, &temp2)));
     }
 
-  temp1 = meta_rect ( 0, 0, 10, 10);
-  temp2 = meta_rect (20, 0, 10,  5);
+  temp1 = meta_rect (0, 0, 10, 10);
+  temp2 = meta_rect (20, 0, 10, 5);
   g_assert (!meta_rectangle_overlap (&temp1, &temp2));
   g_assert (!meta_rectangle_horiz_overlap (&temp1, &temp2));
-  g_assert ( meta_rectangle_vert_overlap (&temp1, &temp2));
+  g_assert (meta_rectangle_vert_overlap (&temp1, &temp2));
 }
 
 static void
@@ -208,13 +208,13 @@ test_basic_fitting (void)
                 meta_rectangle_could_fit_rect (&temp2, &temp1) == TRUE);
     }
 
-  temp1 = meta_rect ( 0, 0, 10, 10);
-  temp2 = meta_rect ( 5, 5,  5,  5);
-  temp3 = meta_rect ( 8, 2,  3,  7);
-  g_assert ( meta_rectangle_contains_rect (&temp1, &temp2));
+  temp1 = meta_rect (0, 0, 10, 10);
+  temp2 = meta_rect (5, 5, 5, 5);
+  temp3 = meta_rect (8, 2, 3, 7);
+  g_assert (meta_rectangle_contains_rect (&temp1, &temp2));
   g_assert (!meta_rectangle_contains_rect (&temp2, &temp1));
   g_assert (!meta_rectangle_contains_rect (&temp1, &temp3));
-  g_assert ( meta_rectangle_could_fit_rect (&temp1, &temp3));
+  g_assert (meta_rectangle_could_fit_rect (&temp1, &temp3));
   g_assert (!meta_rectangle_could_fit_rect (&temp3, &temp2));
 }
 
@@ -230,7 +230,7 @@ free_strut_list (GSList *struts)
   g_slist_free (struts);
 }
 
-static GSList*
+static GSList *
 get_strut_list (int which)
 {
   GSList *ans;
@@ -238,45 +238,68 @@ get_strut_list (int which)
 
   ans = NULL;
 
-  g_assert (which >=0 && which <= 6);
+  g_assert (which >= 0 && which <= 6);
   switch (which)
     {
     case 0:
       break;
     case 1:
-      ans = g_slist_prepend (ans, new_meta_strut (   0,    0, 1600,   20, META_SIDE_TOP));
-      ans = g_slist_prepend (ans, new_meta_strut ( 400, 1160, 1600,   40, META_SIDE_BOTTOM));
+      ans =
+        g_slist_prepend (ans, new_meta_strut (0, 0, 1600, 20, META_SIDE_TOP));
+      ans =
+        g_slist_prepend (ans,
+                         new_meta_strut (400, 1160, 1600, 40,
+                                         META_SIDE_BOTTOM));
       break;
     case 2:
-      ans = g_slist_prepend (ans, new_meta_strut (   0,    0, 1600,   20, META_SIDE_TOP));
-      ans = g_slist_prepend (ans, new_meta_strut ( 800, 1100,  400,  100, META_SIDE_BOTTOM));
-      ans = g_slist_prepend (ans, new_meta_strut ( 300, 1150,  150,   50, META_SIDE_BOTTOM));
+      ans =
+        g_slist_prepend (ans, new_meta_strut (0, 0, 1600, 20, META_SIDE_TOP));
+      ans =
+        g_slist_prepend (ans,
+                         new_meta_strut (800, 1100, 400, 100,
+                                         META_SIDE_BOTTOM));
+      ans =
+        g_slist_prepend (ans,
+                         new_meta_strut (300, 1150, 150, 50, META_SIDE_BOTTOM));
       break;
     case 3:
-      ans = g_slist_prepend (ans, new_meta_strut (   0,    0, 1600,   20, META_SIDE_TOP));
-      ans = g_slist_prepend (ans, new_meta_strut ( 800, 1100,  400,  100, META_SIDE_LEFT));
-      ans = g_slist_prepend (ans, new_meta_strut ( 300, 1150,   80,   50, META_SIDE_BOTTOM));
-      ans = g_slist_prepend (ans, new_meta_strut ( 700,  525,  200,  150, wc));
+      ans =
+        g_slist_prepend (ans, new_meta_strut (0, 0, 1600, 20, META_SIDE_TOP));
+      ans =
+        g_slist_prepend (ans,
+                         new_meta_strut (800, 1100, 400, 100, META_SIDE_LEFT));
+      ans =
+        g_slist_prepend (ans,
+                         new_meta_strut (300, 1150, 80, 50, META_SIDE_BOTTOM));
+      ans = g_slist_prepend (ans, new_meta_strut (700, 525, 200, 150, wc));
       break;
     case 4:
-      ans = g_slist_prepend (ans, new_meta_strut (   0,    0,  800, 1200, META_SIDE_LEFT));
-      ans = g_slist_prepend (ans, new_meta_strut ( 800,    0, 1600,   20, META_SIDE_TOP));
+      ans =
+        g_slist_prepend (ans, new_meta_strut (0, 0, 800, 1200, META_SIDE_LEFT));
+      ans =
+        g_slist_prepend (ans, new_meta_strut (800, 0, 1600, 20, META_SIDE_TOP));
       break;
     case 5:
-      ans = g_slist_prepend (ans, new_meta_strut ( 800,    0, 1600,   20, META_SIDE_TOP));
-      ans = g_slist_prepend (ans, new_meta_strut (   0,    0,  800, 1200, META_SIDE_LEFT));
-      ans = g_slist_prepend (ans, new_meta_strut ( 800,   10,  800, 1200, META_SIDE_RIGHT));
+      ans =
+        g_slist_prepend (ans, new_meta_strut (800, 0, 1600, 20, META_SIDE_TOP));
+      ans =
+        g_slist_prepend (ans, new_meta_strut (0, 0, 800, 1200, META_SIDE_LEFT));
+      ans =
+        g_slist_prepend (ans,
+                         new_meta_strut (800, 10, 800, 1200, META_SIDE_RIGHT));
       break;
     case 6:
-      ans = g_slist_prepend (ans, new_meta_strut (   0,    0, 1600,   40, META_SIDE_TOP));
-      ans = g_slist_prepend (ans, new_meta_strut (   0,    0, 1600,   20, META_SIDE_TOP));
+      ans =
+        g_slist_prepend (ans, new_meta_strut (0, 0, 1600, 40, META_SIDE_TOP));
+      ans =
+        g_slist_prepend (ans, new_meta_strut (0, 0, 1600, 20, META_SIDE_TOP));
       break;
     }
 
   return ans;
 }
 
-static GList*
+static GList *
 get_screen_region (int which)
 {
   GList *ret;
@@ -287,13 +310,14 @@ get_screen_region (int which)
   ret = NULL;
 
   struts = get_strut_list (which);
-  ret = meta_rectangle_get_minimal_spanning_set_for_region (&basic_rect, struts);
+  ret =
+    meta_rectangle_get_minimal_spanning_set_for_region (&basic_rect, struts);
   free_strut_list (struts);
 
   return ret;
 }
 
-static GList*
+static GList *
 get_screen_edges (int which)
 {
   GList *ret;
@@ -310,7 +334,7 @@ get_screen_edges (int which)
   return ret;
 }
 
-static GList*
+static GList *
 get_monitor_edges (int which_monitor_set, int which_strut_set)
 {
   GList *ret;
@@ -318,24 +342,24 @@ get_monitor_edges (int which_monitor_set, int which_strut_set)
   GList *xins;
 
   xins = NULL;
-  g_assert (which_monitor_set >=0 && which_monitor_set <= 3);
+  g_assert (which_monitor_set >= 0 && which_monitor_set <= 3);
   switch (which_monitor_set)
     {
     case 0:
-      xins = g_list_prepend (xins, new_meta_rect (  0,   0, 1600, 1200));
+      xins = g_list_prepend (xins, new_meta_rect (0, 0, 1600, 1200));
       break;
     case 1:
-      xins = g_list_prepend (xins, new_meta_rect (  0,   0,  800, 1200));
-      xins = g_list_prepend (xins, new_meta_rect (800,   0,  800, 1200));
+      xins = g_list_prepend (xins, new_meta_rect (0, 0, 800, 1200));
+      xins = g_list_prepend (xins, new_meta_rect (800, 0, 800, 1200));
       break;
     case 2:
-      xins = g_list_prepend (xins, new_meta_rect (  0,   0, 1600,  600));
-      xins = g_list_prepend (xins, new_meta_rect (  0, 600, 1600,  600));
+      xins = g_list_prepend (xins, new_meta_rect (0, 0, 1600, 600));
+      xins = g_list_prepend (xins, new_meta_rect (0, 600, 1600, 600));
       break;
     case 3:
-      xins = g_list_prepend (xins, new_meta_rect (  0,   0, 1600,  600));
-      xins = g_list_prepend (xins, new_meta_rect (  0, 600,  800,  600));
-      xins = g_list_prepend (xins, new_meta_rect (800, 600,  800,  600));
+      xins = g_list_prepend (xins, new_meta_rect (0, 0, 1600, 600));
+      xins = g_list_prepend (xins, new_meta_rect (0, 600, 800, 600));
+      xins = g_list_prepend (xins, new_meta_rect (800, 600, 800, 600));
       break;
     }
 
@@ -370,8 +394,8 @@ test_merge_regions (void)
    *   number of those merges that were of the form A is adjacent to B
    */
 
-  GList* region;
-  GList* compare;
+  GList *region;
+  GList *compare;
   int num_contains, num_merged, num_part_contains, num_adjacent;
 
   num_contains = num_merged = num_part_contains = num_adjacent = 0;
@@ -481,7 +505,8 @@ test_merge_regions (void)
                       meta_rectangle_to_string (bla, rect1));
 #endif
 
-              /* Deleting the rect we're compare others to is a little tricker */
+              /* Deleting the rect we're compare others to is a little tricker
+               * */
               if (compare == delete_me)
                 {
                   compare = compare->next;
@@ -535,9 +560,9 @@ verify_lists_are_equal (GList *code, GList *answer)
       MetaRectangle *a = code->data;
       MetaRectangle *b = answer->data;
 
-      if (a->x      != b->x     ||
-          a->y      != b->y     ||
-          a->width  != b->width ||
+      if (a->x != b->x ||
+          a->y != b->y ||
+          a->width != b->width ||
           a->height != b->height)
         {
           g_error ("%dth item in code answer answer lists do not match; "
@@ -576,8 +601,8 @@ verify_lists_are_equal (GList *code, GList *answer)
 static void
 test_regions_okay (void)
 {
-  GList* region;
-  GList* tmp;
+  GList *region;
+  GList *tmp;
 
   /*************************************************************/
   /* Make sure test region 0 has the right spanning rectangles */
@@ -594,7 +619,7 @@ test_regions_okay (void)
   /*************************************************************/
   region = get_screen_region (1);
   tmp = NULL;
-  tmp = g_list_prepend (tmp, new_meta_rect (0, 20,  400, 1180));
+  tmp = g_list_prepend (tmp, new_meta_rect (0, 20, 400, 1180));
   tmp = g_list_prepend (tmp, new_meta_rect (0, 20, 1600, 1140));
   verify_lists_are_equal (region, tmp);
   meta_rectangle_free_list_and_elements (tmp);
@@ -605,11 +630,11 @@ test_regions_okay (void)
   /*************************************************************/
   region = get_screen_region (2);
   tmp = NULL;
-  tmp = g_list_prepend (tmp, new_meta_rect (   0,   20,  300, 1180));
-  tmp = g_list_prepend (tmp, new_meta_rect ( 450,   20,  350, 1180));
-  tmp = g_list_prepend (tmp, new_meta_rect (1200,   20,  400, 1180));
-  tmp = g_list_prepend (tmp, new_meta_rect (   0,   20,  800, 1130));
-  tmp = g_list_prepend (tmp, new_meta_rect (   0,   20, 1600, 1080));
+  tmp = g_list_prepend (tmp, new_meta_rect (0, 20, 300, 1180));
+  tmp = g_list_prepend (tmp, new_meta_rect (450, 20, 350, 1180));
+  tmp = g_list_prepend (tmp, new_meta_rect (1200, 20, 400, 1180));
+  tmp = g_list_prepend (tmp, new_meta_rect (0, 20, 800, 1130));
+  tmp = g_list_prepend (tmp, new_meta_rect (0, 20, 1600, 1080));
   verify_lists_are_equal (region, tmp);
   meta_rectangle_free_list_and_elements (tmp);
   meta_rectangle_free_list_and_elements (region);
@@ -619,13 +644,16 @@ test_regions_okay (void)
   /*************************************************************/
   region = get_screen_region (3);
   tmp = NULL;
-  tmp = g_list_prepend (tmp, new_meta_rect (   0,   20,  300, 1180)); /* 354000 */
-  tmp = g_list_prepend (tmp, new_meta_rect ( 380,   20,  1220, 1180)); /* 377600 */
-  tmp = g_list_prepend (tmp, new_meta_rect (   0,   20,  1600, 1130)); /* 791000 */
+  tmp = g_list_prepend (tmp, new_meta_rect (0, 20, 300, 1180));       /* 354000
+                                                                       * */
+  tmp = g_list_prepend (tmp, new_meta_rect (380, 20, 1220, 1180));     /* 377600
+                                                                        * */
+  tmp = g_list_prepend (tmp, new_meta_rect (0, 20, 1600, 1130));       /* 791000
+                                                                        * */
 #if 0
   printf ("Got to here...\n");
-  char region_list[(RECT_LENGTH+2) * g_list_length (region)];
-  char tmp_list[   (RECT_LENGTH+2) * g_list_length (tmp)];
+  char region_list[(RECT_LENGTH + 2) * g_list_length (region)];
+  char tmp_list[   (RECT_LENGTH + 2) * g_list_length (tmp)];
   meta_rectangle_region_to_string (region, ", ", region_list);
   meta_rectangle_region_to_string (region, ", ", tmp_list);
   printf ("%s vs. %s\n", region_list, tmp_list);
@@ -639,7 +667,7 @@ test_regions_okay (void)
   /*************************************************************/
   region = get_screen_region (4);
   tmp = NULL;
-  tmp = g_list_prepend (tmp, new_meta_rect ( 800,   20,  800, 1180));
+  tmp = g_list_prepend (tmp, new_meta_rect (800, 20, 800, 1180));
   verify_lists_are_equal (region, tmp);
   meta_rectangle_free_list_and_elements (tmp);
   meta_rectangle_free_list_and_elements (region);
@@ -662,7 +690,7 @@ test_regions_okay (void)
 static void
 test_region_fitting (void)
 {
-  GList* region;
+  GList *region;
   MetaRectangle rect;
 
   /* See test_basic_fitting() for how/why these automated random tests work */
@@ -704,7 +732,7 @@ test_region_fitting (void)
 static void
 test_clamping_to_region (void)
 {
-  GList* region;
+  GList *region;
   MetaRectangle rect;
   MetaRectangle min_size;
   FixedDirections fixed_directions;
@@ -754,7 +782,8 @@ test_clamping_to_region (void)
   g_assert (rect.width == 400 && rect.height == 1180);
 
   rect = meta_rect (50, 50, 10000, 10000);
-  min_size.width = 600;  min_size.height = 1170;
+  min_size.width = 600;
+  min_size.height = 1170;
 
   g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING,
                          "No rect whose size to clamp to found*");
@@ -767,7 +796,8 @@ test_clamping_to_region (void)
   g_assert (rect.width == 600 && rect.height == 1170);
 
   rect = meta_rect (350, 50, 100, 1100);
-  min_size.width = 1;  min_size.height = 1;
+  min_size.width = 1;
+  min_size.height = 1;
   fixed_directions = FIXED_DIRECTION_X;
   meta_rectangle_clamp_to_fit_into_region (region,
                                            fixed_directions,
@@ -776,7 +806,8 @@ test_clamping_to_region (void)
   g_assert (rect.width == 100 && rect.height == 1100);
 
   rect = meta_rect (300, 70, 500, 1100);
-  min_size.width = 1;  min_size.height = 1;
+  min_size.width = 1;
+  min_size.height = 1;
   fixed_directions = FIXED_DIRECTION_Y;
   meta_rectangle_clamp_to_fit_into_region (region,
                                            fixed_directions,
@@ -785,7 +816,8 @@ test_clamping_to_region (void)
   g_assert (rect.width == 400 && rect.height == 1100);
 
   rect = meta_rect (300, 70, 999999, 999999);
-  min_size.width = 100;  min_size.height = 200;
+  min_size.width = 100;
+  min_size.height = 200;
   fixed_directions = FIXED_DIRECTION_Y;
 
   g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING,
@@ -807,7 +839,7 @@ rect_overlaps_region (const GList         *spanning_rects,
 {
   /* FIXME: Should I move this to boxes.[ch]? */
   const GList *temp;
-  gboolean     overlaps;
+  gboolean overlaps;
 
   temp = spanning_rects;
   overlaps = FALSE;
@@ -825,7 +857,7 @@ gboolean time_to_print = FALSE;
 static void
 test_clipping_to_region (void)
 {
-  GList* region;
+  GList *region;
   MetaRectangle rect, temp;
   FixedDirections fixed_directions = 0;
   int i;
@@ -885,7 +917,7 @@ test_clipping_to_region (void)
 static void
 test_shoving_into_region (void)
 {
-  GList* region;
+  GList *region;
   MetaRectangle rect, temp;
   FixedDirections fixed_directions = 0;
   int i;
@@ -906,7 +938,7 @@ test_shoving_into_region (void)
   region = get_screen_region (2);
 
   rect = meta_rect (300, 1000, 400, 200);
-  temp = meta_rect (300,  950, 400, 200);
+  temp = meta_rect (300, 950, 400, 200);
   meta_rectangle_shove_into_region (region,
                                     fixed_directions,
                                     &rect);
@@ -920,28 +952,28 @@ test_shoving_into_region (void)
   g_assert (meta_rectangle_equal (&rect, &temp));
 
   rect = meta_rect (425, 1000, 300, 200);
-  temp = meta_rect (425,  950, 300, 200);
+  temp = meta_rect (425, 950, 300, 200);
   meta_rectangle_shove_into_region (region,
                                     FIXED_DIRECTION_X,
                                     &rect);
   g_assert (meta_rectangle_equal (&rect, &temp));
 
-  rect = meta_rect ( 300, 1000, 400, 200);
+  rect = meta_rect (300, 1000, 400, 200);
   temp = meta_rect (1200, 1000, 400, 200);
   meta_rectangle_shove_into_region (region,
                                     FIXED_DIRECTION_Y,
                                     &rect);
   g_assert (meta_rectangle_equal (&rect, &temp));
 
-  rect = meta_rect ( 800, 1150, 400,  50);  /* Completely "offscreen" :) */
-  temp = meta_rect ( 800, 1050, 400,  50);
+  rect = meta_rect (800, 1150, 400, 50);    /* Completely "offscreen" :) */
+  temp = meta_rect (800, 1050, 400, 50);
   meta_rectangle_shove_into_region (region,
                                     0,
                                     &rect);
   g_assert (meta_rectangle_equal (&rect, &temp));
 
-  rect = meta_rect (-1000,  0, 400, 150);  /* Offscreen in 2 directions */
-  temp = meta_rect (    0, 20, 400, 150);
+  rect = meta_rect (-1000, 0, 400, 150);   /* Offscreen in 2 directions */
+  temp = meta_rect (0, 20, 400, 150);
   meta_rectangle_shove_into_region (region,
                                     0,
                                     &rect);
@@ -1000,12 +1032,12 @@ verify_edge_lists_are_equal (GList *code, GList *answer)
 static void
 test_find_onscreen_edges (void)
 {
-  GList* edges;
-  GList* tmp;
+  GList *edges;
+  GList *tmp;
 
-  int left   = META_DIRECTION_LEFT;
-  int right  = META_DIRECTION_RIGHT;
-  int top    = META_DIRECTION_TOP;
+  int left = META_DIRECTION_LEFT;
+  int right = META_DIRECTION_RIGHT;
+  int top = META_DIRECTION_TOP;
   int bottom = META_DIRECTION_BOTTOM;
 
   /*************************************************/
@@ -1013,10 +1045,10 @@ test_find_onscreen_edges (void)
   /*************************************************/
   edges = get_screen_edges (0);
   tmp = NULL;
-  tmp = g_list_prepend (tmp, new_screen_edge (   0, 1200, 1600, 0, bottom));
-  tmp = g_list_prepend (tmp, new_screen_edge (   0,    0, 1600, 0, top));
-  tmp = g_list_prepend (tmp, new_screen_edge (1600,    0, 0, 1200, right));
-  tmp = g_list_prepend (tmp, new_screen_edge (   0,    0, 0, 1200, left));
+  tmp = g_list_prepend (tmp, new_screen_edge (0, 1200, 1600, 0, bottom));
+  tmp = g_list_prepend (tmp, new_screen_edge (0, 0, 1600, 0, top));
+  tmp = g_list_prepend (tmp, new_screen_edge (1600, 0, 0, 1200, right));
+  tmp = g_list_prepend (tmp, new_screen_edge (0, 0, 0, 1200, left));
   verify_edge_lists_are_equal (edges, tmp);
   meta_rectangle_free_list_and_elements (tmp);
   meta_rectangle_free_list_and_elements (edges);
@@ -1026,12 +1058,12 @@ test_find_onscreen_edges (void)
   /*************************************************/
   edges = get_screen_edges (1);
   tmp = NULL;
-  tmp = g_list_prepend (tmp, new_screen_edge (   0, 1200,  400, 0, bottom));
-  tmp = g_list_prepend (tmp, new_screen_edge ( 400, 1160, 1200, 0, bottom));
-  tmp = g_list_prepend (tmp, new_screen_edge (   0,   20, 1600, 0, top));
-  tmp = g_list_prepend (tmp, new_screen_edge (1600,   20, 0, 1140, right));
-  tmp = g_list_prepend (tmp, new_screen_edge ( 400, 1160, 0,   40, right));
-  tmp = g_list_prepend (tmp, new_screen_edge (   0,   20, 0, 1180, left));
+  tmp = g_list_prepend (tmp, new_screen_edge (0, 1200, 400, 0, bottom));
+  tmp = g_list_prepend (tmp, new_screen_edge (400, 1160, 1200, 0, bottom));
+  tmp = g_list_prepend (tmp, new_screen_edge (0, 20, 1600, 0, top));
+  tmp = g_list_prepend (tmp, new_screen_edge (1600, 20, 0, 1140, right));
+  tmp = g_list_prepend (tmp, new_screen_edge (400, 1160, 0, 40, right));
+  tmp = g_list_prepend (tmp, new_screen_edge (0, 20, 0, 1180, left));
   verify_edge_lists_are_equal (edges, tmp);
   meta_rectangle_free_list_and_elements (tmp);
   meta_rectangle_free_list_and_elements (edges);
@@ -1041,18 +1073,18 @@ test_find_onscreen_edges (void)
   /*************************************************/
   edges = get_screen_edges (2);
   tmp = NULL;
-  tmp = g_list_prepend (tmp, new_screen_edge (1200, 1200,  400, 0, bottom));
-  tmp = g_list_prepend (tmp, new_screen_edge ( 450, 1200,  350, 0, bottom));
-  tmp = g_list_prepend (tmp, new_screen_edge (   0, 1200,  300, 0, bottom));
-  tmp = g_list_prepend (tmp, new_screen_edge ( 300, 1150,  150, 0, bottom));
-  tmp = g_list_prepend (tmp, new_screen_edge ( 800, 1100,  400, 0, bottom));
-  tmp = g_list_prepend (tmp, new_screen_edge (   0,   20, 1600, 0, top));
-  tmp = g_list_prepend (tmp, new_screen_edge (1600,   20, 0, 1180, right));
-  tmp = g_list_prepend (tmp, new_screen_edge ( 800, 1100, 0,  100, right));
-  tmp = g_list_prepend (tmp, new_screen_edge ( 300, 1150, 0,   50, right));
-  tmp = g_list_prepend (tmp, new_screen_edge (1200, 1100, 0,  100, left));
-  tmp = g_list_prepend (tmp, new_screen_edge ( 450, 1150, 0,   50, left));
-  tmp = g_list_prepend (tmp, new_screen_edge (   0,   20, 0, 1180, left));
+  tmp = g_list_prepend (tmp, new_screen_edge (1200, 1200, 400, 0, bottom));
+  tmp = g_list_prepend (tmp, new_screen_edge (450, 1200, 350, 0, bottom));
+  tmp = g_list_prepend (tmp, new_screen_edge (0, 1200, 300, 0, bottom));
+  tmp = g_list_prepend (tmp, new_screen_edge (300, 1150, 150, 0, bottom));
+  tmp = g_list_prepend (tmp, new_screen_edge (800, 1100, 400, 0, bottom));
+  tmp = g_list_prepend (tmp, new_screen_edge (0, 20, 1600, 0, top));
+  tmp = g_list_prepend (tmp, new_screen_edge (1600, 20, 0, 1180, right));
+  tmp = g_list_prepend (tmp, new_screen_edge (800, 1100, 0, 100, right));
+  tmp = g_list_prepend (tmp, new_screen_edge (300, 1150, 0, 50, right));
+  tmp = g_list_prepend (tmp, new_screen_edge (1200, 1100, 0, 100, left));
+  tmp = g_list_prepend (tmp, new_screen_edge (450, 1150, 0, 50, left));
+  tmp = g_list_prepend (tmp, new_screen_edge (0, 20, 0, 1180, left));
   verify_edge_lists_are_equal (edges, tmp);
   meta_rectangle_free_list_and_elements (tmp);
   meta_rectangle_free_list_and_elements (edges);
@@ -1062,30 +1094,31 @@ test_find_onscreen_edges (void)
   /*************************************************/
   edges = get_screen_edges (3);
   tmp = NULL;
-  tmp = g_list_prepend (tmp, new_screen_edge (1200, 1200,  400, 0, bottom));
-  tmp = g_list_prepend (tmp, new_screen_edge ( 380, 1200,  420, 0, bottom));
-  tmp = g_list_prepend (tmp, new_screen_edge (   0, 1200,  300, 0, bottom));
-  tmp = g_list_prepend (tmp, new_screen_edge ( 300, 1150,   80, 0, bottom));
-  tmp = g_list_prepend (tmp, new_screen_edge ( 800, 1100,  400, 0, bottom));
-  tmp = g_list_prepend (tmp, new_screen_edge ( 700,  525, 200,  0, bottom));
-  tmp = g_list_prepend (tmp, new_screen_edge ( 700,  675, 200,  0, top));
-  tmp = g_list_prepend (tmp, new_screen_edge (   0,   20, 1600, 0, top));
-  tmp = g_list_prepend (tmp, new_screen_edge (1600,   20, 0, 1180, right));
-  tmp = g_list_prepend (tmp, new_screen_edge ( 800, 1100, 0,  100, right));
-  tmp = g_list_prepend (tmp, new_screen_edge ( 700,  525, 0,  150, right));
-  tmp = g_list_prepend (tmp, new_screen_edge ( 300, 1150, 0,   50, right));
-  tmp = g_list_prepend (tmp, new_screen_edge (1200, 1100, 0,  100, left));
-  tmp = g_list_prepend (tmp, new_screen_edge ( 900,  525, 0,  150, left));
-  tmp = g_list_prepend (tmp, new_screen_edge ( 380, 1150, 0,   50, left));
-  tmp = g_list_prepend (tmp, new_screen_edge (   0,   20, 0, 1180, left));
+  tmp = g_list_prepend (tmp, new_screen_edge (1200, 1200, 400, 0, bottom));
+  tmp = g_list_prepend (tmp, new_screen_edge (380, 1200, 420, 0, bottom));
+  tmp = g_list_prepend (tmp, new_screen_edge (0, 1200, 300, 0, bottom));
+  tmp = g_list_prepend (tmp, new_screen_edge (300, 1150, 80, 0, bottom));
+  tmp = g_list_prepend (tmp, new_screen_edge (800, 1100, 400, 0, bottom));
+  tmp = g_list_prepend (tmp, new_screen_edge (700, 525, 200, 0, bottom));
+  tmp = g_list_prepend (tmp, new_screen_edge (700, 675, 200, 0, top));
+  tmp = g_list_prepend (tmp, new_screen_edge (0, 20, 1600, 0, top));
+  tmp = g_list_prepend (tmp, new_screen_edge (1600, 20, 0, 1180, right));
+  tmp = g_list_prepend (tmp, new_screen_edge (800, 1100, 0, 100, right));
+  tmp = g_list_prepend (tmp, new_screen_edge (700, 525, 0, 150, right));
+  tmp = g_list_prepend (tmp, new_screen_edge (300, 1150, 0, 50, right));
+  tmp = g_list_prepend (tmp, new_screen_edge (1200, 1100, 0, 100, left));
+  tmp = g_list_prepend (tmp, new_screen_edge (900, 525, 0, 150, left));
+  tmp = g_list_prepend (tmp, new_screen_edge (380, 1150, 0, 50, left));
+  tmp = g_list_prepend (tmp, new_screen_edge (0, 20, 0, 1180, left));
 
 #if 0
   #define FUDGE 50 /* number of edges */
-  char big_buffer1[(EDGE_LENGTH+2)*FUDGE], big_buffer2[(EDGE_LENGTH+2)*FUDGE];
+  char big_buffer1[(EDGE_LENGTH + 2) * FUDGE],
+       big_buffer2[(EDGE_LENGTH + 2) * FUDGE];
   meta_rectangle_edge_list_to_string (edges, "\n ", big_buffer1);
-  meta_rectangle_edge_list_to_string (tmp,   "\n ", big_buffer2);
-  printf("Generated edge list:\n %s\nComparison edges list:\n %s\n",
-         big_buffer1, big_buffer2);
+  meta_rectangle_edge_list_to_string (tmp, "\n ", big_buffer2);
+  printf ("Generated edge list:\n %s\nComparison edges list:\n %s\n",
+          big_buffer1, big_buffer2);
 #endif
 
   verify_edge_lists_are_equal (edges, tmp);
@@ -1097,10 +1130,10 @@ test_find_onscreen_edges (void)
   /*************************************************/
   edges = get_screen_edges (4);
   tmp = NULL;
-  tmp = g_list_prepend (tmp, new_screen_edge ( 800, 1200, 800,  0, bottom));
-  tmp = g_list_prepend (tmp, new_screen_edge ( 800,   20, 800,  0, top));
-  tmp = g_list_prepend (tmp, new_screen_edge (1600,   20, 0, 1180, right));
-  tmp = g_list_prepend (tmp, new_screen_edge ( 800,   20, 0, 1180, left));
+  tmp = g_list_prepend (tmp, new_screen_edge (800, 1200, 800, 0, bottom));
+  tmp = g_list_prepend (tmp, new_screen_edge (800, 20, 800, 0, top));
+  tmp = g_list_prepend (tmp, new_screen_edge (1600, 20, 0, 1180, right));
+  tmp = g_list_prepend (tmp, new_screen_edge (800, 20, 0, 1180, left));
   verify_edge_lists_are_equal (edges, tmp);
   meta_rectangle_free_list_and_elements (tmp);
   meta_rectangle_free_list_and_elements (edges);
@@ -1119,10 +1152,10 @@ test_find_onscreen_edges (void)
   /*************************************************/
   edges = get_screen_edges (6);
   tmp = NULL;
-  tmp = g_list_prepend (tmp, new_screen_edge (   0, 1200, 1600,  0, bottom));
-  tmp = g_list_prepend (tmp, new_screen_edge (   0,   40, 1600,  0, top));
-  tmp = g_list_prepend (tmp, new_screen_edge (1600,   40, 0,  1160, right));
-  tmp = g_list_prepend (tmp, new_screen_edge (   0,   40, 0,  1160, left));
+  tmp = g_list_prepend (tmp, new_screen_edge (0, 1200, 1600, 0, bottom));
+  tmp = g_list_prepend (tmp, new_screen_edge (0, 40, 1600, 0, top));
+  tmp = g_list_prepend (tmp, new_screen_edge (1600, 40, 0, 1160, right));
+  tmp = g_list_prepend (tmp, new_screen_edge (0, 40, 0, 1160, left));
   verify_edge_lists_are_equal (edges, tmp);
   meta_rectangle_free_list_and_elements (tmp);
   meta_rectangle_free_list_and_elements (edges);
@@ -1131,12 +1164,12 @@ test_find_onscreen_edges (void)
 static void
 test_find_nonintersected_monitor_edges (void)
 {
-  GList* edges;
-  GList* tmp;
+  GList *edges;
+  GList *tmp;
 
-  int left   = META_DIRECTION_LEFT;
-  int right  = META_DIRECTION_RIGHT;
-  int top    = META_DIRECTION_TOP;
+  int left = META_DIRECTION_LEFT;
+  int right = META_DIRECTION_RIGHT;
+  int top = META_DIRECTION_TOP;
   int bottom = META_DIRECTION_BOTTOM;
 
   /*************************************************************************/
@@ -1153,8 +1186,8 @@ test_find_nonintersected_monitor_edges (void)
   /*************************************************************************/
   edges = get_monitor_edges (2, 1);
   tmp = NULL;
-  tmp = g_list_prepend (tmp, new_monitor_edge (   0,  600, 1600, 0, bottom));
-  tmp = g_list_prepend (tmp, new_monitor_edge (   0,  600, 1600, 0, top));
+  tmp = g_list_prepend (tmp, new_monitor_edge (0, 600, 1600, 0, bottom));
+  tmp = g_list_prepend (tmp, new_monitor_edge (0, 600, 1600, 0, top));
   verify_edge_lists_are_equal (edges, tmp);
   meta_rectangle_free_list_and_elements (tmp);
   meta_rectangle_free_list_and_elements (edges);
@@ -1164,15 +1197,16 @@ test_find_nonintersected_monitor_edges (void)
   /*************************************************************************/
   edges = get_monitor_edges (1, 2);
   tmp = NULL;
-  tmp = g_list_prepend (tmp, new_monitor_edge ( 800,   20, 0, 1080, right));
-  tmp = g_list_prepend (tmp, new_monitor_edge ( 800,   20, 0, 1180, left));
+  tmp = g_list_prepend (tmp, new_monitor_edge (800, 20, 0, 1080, right));
+  tmp = g_list_prepend (tmp, new_monitor_edge (800, 20, 0, 1180, left));
 #if 0
   #define FUDGE 50
-  char big_buffer1[(EDGE_LENGTH+2)*FUDGE], big_buffer2[(EDGE_LENGTH+2)*FUDGE];
+  char big_buffer1[(EDGE_LENGTH + 2) * FUDGE],
+       big_buffer2[(EDGE_LENGTH + 2) * FUDGE];
   meta_rectangle_edge_list_to_string (edges, "\n ", big_buffer1);
-  meta_rectangle_edge_list_to_string (tmp,   "\n ", big_buffer2);
-  printf("Generated edge list:\n %s\nComparison edges list:\n %s\n",
-         big_buffer1, big_buffer2);
+  meta_rectangle_edge_list_to_string (tmp, "\n ", big_buffer2);
+  printf ("Generated edge list:\n %s\nComparison edges list:\n %s\n",
+          big_buffer1, big_buffer2);
 #endif
   verify_edge_lists_are_equal (edges, tmp);
   meta_rectangle_free_list_and_elements (tmp);
@@ -1183,12 +1217,12 @@ test_find_nonintersected_monitor_edges (void)
   /*************************************************************************/
   edges = get_monitor_edges (3, 3);
   tmp = NULL;
-  tmp = g_list_prepend (tmp, new_monitor_edge ( 900,  600,  700, 0, bottom));
-  tmp = g_list_prepend (tmp, new_monitor_edge (   0,  600,  700, 0, bottom));
-  tmp = g_list_prepend (tmp, new_monitor_edge ( 900,  600,  700, 0, top));
-  tmp = g_list_prepend (tmp, new_monitor_edge (   0,  600,  700, 0, top));
-  tmp = g_list_prepend (tmp, new_monitor_edge ( 800,  675, 0,  425, right));
-  tmp = g_list_prepend (tmp, new_monitor_edge ( 800,  675, 0,  525, left));
+  tmp = g_list_prepend (tmp, new_monitor_edge (900, 600, 700, 0, bottom));
+  tmp = g_list_prepend (tmp, new_monitor_edge (0, 600, 700, 0, bottom));
+  tmp = g_list_prepend (tmp, new_monitor_edge (900, 600, 700, 0, top));
+  tmp = g_list_prepend (tmp, new_monitor_edge (0, 600, 700, 0, top));
+  tmp = g_list_prepend (tmp, new_monitor_edge (800, 675, 0, 425, right));
+  tmp = g_list_prepend (tmp, new_monitor_edge (800, 675, 0, 525, left));
   verify_edge_lists_are_equal (edges, tmp);
   meta_rectangle_free_list_and_elements (tmp);
   meta_rectangle_free_list_and_elements (edges);
@@ -1198,9 +1232,9 @@ test_find_nonintersected_monitor_edges (void)
   /*************************************************************************/
   edges = get_monitor_edges (3, 4);
   tmp = NULL;
-  tmp = g_list_prepend (tmp, new_monitor_edge ( 800,  600,  800, 0, bottom));
-  tmp = g_list_prepend (tmp, new_monitor_edge ( 800,  600,  800, 0, top));
-  tmp = g_list_prepend (tmp, new_monitor_edge ( 800,  600,  0, 600, right));
+  tmp = g_list_prepend (tmp, new_monitor_edge (800, 600, 800, 0, bottom));
+  tmp = g_list_prepend (tmp, new_monitor_edge (800, 600, 800, 0, top));
+  tmp = g_list_prepend (tmp, new_monitor_edge (800, 600, 0, 600, right));
   verify_edge_lists_are_equal (edges, tmp);
   meta_rectangle_free_list_and_elements (tmp);
   meta_rectangle_free_list_and_elements (edges);
@@ -1223,8 +1257,8 @@ test_gravity_resize (void)
   rect.x = -500;  /* Some random amount not equal to oldrect.x to ensure that
                    * the resize is done with respect to oldrect instead of rect
                    */
-  oldrect = meta_rect ( 50,  300, 250, 400);
-  temp    = meta_rect ( 50,  300,  20,   5);
+  oldrect = meta_rect (50, 300, 250, 400);
+  temp = meta_rect (50, 300, 20, 5);
   meta_rectangle_resize_with_gravity (&oldrect,
                                       &rect,
                                       NorthWestGravity,
@@ -1232,8 +1266,8 @@ test_gravity_resize (void)
                                       5);
   g_assert (meta_rectangle_equal (&rect, &temp));
 
-  rect = meta_rect ( 50,  300, 250, 400);
-  temp = meta_rect (165,  300,  20,   5);
+  rect = meta_rect (50, 300, 250, 400);
+  temp = meta_rect (165, 300, 20, 5);
   meta_rectangle_resize_with_gravity (&rect,
                                       &rect,
                                       NorthGravity,
@@ -1241,8 +1275,8 @@ test_gravity_resize (void)
                                       5);
   g_assert (meta_rectangle_equal (&rect, &temp));
 
-  rect = meta_rect ( 50,  300, 250, 400);
-  temp = meta_rect (280,  300,  20,   5);
+  rect = meta_rect (50, 300, 250, 400);
+  temp = meta_rect (280, 300, 20, 5);
   meta_rectangle_resize_with_gravity (&rect,
                                       &rect,
                                       NorthEastGravity,
@@ -1250,8 +1284,8 @@ test_gravity_resize (void)
                                       5);
   g_assert (meta_rectangle_equal (&rect, &temp));
 
-  rect = meta_rect ( 50,  300, 250, 400);
-  temp = meta_rect ( 50,  695,  50,   5);
+  rect = meta_rect (50, 300, 250, 400);
+  temp = meta_rect (50, 695, 50, 5);
   meta_rectangle_resize_with_gravity (&rect,
                                       &rect,
                                       SouthWestGravity,
@@ -1259,8 +1293,8 @@ test_gravity_resize (void)
                                       5);
   g_assert (meta_rectangle_equal (&rect, &temp));
 
-  rect = meta_rect ( 50,  300, 250, 400);
-  temp = meta_rect (150,  695,  50,   5);
+  rect = meta_rect (50, 300, 250, 400);
+  temp = meta_rect (150, 695, 50, 5);
   meta_rectangle_resize_with_gravity (&rect,
                                       &rect,
                                       SouthGravity,
@@ -1268,8 +1302,8 @@ test_gravity_resize (void)
                                       5);
   g_assert (meta_rectangle_equal (&rect, &temp));
 
-  rect = meta_rect ( 50,  300, 250, 400);
-  temp = meta_rect (250,  695,  50,   5);
+  rect = meta_rect (50, 300, 250, 400);
+  temp = meta_rect (250, 695, 50, 5);
   meta_rectangle_resize_with_gravity (&rect,
                                       &rect,
                                       SouthEastGravity,
@@ -1277,8 +1311,8 @@ test_gravity_resize (void)
                                       5);
   g_assert (meta_rectangle_equal (&rect, &temp));
 
-  rect = meta_rect (167,  738, 237, 843);
-  temp = meta_rect (167, 1113, 832,  93);
+  rect = meta_rect (167, 738, 237, 843);
+  temp = meta_rect (167, 1113, 832, 93);
   meta_rectangle_resize_with_gravity (&rect,
                                       &rect,
                                       WestGravity,
@@ -1286,8 +1320,8 @@ test_gravity_resize (void)
                                       93);
   g_assert (meta_rectangle_equal (&rect, &temp));
 
-  rect = meta_rect ( 167,  738, 237, 843);
-  temp = meta_rect (-131, 1113, 833,  93);
+  rect = meta_rect (167, 738, 237, 843);
+  temp = meta_rect (-131, 1113, 833, 93);
   meta_rectangle_resize_with_gravity (&rect,
                                       &rect,
                                       CenterGravity,
@@ -1296,7 +1330,7 @@ test_gravity_resize (void)
   g_assert (meta_rectangle_equal (&rect, &temp));
 
   rect = meta_rect (300, 1000, 400, 200);
-  temp = meta_rect (270,  994, 430, 212);
+  temp = meta_rect (270, 994, 430, 212);
   meta_rectangle_resize_with_gravity (&rect,
                                       &rect,
                                       EastGravity,
@@ -1321,46 +1355,62 @@ test_find_closest_point_to_line (void)
   double x1, y1, x2, y2, px, py, rx, ry;
   double answer_x, answer_y;
 
-  x1 =  3.0;  y1 =  49.0;
-  x2 =  2.0;  y2 = - 1.0;
-  px = -2.6;  py =  19.1;
-  answer_x = 2.4; answer_y = 19;
-  meta_rectangle_find_linepoint_closest_to_point (x1,  y1,
-                                                  x2,  y2,
-                                                  px,  py,
+  x1 = 3.0;
+  y1 = 49.0;
+  x2 = 2.0;
+  y2 = -1.0;
+  px = -2.6;
+  py = 19.1;
+  answer_x = 2.4;
+  answer_y = 19;
+  meta_rectangle_find_linepoint_closest_to_point (x1, y1,
+                                                  x2, y2,
+                                                  px, py,
                                                   &rx, &ry);
   g_assert (fabs (rx - answer_x) < EPSILON && fabs (ry - answer_y) < EPSILON);
 
   /* Special test for x1 == x2, so that slop of line is infinite */
-  x1 =  3.0;  y1 =  49.0;
-  x2 =  3.0;  y2 = - 1.0;
-  px = -2.6;  py =  19.1;
-  answer_x = 3.0; answer_y = 19.1;
-  meta_rectangle_find_linepoint_closest_to_point (x1,  y1,
-                                                  x2,  y2,
-                                                  px,  py,
+  x1 = 3.0;
+  y1 = 49.0;
+  x2 = 3.0;
+  y2 = -1.0;
+  px = -2.6;
+  py = 19.1;
+  answer_x = 3.0;
+  answer_y = 19.1;
+  meta_rectangle_find_linepoint_closest_to_point (x1, y1,
+                                                  x2, y2,
+                                                  px, py,
                                                   &rx, &ry);
   g_assert (fabs (rx - answer_x) < EPSILON && fabs (ry - answer_y) < EPSILON);
 
   /* Special test for y1 == y2, so perp line has slope of infinity */
-  x1 =  3.14;  y1 =   7.0;
-  x2 =  2.718; y2 =   7.0;
-  px = -2.6;   py =  19.1;
-  answer_x = -2.6; answer_y = 7;
-  meta_rectangle_find_linepoint_closest_to_point (x1,  y1,
-                                                  x2,  y2,
-                                                  px,  py,
+  x1 = 3.14;
+  y1 = 7.0;
+  x2 = 2.718;
+  y2 = 7.0;
+  px = -2.6;
+  py = 19.1;
+  answer_x = -2.6;
+  answer_y = 7;
+  meta_rectangle_find_linepoint_closest_to_point (x1, y1,
+                                                  x2, y2,
+                                                  px, py,
                                                   &rx, &ry);
   g_assert (fabs (rx - answer_x) < EPSILON && fabs (ry - answer_y) < EPSILON);
 
   /* Test when we the point we want to be closest to is actually on the line */
-  x1 =  3.0;  y1 =  49.0;
-  x2 =  2.0;  y2 = - 1.0;
-  px =  2.4;  py =  19.0;
-  answer_x = 2.4; answer_y = 19;
-  meta_rectangle_find_linepoint_closest_to_point (x1,  y1,
-                                                  x2,  y2,
-                                                  px,  py,
+  x1 = 3.0;
+  y1 = 49.0;
+  x2 = 2.0;
+  y2 = -1.0;
+  px = 2.4;
+  py = 19.0;
+  answer_x = 2.4;
+  answer_y = 19;
+  meta_rectangle_find_linepoint_closest_to_point (x1, y1,
+                                                  x2, y2,
+                                                  px, py,
                                                   &rx, &ry);
   g_assert (fabs (rx - answer_x) < EPSILON && fabs (ry - answer_y) < EPSILON);
 }
diff --git a/src/tests/meta-backend-test.c b/src/tests/meta-backend-test.c
index 5da9da07f..0b86ccefb 100644
--- a/src/tests/meta-backend-test.c
+++ b/src/tests/meta-backend-test.c
@@ -66,6 +66,7 @@ meta_backend_test_class_init (MetaBackendTestClass *klass)
 {
   MetaBackendClass *backend_class = META_BACKEND_CLASS (klass);
 
-  backend_class->create_monitor_manager = meta_backend_test_create_monitor_manager;
+  backend_class->create_monitor_manager =
+    meta_backend_test_create_monitor_manager;
   backend_class->is_lid_closed = meta_backend_test_is_lid_closed;
 }
diff --git a/src/tests/meta-monitor-manager-test.c b/src/tests/meta-monitor-manager-test.c
index d1b729c8a..efbf91b61 100644
--- a/src/tests/meta-monitor-manager-test.c
+++ b/src/tests/meta-monitor-manager-test.c
@@ -50,7 +50,7 @@ struct _MetaGpuTest
 
 G_DEFINE_TYPE (MetaGpuTest, meta_gpu_test, META_TYPE_GPU)
 
-static MetaMonitorTestSetup *_initial_test_setup = NULL;
+static MetaMonitorTestSetup * _initial_test_setup = NULL;
 
 void
 meta_monitor_manager_test_init_test_setup (MetaMonitorTestSetup *test_setup)
@@ -81,16 +81,18 @@ meta_monitor_manager_test_emulate_hotplug (MetaMonitorManagerTest *manager_test,
 }
 
 void
-meta_monitor_manager_test_set_handles_transforms (MetaMonitorManagerTest *manager_test,
-                                                  gboolean                handles_transforms)
+meta_monitor_manager_test_set_handles_transforms (
+  MetaMonitorManagerTest *manager_test,
+  gboolean                handles_transforms)
 {
-  g_assert (handles_transforms || meta_is_stage_views_enabled());
+  g_assert (handles_transforms || meta_is_stage_views_enabled ());
 
   manager_test->handles_transforms = handles_transforms;
 }
 
 int
-meta_monitor_manager_test_get_tiled_monitor_count (MetaMonitorManagerTest *manager_test)
+meta_monitor_manager_test_get_tiled_monitor_count (
+  MetaMonitorManagerTest *manager_test)
 {
   return manager_test->tiled_monitor_count;
 }
@@ -190,7 +192,7 @@ apply_crtc_assignments (MetaMonitorManager *manager,
 
           for (j = 0; j < crtc_info->outputs->len; j++)
             {
-              output = ((MetaOutput**)crtc_info->outputs->pdata)[j];
+              output = ((MetaOutput **) crtc_info->outputs->pdata)[j];
 
               output->is_dirty = TRUE;
               meta_output_assign_crtc (output, crtc);
@@ -274,10 +276,11 @@ update_screen_size (MetaMonitorManager *manager,
 }
 
 static gboolean
-meta_monitor_manager_test_apply_monitors_config (MetaMonitorManager      *manager,
-                                                 MetaMonitorsConfig      *config,
-                                                 MetaMonitorsConfigMethod method,
-                                                 GError                 **error)
+meta_monitor_manager_test_apply_monitors_config (
+  MetaMonitorManager      *manager,
+  MetaMonitorsConfig      *config,
+  MetaMonitorsConfigMethod method,
+  GError                 **error)
 {
   GPtrArray *crtc_infos;
   GPtrArray *output_infos;
@@ -356,9 +359,10 @@ meta_monitor_manager_test_is_transform_handled (MetaMonitorManager  *manager,
 }
 
 static float
-meta_monitor_manager_test_calculate_monitor_mode_scale (MetaMonitorManager *manager,
-                                                        MetaMonitor        *monitor,
-                                                        MetaMonitorMode    *monitor_mode)
+meta_monitor_manager_test_calculate_monitor_mode_scale (
+  MetaMonitorManager *manager,
+  MetaMonitor        *monitor,
+  MetaMonitorMode    *monitor_mode)
 {
   MetaOutput *output;
   MetaOutputTest *output_test;
@@ -373,11 +377,12 @@ meta_monitor_manager_test_calculate_monitor_mode_scale (MetaMonitorManager *mana
 }
 
 static float *
-meta_monitor_manager_test_calculate_supported_scales (MetaMonitorManager          *manager,
-                                                      MetaLogicalMonitorLayoutMode layout_mode,
-                                                      MetaMonitor                 *monitor,
-                                                      MetaMonitorMode             *monitor_mode,
-                                                      int                         *n_supported_scales)
+meta_monitor_manager_test_calculate_supported_scales (
+  MetaMonitorManager          *manager,
+  MetaLogicalMonitorLayoutMode layout_mode,
+  MetaMonitor                 *monitor,
+  MetaMonitorMode             *monitor_mode,
+  int                         *n_supported_scales)
 {
   MetaMonitorScalesConstraint constraints =
     META_MONITOR_SCALES_CONSTRAINT_NONE;
@@ -480,21 +485,30 @@ meta_monitor_manager_test_class_init (MetaMonitorManagerTestClass *klass)
 
   object_class->dispose = meta_monitor_manager_test_dispose;
 
-  manager_class->ensure_initial_config = meta_monitor_manager_test_ensure_initial_config;
-  manager_class->apply_monitors_config = meta_monitor_manager_test_apply_monitors_config;
-  manager_class->tiled_monitor_added = meta_monitor_manager_test_tiled_monitor_added;
-  manager_class->tiled_monitor_removed = meta_monitor_manager_test_tiled_monitor_removed;
-  manager_class->is_transform_handled = meta_monitor_manager_test_is_transform_handled;
-  manager_class->calculate_monitor_mode_scale = meta_monitor_manager_test_calculate_monitor_mode_scale;
-  manager_class->calculate_supported_scales = meta_monitor_manager_test_calculate_supported_scales;
+  manager_class->ensure_initial_config =
+    meta_monitor_manager_test_ensure_initial_config;
+  manager_class->apply_monitors_config =
+    meta_monitor_manager_test_apply_monitors_config;
+  manager_class->tiled_monitor_added =
+    meta_monitor_manager_test_tiled_monitor_added;
+  manager_class->tiled_monitor_removed =
+    meta_monitor_manager_test_tiled_monitor_removed;
+  manager_class->is_transform_handled =
+    meta_monitor_manager_test_is_transform_handled;
+  manager_class->calculate_monitor_mode_scale =
+    meta_monitor_manager_test_calculate_monitor_mode_scale;
+  manager_class->calculate_supported_scales =
+    meta_monitor_manager_test_calculate_supported_scales;
   manager_class->get_capabilities = meta_monitor_manager_test_get_capabilities;
-  manager_class->get_max_screen_size = meta_monitor_manager_test_get_max_screen_size;
-  manager_class->get_default_layout_mode = meta_monitor_manager_test_get_default_layout_mode;
+  manager_class->get_max_screen_size =
+    meta_monitor_manager_test_get_max_screen_size;
+  manager_class->get_default_layout_mode =
+    meta_monitor_manager_test_get_default_layout_mode;
 }
 
 static gboolean
-meta_gpu_test_read_current (MetaGpu  *gpu,
-                            GError  **error)
+meta_gpu_test_read_current (MetaGpu *gpu,
+                            GError **error)
 {
   MetaMonitorManager *manager = meta_gpu_get_monitor_manager (gpu);
 
diff --git a/src/tests/monitor-store-unit-tests.c b/src/tests/monitor-store-unit-tests.c
index 4a73d89db..1513c42f3 100644
--- a/src/tests/monitor-store-unit-tests.c
+++ b/src/tests/monitor-store-unit-tests.c
@@ -155,7 +155,8 @@ check_monitor_configuration (MetaMonitorConfigStore        *config_store,
                        ==,
                        config_expect->logical_monitors[i].is_presentation);
 
-      g_assert_cmpint ((int) g_list_length (logical_monitor_config->monitor_configs),
+      g_assert_cmpint ((int) g_list_length (logical_monitor_config->
+                                            monitor_configs),
                        ==,
                        config_expect->logical_monitors[i].n_monitors);
 
@@ -221,12 +222,16 @@ check_monitor_configurations (MonitorStoreTestExpect *expect)
 static void
 meta_test_monitor_store_single (void)
 {
-  MonitorStoreTestExpect expect = {
-    .configurations = {
+  MonitorStoreTestExpect expect =
+  {
+    .configurations =
+    {
       {
-        .logical_monitors = {
+        .logical_monitors =
+        {
           {
-            .layout = {
+            .layout =
+            {
               .x = 0,
               .y = 0,
               .width = 1920,
@@ -235,13 +240,15 @@ meta_test_monitor_store_single (void)
             .scale = 1,
             .is_primary = TRUE,
             .is_presentation = FALSE,
-            .monitors = {
+            .monitors =
+            {
               {
                 .connector = "DP-1",
                 .vendor = "MetaProduct's Inc.",
                 .product = "MetaMonitor",
                 .serial = "0x123456",
-                .mode = {
+                .mode =
+                {
                   .width = 1920,
                   .height = 1080,
                   .refresh_rate = 60.000495910644531
@@ -265,12 +272,16 @@ meta_test_monitor_store_single (void)
 static void
 meta_test_monitor_store_vertical (void)
 {
-  MonitorStoreTestExpect expect = {
-    .configurations = {
+  MonitorStoreTestExpect expect =
+  {
+    .configurations =
+    {
       {
-        .logical_monitors = {
+        .logical_monitors =
+        {
           {
-            .layout = {
+            .layout =
+            {
               .x = 0,
               .y = 0,
               .width = 1024,
@@ -279,13 +290,15 @@ meta_test_monitor_store_vertical (void)
             .scale = 1,
             .is_primary = TRUE,
             .is_presentation = FALSE,
-            .monitors = {
+            .monitors =
+            {
               {
                 .connector = "DP-1",
                 .vendor = "MetaProduct's Inc.",
                 .product = "MetaMonitor",
                 .serial = "0x123456",
-                .mode = {
+                .mode =
+                {
                   .width = 1024,
                   .height = 768,
                   .refresh_rate = 60.000495910644531
@@ -295,7 +308,8 @@ meta_test_monitor_store_vertical (void)
             .n_monitors = 1,
           },
           {
-            .layout = {
+            .layout =
+            {
               .x = 0,
               .y = 768,
               .width = 800,
@@ -304,13 +318,15 @@ meta_test_monitor_store_vertical (void)
             .scale = 1,
             .is_primary = FALSE,
             .is_presentation = FALSE,
-            .monitors = {
+            .monitors =
+            {
               {
                 .connector = "DP-2",
                 .vendor = "MetaProduct's Inc.",
                 .product = "MetaMonitor",
                 .serial = "0x123456",
-                .mode = {
+                .mode =
+                {
                   .width = 800,
                   .height = 600,
                   .refresh_rate = 60.000495910644531
@@ -334,12 +350,16 @@ meta_test_monitor_store_vertical (void)
 static void
 meta_test_monitor_store_primary (void)
 {
-  MonitorStoreTestExpect expect = {
-    .configurations = {
+  MonitorStoreTestExpect expect =
+  {
+    .configurations =
+    {
       {
-        .logical_monitors = {
+        .logical_monitors =
+        {
           {
-            .layout = {
+            .layout =
+            {
               .x = 0,
               .y = 0,
               .width = 1024,
@@ -348,13 +368,15 @@ meta_test_monitor_store_primary (void)
             .scale = 1,
             .is_primary = FALSE,
             .is_presentation = FALSE,
-            .monitors = {
+            .monitors =
+            {
               {
                 .connector = "DP-1",
                 .vendor = "MetaProduct's Inc.",
                 .product = "MetaMonitor",
                 .serial = "0x123456",
-                .mode = {
+                .mode =
+                {
                   .width = 1024,
                   .height = 768,
                   .refresh_rate = 60.000495910644531
@@ -364,7 +386,8 @@ meta_test_monitor_store_primary (void)
             .n_monitors = 1,
           },
           {
-            .layout = {
+            .layout =
+            {
               .x = 1024,
               .y = 0,
               .width = 800,
@@ -373,13 +396,15 @@ meta_test_monitor_store_primary (void)
             .scale = 1,
             .is_primary = TRUE,
             .is_presentation = FALSE,
-            .monitors = {
+            .monitors =
+            {
               {
                 .connector = "DP-2",
                 .vendor = "MetaProduct's Inc.",
                 .product = "MetaMonitor",
                 .serial = "0x123456",
-                .mode = {
+                .mode =
+                {
                   .width = 800,
                   .height = 600,
                   .refresh_rate = 60.000495910644531
@@ -403,12 +428,16 @@ meta_test_monitor_store_primary (void)
 static void
 meta_test_monitor_store_underscanning (void)
 {
-  MonitorStoreTestExpect expect = {
-    .configurations = {
+  MonitorStoreTestExpect expect =
+  {
+    .configurations =
+    {
       {
-        .logical_monitors = {
+        .logical_monitors =
+        {
           {
-            .layout = {
+            .layout =
+            {
               .x = 0,
               .y = 0,
               .width = 1024,
@@ -417,14 +446,16 @@ meta_test_monitor_store_underscanning (void)
             .scale = 1,
             .is_primary = TRUE,
             .is_presentation = FALSE,
-            .monitors = {
+            .monitors =
+            {
               {
                 .connector = "DP-1",
                 .vendor = "MetaProduct's Inc.",
                 .product = "MetaMonitor",
                 .serial = "0x123456",
                 .is_underscanning = TRUE,
-                .mode = {
+                .mode =
+                {
                   .width = 1024,
                   .height = 768,
                   .refresh_rate = 60.000495910644531
@@ -448,12 +479,16 @@ meta_test_monitor_store_underscanning (void)
 static void
 meta_test_monitor_store_scale (void)
 {
-  MonitorStoreTestExpect expect = {
-    .configurations = {
+  MonitorStoreTestExpect expect =
+  {
+    .configurations =
+    {
       {
-        .logical_monitors = {
+        .logical_monitors =
+        {
           {
-            .layout = {
+            .layout =
+            {
               .x = 0,
               .y = 0,
               .width = 960,
@@ -462,13 +497,15 @@ meta_test_monitor_store_scale (void)
             .scale = 2,
             .is_primary = TRUE,
             .is_presentation = FALSE,
-            .monitors = {
+            .monitors =
+            {
               {
                 .connector = "DP-1",
                 .vendor = "MetaProduct's Inc.",
                 .product = "MetaMonitor",
                 .serial = "0x123456",
-                .mode = {
+                .mode =
+                {
                   .width = 1920,
                   .height = 1080,
                   .refresh_rate = 60.000495910644531
@@ -498,12 +535,16 @@ meta_test_monitor_store_scale (void)
 static void
 meta_test_monitor_store_fractional_scale (void)
 {
-  MonitorStoreTestExpect expect = {
-    .configurations = {
+  MonitorStoreTestExpect expect =
+  {
+    .configurations =
+    {
       {
-        .logical_monitors = {
+        .logical_monitors =
+        {
           {
-            .layout = {
+            .layout =
+            {
               .x = 0,
               .y = 0,
               .width = 800,
@@ -512,13 +553,15 @@ meta_test_monitor_store_fractional_scale (void)
             .scale = 1.5,
             .is_primary = TRUE,
             .is_presentation = FALSE,
-            .monitors = {
+            .monitors =
+            {
               {
                 .connector = "DP-1",
                 .vendor = "MetaProduct's Inc.",
                 .product = "MetaMonitor",
                 .serial = "0x123456",
-                .mode = {
+                .mode =
+                {
                   .width = 1200,
                   .height = 900,
                   .refresh_rate = 60.000495910644531
@@ -548,12 +591,16 @@ meta_test_monitor_store_fractional_scale (void)
 static void
 meta_test_monitor_store_high_precision_fractional_scale (void)
 {
-  MonitorStoreTestExpect expect = {
-    .configurations = {
+  MonitorStoreTestExpect expect =
+  {
+    .configurations =
+    {
       {
-        .logical_monitors = {
+        .logical_monitors =
+        {
           {
-            .layout = {
+            .layout =
+            {
               .x = 0,
               .y = 0,
               .width = 744,
@@ -562,13 +609,15 @@ meta_test_monitor_store_high_precision_fractional_scale (void)
             .scale = 1.3763440847396851,
             .is_primary = TRUE,
             .is_presentation = FALSE,
-            .monitors = {
+            .monitors =
+            {
               {
                 .connector = "DP-1",
                 .vendor = "MetaProduct's Inc.",
                 .product = "MetaMonitor",
                 .serial = "0x123456",
-                .mode = {
+                .mode =
+                {
                   .width = 1024,
                   .height = 768,
                   .refresh_rate = 60.000495910644531
@@ -598,12 +647,16 @@ meta_test_monitor_store_high_precision_fractional_scale (void)
 static void
 meta_test_monitor_store_mirrored (void)
 {
-  MonitorStoreTestExpect expect = {
-    .configurations = {
+  MonitorStoreTestExpect expect =
+  {
+    .configurations =
+    {
       {
-        .logical_monitors = {
+        .logical_monitors =
+        {
           {
-            .layout = {
+            .layout =
+            {
               .x = 0,
               .y = 0,
               .width = 800,
@@ -611,13 +664,15 @@ meta_test_monitor_store_mirrored (void)
             },
             .scale = 1,
             .is_primary = TRUE,
-            .monitors = {
+            .monitors =
+            {
               {
                 .connector = "DP-1",
                 .vendor = "MetaProduct's Inc.",
                 .product = "MetaMonitor",
                 .serial = "0x123456",
-                .mode = {
+                .mode =
+                {
                   .width = 800,
                   .height = 600,
                   .refresh_rate = 60.000495910644531
@@ -628,7 +683,8 @@ meta_test_monitor_store_mirrored (void)
                 .vendor = "MetaProduct's Inc.",
                 .product = "MetaMonitor",
                 .serial = "0x123456",
-                .mode = {
+                .mode =
+                {
                   .width = 800,
                   .height = 600,
                   .refresh_rate = 60.000495910644531
@@ -652,12 +708,16 @@ meta_test_monitor_store_mirrored (void)
 static void
 meta_test_monitor_store_first_rotated (void)
 {
-  MonitorStoreTestExpect expect = {
-    .configurations = {
+  MonitorStoreTestExpect expect =
+  {
+    .configurations =
+    {
       {
-        .logical_monitors = {
+        .logical_monitors =
+        {
           {
-            .layout = {
+            .layout =
+            {
               .x = 0,
               .y = 0,
               .width = 768,
@@ -667,13 +727,15 @@ meta_test_monitor_store_first_rotated (void)
             .transform = META_MONITOR_TRANSFORM_270,
             .is_primary = TRUE,
             .is_presentation = FALSE,
-            .monitors = {
+            .monitors =
+            {
               {
                 .connector = "DP-1",
                 .vendor = "MetaProduct's Inc.",
                 .product = "MetaMonitor",
                 .serial = "0x123456",
-                .mode = {
+                .mode =
+                {
                   .width = 1024,
                   .height = 768,
                   .refresh_rate = 60.000495910644531
@@ -683,7 +745,8 @@ meta_test_monitor_store_first_rotated (void)
             .n_monitors = 1,
           },
           {
-            .layout = {
+            .layout =
+            {
               .x = 768,
               .y = 0,
               .width = 1024,
@@ -693,13 +756,15 @@ meta_test_monitor_store_first_rotated (void)
             .transform = META_MONITOR_TRANSFORM_NORMAL,
             .is_primary = FALSE,
             .is_presentation = FALSE,
-            .monitors = {
+            .monitors =
+            {
               {
                 .connector = "DP-2",
                 .vendor = "MetaProduct's Inc.",
                 .product = "MetaMonitor",
                 .serial = "0x123456",
-                .mode = {
+                .mode =
+                {
                   .width = 1024,
                   .height = 768,
                   .refresh_rate = 60.000495910644531
@@ -723,12 +788,16 @@ meta_test_monitor_store_first_rotated (void)
 static void
 meta_test_monitor_store_second_rotated (void)
 {
-  MonitorStoreTestExpect expect = {
-    .configurations = {
+  MonitorStoreTestExpect expect =
+  {
+    .configurations =
+    {
       {
-        .logical_monitors = {
+        .logical_monitors =
+        {
           {
-            .layout = {
+            .layout =
+            {
               .x = 0,
               .y = 256,
               .width = 1024,
@@ -738,13 +807,15 @@ meta_test_monitor_store_second_rotated (void)
             .transform = META_MONITOR_TRANSFORM_NORMAL,
             .is_primary = TRUE,
             .is_presentation = FALSE,
-            .monitors = {
+            .monitors =
+            {
               {
                 .connector = "DP-1",
                 .vendor = "MetaProduct's Inc.",
                 .product = "MetaMonitor",
                 .serial = "0x123456",
-                .mode = {
+                .mode =
+                {
                   .width = 1024,
                   .height = 768,
                   .refresh_rate = 60.000495910644531
@@ -754,7 +825,8 @@ meta_test_monitor_store_second_rotated (void)
             .n_monitors = 1,
           },
           {
-            .layout = {
+            .layout =
+            {
               .x = 1024,
               .y = 0,
               .width = 768,
@@ -764,13 +836,15 @@ meta_test_monitor_store_second_rotated (void)
             .transform = META_MONITOR_TRANSFORM_90,
             .is_primary = FALSE,
             .is_presentation = FALSE,
-            .monitors = {
+            .monitors =
+            {
               {
                 .connector = "DP-2",
                 .vendor = "MetaProduct's Inc.",
                 .product = "MetaMonitor",
                 .serial = "0x123456",
-                .mode = {
+                .mode =
+                {
                   .width = 1024,
                   .height = 768,
                   .refresh_rate = 60.000495910644531
@@ -794,12 +868,16 @@ meta_test_monitor_store_second_rotated (void)
 static void
 meta_test_monitor_store_interlaced (void)
 {
-  MonitorStoreTestExpect expect = {
-    .configurations = {
+  MonitorStoreTestExpect expect =
+  {
+    .configurations =
+    {
       {
-        .logical_monitors = {
+        .logical_monitors =
+        {
           {
-            .layout = {
+            .layout =
+            {
               .x = 0,
               .y = 0,
               .width = 1024,
@@ -808,13 +886,15 @@ meta_test_monitor_store_interlaced (void)
             .scale = 1,
             .is_primary = TRUE,
             .is_presentation = FALSE,
-            .monitors = {
+            .monitors =
+            {
               {
                 .connector = "DP-1",
                 .vendor = "MetaProduct's Inc.",
                 .product = "MetaMonitor",
                 .serial = "0x123456",
-                .mode = {
+                .mode =
+                {
                   .width = 1024,
                   .height = 768,
                   .refresh_rate = 60.000495910644531,
diff --git a/src/tests/monitor-unit-tests.c b/src/tests/monitor-unit-tests.c
index 2b8207fc7..c8f9693a0 100644
--- a/src/tests/monitor-unit-tests.c
+++ b/src/tests/monitor-unit-tests.c
@@ -199,9 +199,12 @@ typedef struct _MonitorTestCase
   MonitorTestCaseExpect expect;
 } MonitorTestCase;
 
-static MonitorTestCase initial_test_case = {
-  .setup = {
-    .modes = {
+static MonitorTestCase initial_test_case =
+{
+  .setup =
+  {
+    .modes =
+    {
       {
         .width = 1024,
         .height = 768,
@@ -209,8 +212,9 @@ static MonitorTestCase initial_test_case = {
       }
     },
     .n_modes = 1,
-    .outputs = {
-       {
+    .outputs =
+    {
+      {
         .crtc = 0,
         .modes = { 0 },
         .n_modes = 1,
@@ -232,7 +236,8 @@ static MonitorTestCase initial_test_case = {
       }
     },
     .n_outputs = 2,
-    .crtcs = {
+    .crtcs =
+    {
       {
         .current_mode = 0
       },
@@ -243,17 +248,21 @@ static MonitorTestCase initial_test_case = {
     .n_crtcs = 2
   },
 
-  .expect = {
-    .monitors = {
+  .expect =
+  {
+    .monitors =
+    {
       {
         .outputs = { 0 },
         .n_outputs = 1,
-        .modes = {
+        .modes =
+        {
           {
             .width = 1024,
             .height = 768,
             .refresh_rate = 60.0,
-            .crtc_modes = {
+            .crtc_modes =
+            {
               {
                 .output = 0,
                 .crtc_mode = 0
@@ -269,12 +278,14 @@ static MonitorTestCase initial_test_case = {
       {
         .outputs = { 1 },
         .n_outputs = 1,
-        .modes = {
+        .modes =
+        {
           {
             .width = 1024,
             .height = 768,
             .refresh_rate = 60.0,
-            .crtc_modes = {
+            .crtc_modes =
+            {
               {
                 .output = 1,
                 .crtc_mode = 0
@@ -289,7 +300,8 @@ static MonitorTestCase initial_test_case = {
       }
     },
     .n_monitors = 2,
-    .logical_monitors = {
+    .logical_monitors =
+    {
       {
         .monitors = { 0 },
         .n_monitors = 1,
@@ -306,7 +318,8 @@ static MonitorTestCase initial_test_case = {
     .n_logical_monitors = 2,
     .primary_logical_monitor = 0,
     .n_outputs = 2,
-    .crtcs = {
+    .crtcs =
+    {
       {
         .current_mode = 0,
       },
@@ -794,7 +807,8 @@ check_monitor_configuration (MonitorTestCase *test_case)
           data = (CheckMonitorModeData) {
             .monitor_manager = monitor_manager,
             .expect_crtc_mode_iter =
-              test_case->expect.monitors[i].modes[expected_current_mode_index].crtc_modes
+              test_case->expect.monitors[i].modes[expected_current_mode_index].
+              crtc_modes
           };
           meta_monitor_mode_foreach_output (monitor, expected_current_mode,
                                             check_current_monitor_mode,
@@ -826,7 +840,8 @@ check_monitor_configuration (MonitorTestCase *test_case)
   else
     {
       MonitorTestCaseLogicalMonitor *test_logical_monitor =
-        &test_case->expect.logical_monitors[test_case->expect.primary_logical_monitor];
+        &test_case->expect.logical_monitors[test_case->expect.
+                                            primary_logical_monitor];
       MetaLogicalMonitor *logical_monitor;
 
       logical_monitor =
@@ -1032,9 +1047,9 @@ create_monitor_test_setup (MonitorTestCase *test_case,
         meta_output_assign_crtc (output, crtc);
       output->winsys_id = i;
       output->name = (is_laptop_panel ? g_strdup_printf ("eDP-%d",
-                                                  ++n_laptop_panels)
-                               : g_strdup_printf ("DP-%d",
-                                                  ++n_normal_panels));
+                                                         ++n_laptop_panels)
+                      : g_strdup_printf ("DP-%d",
+                                         ++n_normal_panels));
       output->vendor = g_strdup ("MetaProduct's Inc.");
       output->product = g_strdup ("MetaMonitor");
       output->serial = g_strdup (serial);
@@ -1053,7 +1068,7 @@ create_monitor_test_setup (MonitorTestCase *test_case,
       output->possible_clones = NULL;
       output->backlight = -1;
       output->connector_type = (is_laptop_panel ? META_CONNECTOR_TYPE_eDP
-                                         : META_CONNECTOR_TYPE_DisplayPort);
+                                : META_CONNECTOR_TYPE_DisplayPort);
       output->tile_info = test_case->setup.outputs[i].tile_info;
       output->is_underscanning = test_case->setup.outputs[i].is_underscanning;
       output->panel_orientation_transform =
@@ -1095,16 +1110,19 @@ meta_test_monitor_one_disconnected_linear_config (void)
   test_case.setup.n_outputs = 1;
 
   test_case.expect = (MonitorTestCaseExpect) {
-    .monitors = {
+    .monitors =
+    {
       {
         .outputs = { 0 },
         .n_outputs = 1,
-        .modes = {
+        .modes =
+        {
           {
             .width = 1024,
             .height = 768,
             .refresh_rate = 60.0,
-            .crtc_modes = {
+            .crtc_modes =
+            {
               {
                 .output = 0,
                 .crtc_mode = 0
@@ -1119,7 +1137,8 @@ meta_test_monitor_one_disconnected_linear_config (void)
       }
     },
     .n_monitors = 1,
-    .logical_monitors = {
+    .logical_monitors =
+    {
       {
         .monitors = { 0 },
         .n_monitors = 1,
@@ -1130,7 +1149,8 @@ meta_test_monitor_one_disconnected_linear_config (void)
     .n_logical_monitors = 1,
     .primary_logical_monitor = 0,
     .n_outputs = 1,
-    .crtcs = {
+    .crtcs =
+    {
       {
         .current_mode = 0,
       },
@@ -1154,7 +1174,8 @@ meta_test_monitor_one_off_linear_config (void)
 {
   MonitorTestCase test_case;
   MetaMonitorTestSetup *test_setup;
-  MonitorTestCaseOutput outputs[] = {
+  MonitorTestCaseOutput outputs[] =
+  {
     {
       .crtc = 0,
       .modes = { 0 },
@@ -1185,16 +1206,19 @@ meta_test_monitor_one_off_linear_config (void)
   test_case.setup.crtcs[1].current_mode = -1;
 
   test_case.expect = (MonitorTestCaseExpect) {
-    .monitors = {
+    .monitors =
+    {
       {
         .outputs = { 0 },
         .n_outputs = 1,
-        .modes = {
+        .modes =
+        {
           {
             .width = 1024,
             .height = 768,
             .refresh_rate = 60.0,
-            .crtc_modes = {
+            .crtc_modes =
+            {
               {
                 .output = 0,
                 .crtc_mode = 0
@@ -1210,12 +1234,14 @@ meta_test_monitor_one_off_linear_config (void)
       {
         .outputs = { 1 },
         .n_outputs = 1,
-        .modes = {
+        .modes =
+        {
           {
             .width = 1024,
             .height = 768,
             .refresh_rate = 60.0,
-            .crtc_modes = {
+            .crtc_modes =
+            {
               {
                 .output = 1,
                 .crtc_mode = 0
@@ -1230,7 +1256,8 @@ meta_test_monitor_one_off_linear_config (void)
       }
     },
     .n_monitors = 2,
-    .logical_monitors = {
+    .logical_monitors =
+    {
       {
         .monitors = { 0 },
         .n_monitors = 1,
@@ -1247,7 +1274,8 @@ meta_test_monitor_one_off_linear_config (void)
     .n_logical_monitors = 2,
     .primary_logical_monitor = 0,
     .n_outputs = 2,
-    .crtcs = {
+    .crtcs =
+    {
       {
         .current_mode = 0,
       },
@@ -1269,9 +1297,12 @@ meta_test_monitor_one_off_linear_config (void)
 static void
 meta_test_monitor_preferred_linear_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 800,
           .height = 600,
@@ -1289,7 +1320,8 @@ meta_test_monitor_preferred_linear_config (void)
         }
       },
       .n_modes = 3,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = -1,
           .modes = { 0, 1, 2 },
@@ -1302,7 +1334,8 @@ meta_test_monitor_preferred_linear_config (void)
         }
       },
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = -1
         }
@@ -1310,17 +1343,21 @@ meta_test_monitor_preferred_linear_config (void)
       .n_crtcs = 1
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 800,
               .height = 600,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -1331,7 +1368,8 @@ meta_test_monitor_preferred_linear_config (void)
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 1
@@ -1342,7 +1380,8 @@ meta_test_monitor_preferred_linear_config (void)
               .width = 1280,
               .height = 720,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 2
@@ -1357,7 +1396,8 @@ meta_test_monitor_preferred_linear_config (void)
         }
       },
       .n_monitors = 1,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -1368,7 +1408,8 @@ meta_test_monitor_preferred_linear_config (void)
       .n_logical_monitors = 1,
       .primary_logical_monitor = 0,
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 1,
         }
@@ -1389,9 +1430,12 @@ meta_test_monitor_preferred_linear_config (void)
 static void
 meta_test_monitor_tiled_linear_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 400,
           .height = 600,
@@ -1399,7 +1443,8 @@ meta_test_monitor_tiled_linear_config (void)
         },
       },
       .n_modes = 1,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = -1,
           .modes = { 0 },
@@ -1409,7 +1454,8 @@ meta_test_monitor_tiled_linear_config (void)
           .n_possible_crtcs = 1,
           .width_mm = 222,
           .height_mm = 125,
-          .tile_info = {
+          .tile_info =
+          {
             .group_id = 1,
             .max_h_tiles = 2,
             .max_v_tiles = 1,
@@ -1428,7 +1474,8 @@ meta_test_monitor_tiled_linear_config (void)
           .n_possible_crtcs = 1,
           .width_mm = 222,
           .height_mm = 125,
-          .tile_info = {
+          .tile_info =
+          {
             .group_id = 1,
             .max_h_tiles = 2,
             .max_v_tiles = 1,
@@ -1440,7 +1487,8 @@ meta_test_monitor_tiled_linear_config (void)
         }
       },
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = -1
         },
@@ -1451,17 +1499,21 @@ meta_test_monitor_tiled_linear_config (void)
       .n_crtcs = 2
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0, 1 },
           .n_outputs = 2,
-          .modes = {
+          .modes =
+          {
             {
               .width = 800,
               .height = 600,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -1480,7 +1532,8 @@ meta_test_monitor_tiled_linear_config (void)
         }
       },
       .n_monitors = 1,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -1491,7 +1544,8 @@ meta_test_monitor_tiled_linear_config (void)
       .n_logical_monitors = 1,
       .primary_logical_monitor = 0,
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         },
@@ -1518,9 +1572,12 @@ meta_test_monitor_tiled_linear_config (void)
 static void
 meta_test_monitor_tiled_non_preferred_linear_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 640,
           .height = 480,
@@ -1543,7 +1600,8 @@ meta_test_monitor_tiled_non_preferred_linear_config (void)
         },
       },
       .n_modes = 4,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = -1,
           .modes = { 0, 2 },
@@ -1553,7 +1611,8 @@ meta_test_monitor_tiled_non_preferred_linear_config (void)
           .n_possible_crtcs = 1,
           .width_mm = 222,
           .height_mm = 125,
-          .tile_info = {
+          .tile_info =
+          {
             .group_id = 1,
             .max_h_tiles = 2,
             .max_v_tiles = 1,
@@ -1572,7 +1631,8 @@ meta_test_monitor_tiled_non_preferred_linear_config (void)
           .n_possible_crtcs = 1,
           .width_mm = 222,
           .height_mm = 125,
-          .tile_info = {
+          .tile_info =
+          {
             .group_id = 1,
             .max_h_tiles = 2,
             .max_v_tiles = 1,
@@ -1584,7 +1644,8 @@ meta_test_monitor_tiled_non_preferred_linear_config (void)
         }
       },
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = -1
         },
@@ -1595,17 +1656,21 @@ meta_test_monitor_tiled_non_preferred_linear_config (void)
       .n_crtcs = 2
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0, 1 },
           .n_outputs = 2,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 120.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 2
@@ -1620,7 +1685,8 @@ meta_test_monitor_tiled_non_preferred_linear_config (void)
               .width = 800,
               .height = 600,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = -1
@@ -1635,7 +1701,8 @@ meta_test_monitor_tiled_non_preferred_linear_config (void)
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = -1
@@ -1654,7 +1721,8 @@ meta_test_monitor_tiled_non_preferred_linear_config (void)
         }
       },
       .n_monitors = 1,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -1665,7 +1733,8 @@ meta_test_monitor_tiled_non_preferred_linear_config (void)
       .n_logical_monitors = 1,
       .primary_logical_monitor = 0,
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 2,
         },
@@ -1691,9 +1760,12 @@ meta_test_monitor_tiled_non_preferred_linear_config (void)
 static void
 meta_test_monitor_tiled_non_main_origin_linear_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 400,
           .height = 600,
@@ -1706,7 +1778,8 @@ meta_test_monitor_tiled_non_main_origin_linear_config (void)
         },
       },
       .n_modes = 2,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = -1,
           .modes = { 0, 1 },
@@ -1716,7 +1789,8 @@ meta_test_monitor_tiled_non_main_origin_linear_config (void)
           .n_possible_crtcs = 1,
           .width_mm = 222,
           .height_mm = 125,
-          .tile_info = {
+          .tile_info =
+          {
             .group_id = 1,
             .max_h_tiles = 2,
             .max_v_tiles = 1,
@@ -1735,7 +1809,8 @@ meta_test_monitor_tiled_non_main_origin_linear_config (void)
           .n_possible_crtcs = 1,
           .width_mm = 222,
           .height_mm = 125,
-          .tile_info = {
+          .tile_info =
+          {
             .group_id = 1,
             .max_h_tiles = 2,
             .max_v_tiles = 1,
@@ -1747,7 +1822,8 @@ meta_test_monitor_tiled_non_main_origin_linear_config (void)
         }
       },
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = -1
         },
@@ -1758,17 +1834,21 @@ meta_test_monitor_tiled_non_main_origin_linear_config (void)
       .n_crtcs = 2
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0, 1 },
           .n_outputs = 2,
-          .modes = {
+          .modes =
+          {
             {
               .width = 800,
               .height = 600,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0,
@@ -1783,7 +1863,8 @@ meta_test_monitor_tiled_non_main_origin_linear_config (void)
               .width = 800,
               .height = 600,
               .refresh_rate = 30.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 1
@@ -1802,7 +1883,8 @@ meta_test_monitor_tiled_non_main_origin_linear_config (void)
         }
       },
       .n_monitors = 1,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -1813,7 +1895,8 @@ meta_test_monitor_tiled_non_main_origin_linear_config (void)
       .n_logical_monitors = 1,
       .primary_logical_monitor = 0,
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
           .x = 400,
@@ -1840,9 +1923,12 @@ meta_test_monitor_tiled_non_main_origin_linear_config (void)
 static void
 meta_test_monitor_hidpi_linear_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 1280,
           .height = 720,
@@ -1855,7 +1941,8 @@ meta_test_monitor_hidpi_linear_config (void)
         }
       },
       .n_modes = 2,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = 0,
           .modes = { 0 },
@@ -1881,7 +1968,8 @@ meta_test_monitor_hidpi_linear_config (void)
         }
       },
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = -1
         },
@@ -1892,17 +1980,21 @@ meta_test_monitor_hidpi_linear_config (void)
       .n_crtcs = 2
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1280,
               .height = 720,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -1918,12 +2010,14 @@ meta_test_monitor_hidpi_linear_config (void)
         {
           .outputs = { 1 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 1,
                   .crtc_mode = 1
@@ -1938,7 +2032,8 @@ meta_test_monitor_hidpi_linear_config (void)
         }
       },
       .n_monitors = 2,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -1955,7 +2050,8 @@ meta_test_monitor_hidpi_linear_config (void)
       .n_logical_monitors = 2,
       .primary_logical_monitor = 0,
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         },
@@ -1994,9 +2090,12 @@ set_suggested_output_position (MetaOutput *output,
 static void
 meta_test_monitor_suggested_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 800,
           .height = 600,
@@ -2009,7 +2108,8 @@ meta_test_monitor_suggested_config (void)
         }
       },
       .n_modes = 2,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = 0,
           .modes = { 0 },
@@ -2032,7 +2132,8 @@ meta_test_monitor_suggested_config (void)
         }
       },
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = -1
         },
@@ -2043,17 +2144,21 @@ meta_test_monitor_suggested_config (void)
       .n_crtcs = 2
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 800,
               .height = 600,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -2069,12 +2174,14 @@ meta_test_monitor_suggested_config (void)
         {
           .outputs = { 1 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 1,
                   .crtc_mode = 1
@@ -2093,7 +2200,8 @@ meta_test_monitor_suggested_config (void)
        * Logical monitors expectations altered to correspond to the
        * "suggested_x/y" changed further below.
        */
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -2110,7 +2218,8 @@ meta_test_monitor_suggested_config (void)
       .n_logical_monitors = 2,
       .primary_logical_monitor = 1,
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         },
@@ -2141,9 +2250,12 @@ meta_test_monitor_suggested_config (void)
 static void
 meta_test_monitor_limited_crtcs (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 1024,
           .height = 768,
@@ -2151,7 +2263,8 @@ meta_test_monitor_limited_crtcs (void)
         }
       },
       .n_modes = 1,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = -1,
           .modes = { 0 },
@@ -2174,7 +2287,8 @@ meta_test_monitor_limited_crtcs (void)
         }
       },
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0
         }
@@ -2182,17 +2296,21 @@ meta_test_monitor_limited_crtcs (void)
       .n_crtcs = 1
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -2208,12 +2326,14 @@ meta_test_monitor_limited_crtcs (void)
         {
           .outputs = { 1 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 1,
                   .crtc_mode = 0
@@ -2228,7 +2348,8 @@ meta_test_monitor_limited_crtcs (void)
         }
       },
       .n_monitors = 2,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -2239,7 +2360,8 @@ meta_test_monitor_limited_crtcs (void)
       .n_logical_monitors = 1,
       .primary_logical_monitor = 0,
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         }
@@ -2267,9 +2389,12 @@ meta_test_monitor_limited_crtcs (void)
 static void
 meta_test_monitor_lid_switch_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 1024,
           .height = 768,
@@ -2277,7 +2402,8 @@ meta_test_monitor_lid_switch_config (void)
         }
       },
       .n_modes = 1,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = 0,
           .modes = { 0 },
@@ -2301,7 +2427,8 @@ meta_test_monitor_lid_switch_config (void)
         }
       },
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0
         },
@@ -2312,17 +2439,21 @@ meta_test_monitor_lid_switch_config (void)
       .n_crtcs = 2
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -2338,12 +2469,14 @@ meta_test_monitor_lid_switch_config (void)
         {
           .outputs = { 1 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 1,
                   .crtc_mode = 0
@@ -2358,7 +2491,8 @@ meta_test_monitor_lid_switch_config (void)
         }
       },
       .n_monitors = 2,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -2375,7 +2509,8 @@ meta_test_monitor_lid_switch_config (void)
       .n_logical_monitors = 2,
       .primary_logical_monitor = 0,
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         },
@@ -2438,9 +2573,12 @@ meta_test_monitor_lid_switch_config (void)
 static void
 meta_test_monitor_lid_opened_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 1024,
           .height = 768,
@@ -2448,7 +2586,8 @@ meta_test_monitor_lid_opened_config (void)
         }
       },
       .n_modes = 1,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = 0,
           .modes = { 0 },
@@ -2472,7 +2611,8 @@ meta_test_monitor_lid_opened_config (void)
         }
       },
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0
         },
@@ -2483,17 +2623,21 @@ meta_test_monitor_lid_opened_config (void)
       .n_crtcs = 2
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -2509,12 +2653,14 @@ meta_test_monitor_lid_opened_config (void)
         {
           .outputs = { 1 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 1,
                   .crtc_mode = 0
@@ -2529,7 +2675,8 @@ meta_test_monitor_lid_opened_config (void)
         }
       },
       .n_monitors = 2,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 1 },
           .n_monitors = 1,
@@ -2546,7 +2693,8 @@ meta_test_monitor_lid_opened_config (void)
       .n_logical_monitors = 1, /* Second one checked after lid opened. */
       .primary_logical_monitor = 0,
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = -1,
         },
@@ -2587,9 +2735,12 @@ meta_test_monitor_lid_opened_config (void)
 static void
 meta_test_monitor_lid_closed_no_external (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 1024,
           .height = 768,
@@ -2597,7 +2748,8 @@ meta_test_monitor_lid_closed_no_external (void)
         }
       },
       .n_modes = 1,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = 0,
           .modes = { 0 },
@@ -2611,7 +2763,8 @@ meta_test_monitor_lid_closed_no_external (void)
         }
       },
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0
         }
@@ -2619,17 +2772,21 @@ meta_test_monitor_lid_closed_no_external (void)
       .n_crtcs = 1
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -2644,7 +2801,8 @@ meta_test_monitor_lid_closed_no_external (void)
         }
       },
       .n_monitors = 1,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -2655,7 +2813,8 @@ meta_test_monitor_lid_closed_no_external (void)
       .n_logical_monitors = 1,
       .primary_logical_monitor = 0,
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         },
@@ -2680,9 +2839,12 @@ meta_test_monitor_lid_closed_no_external (void)
 static void
 meta_test_monitor_lid_closed_with_hotplugged_external (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 1024,
           .height = 768,
@@ -2690,7 +2852,8 @@ meta_test_monitor_lid_closed_with_hotplugged_external (void)
         }
       },
       .n_modes = 1,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = -1,
           .modes = { 0 },
@@ -2714,7 +2877,8 @@ meta_test_monitor_lid_closed_with_hotplugged_external (void)
         }
       },
       .n_outputs = 1, /* Second is hotplugged later */
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = -1
         },
@@ -2725,17 +2889,21 @@ meta_test_monitor_lid_closed_with_hotplugged_external (void)
       .n_crtcs = 2
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -2751,12 +2919,14 @@ meta_test_monitor_lid_closed_with_hotplugged_external (void)
         {
           .outputs = { 1 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 1,
                   .crtc_mode = 0
@@ -2771,7 +2941,8 @@ meta_test_monitor_lid_closed_with_hotplugged_external (void)
         }
       },
       .n_monitors = 1, /* Second is hotplugged later */
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -2788,7 +2959,8 @@ meta_test_monitor_lid_closed_with_hotplugged_external (void)
       .n_logical_monitors = 1, /* Second is hotplugged later */
       .primary_logical_monitor = 0,
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         },
@@ -2908,14 +3080,17 @@ meta_test_monitor_lid_closed_with_hotplugged_external (void)
 static void
 meta_test_monitor_no_outputs (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
       .n_modes = 0,
       .n_outputs = 0,
       .n_crtcs = 0
     },
 
-    .expect = {
+    .expect =
+    {
       .n_monitors = 0,
       .n_logical_monitors = 0,
       .primary_logical_monitor = -1,
@@ -2960,9 +3135,12 @@ meta_test_monitor_no_outputs (void)
 static void
 meta_test_monitor_underscanning_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 1024,
           .height = 768,
@@ -2970,7 +3148,8 @@ meta_test_monitor_underscanning_config (void)
         }
       },
       .n_modes = 1,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = 0,
           .modes = { 0 },
@@ -2984,7 +3163,8 @@ meta_test_monitor_underscanning_config (void)
         }
       },
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0
         }
@@ -2992,17 +3172,21 @@ meta_test_monitor_underscanning_config (void)
       .n_crtcs = 1
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -3018,7 +3202,8 @@ meta_test_monitor_underscanning_config (void)
         }
       },
       .n_monitors = 1,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -3029,7 +3214,8 @@ meta_test_monitor_underscanning_config (void)
       .n_logical_monitors = 1,
       .primary_logical_monitor = 0,
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         }
@@ -3050,9 +3236,12 @@ meta_test_monitor_underscanning_config (void)
 static void
 meta_test_monitor_preferred_non_first_mode (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 800,
           .height = 600,
@@ -3067,7 +3256,8 @@ meta_test_monitor_preferred_non_first_mode (void)
         },
       },
       .n_modes = 2,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = -1,
           .modes = { 0, 1 },
@@ -3080,7 +3270,8 @@ meta_test_monitor_preferred_non_first_mode (void)
         }
       },
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = -1
         }
@@ -3088,17 +3279,21 @@ meta_test_monitor_preferred_non_first_mode (void)
       .n_crtcs = 1
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 800,
               .height = 600,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 1
@@ -3113,7 +3308,8 @@ meta_test_monitor_preferred_non_first_mode (void)
         }
       },
       .n_monitors = 1,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -3124,7 +3320,8 @@ meta_test_monitor_preferred_non_first_mode (void)
       .n_logical_monitors = 1,
       .primary_logical_monitor = 0,
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 1,
         }
@@ -3153,7 +3350,7 @@ meta_test_monitor_non_upright_panel (void)
     .height = 1024,
     .refresh_rate = 60.0,
   };
-  test_case.setup.n_modes = 2;  
+  test_case.setup.n_modes = 2;
   test_case.setup.outputs[0].modes[0] = 1;
   test_case.setup.outputs[0].preferred_mode = 1;
   test_case.setup.outputs[0].panel_orientation_transform =
@@ -3178,9 +3375,12 @@ meta_test_monitor_non_upright_panel (void)
 static void
 meta_test_monitor_custom_vertical_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 1024,
           .height = 768,
@@ -3193,7 +3393,8 @@ meta_test_monitor_custom_vertical_config (void)
         }
       },
       .n_modes = 2,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = 0,
           .modes = { 0 },
@@ -3216,7 +3417,8 @@ meta_test_monitor_custom_vertical_config (void)
         }
       },
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0
         },
@@ -3227,17 +3429,21 @@ meta_test_monitor_custom_vertical_config (void)
       .n_crtcs = 2
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -3253,12 +3459,14 @@ meta_test_monitor_custom_vertical_config (void)
         {
           .outputs = { 1 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 800,
               .height = 600,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 1,
                   .crtc_mode = 1
@@ -3273,7 +3481,8 @@ meta_test_monitor_custom_vertical_config (void)
         }
       },
       .n_monitors = 2,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -3290,7 +3499,8 @@ meta_test_monitor_custom_vertical_config (void)
       .n_logical_monitors = 2,
       .primary_logical_monitor = 0,
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         },
@@ -3317,9 +3527,12 @@ meta_test_monitor_custom_vertical_config (void)
 static void
 meta_test_monitor_custom_primary_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 1024,
           .height = 768,
@@ -3332,7 +3545,8 @@ meta_test_monitor_custom_primary_config (void)
         }
       },
       .n_modes = 2,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = 0,
           .modes = { 0 },
@@ -3355,7 +3569,8 @@ meta_test_monitor_custom_primary_config (void)
         }
       },
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0
         },
@@ -3366,17 +3581,21 @@ meta_test_monitor_custom_primary_config (void)
       .n_crtcs = 2
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -3392,12 +3611,14 @@ meta_test_monitor_custom_primary_config (void)
         {
           .outputs = { 1 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 800,
               .height = 600,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 1,
                   .crtc_mode = 1
@@ -3412,7 +3633,8 @@ meta_test_monitor_custom_primary_config (void)
         }
       },
       .n_monitors = 2,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -3429,7 +3651,8 @@ meta_test_monitor_custom_primary_config (void)
       .n_logical_monitors = 2,
       .primary_logical_monitor = 1,
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         },
@@ -3456,9 +3679,12 @@ meta_test_monitor_custom_primary_config (void)
 static void
 meta_test_monitor_custom_underscanning_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 1024,
           .height = 768,
@@ -3466,7 +3692,8 @@ meta_test_monitor_custom_underscanning_config (void)
         }
       },
       .n_modes = 1,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = 0,
           .modes = { 0 },
@@ -3479,7 +3706,8 @@ meta_test_monitor_custom_underscanning_config (void)
         },
       },
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0
         },
@@ -3487,17 +3715,21 @@ meta_test_monitor_custom_underscanning_config (void)
       .n_crtcs = 1
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -3513,7 +3745,8 @@ meta_test_monitor_custom_underscanning_config (void)
         }
       },
       .n_monitors = 1,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -3524,7 +3757,8 @@ meta_test_monitor_custom_underscanning_config (void)
       .n_logical_monitors = 1,
       .primary_logical_monitor = 0,
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         }
@@ -3548,9 +3782,12 @@ meta_test_monitor_custom_underscanning_config (void)
 static void
 meta_test_monitor_custom_scale_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 1920,
           .height = 1080,
@@ -3558,7 +3795,8 @@ meta_test_monitor_custom_scale_config (void)
         }
       },
       .n_modes = 1,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = 0,
           .modes = { 0 },
@@ -3571,7 +3809,8 @@ meta_test_monitor_custom_scale_config (void)
         },
       },
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0
         },
@@ -3579,17 +3818,21 @@ meta_test_monitor_custom_scale_config (void)
       .n_crtcs = 1
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1920,
               .height = 1080,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -3604,7 +3847,8 @@ meta_test_monitor_custom_scale_config (void)
         }
       },
       .n_monitors = 1,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -3615,7 +3859,8 @@ meta_test_monitor_custom_scale_config (void)
       .n_logical_monitors = 1,
       .primary_logical_monitor = 0,
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         }
@@ -3645,9 +3890,12 @@ meta_test_monitor_custom_scale_config (void)
 static void
 meta_test_monitor_custom_fractional_scale_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 1200,
           .height = 900,
@@ -3655,7 +3903,8 @@ meta_test_monitor_custom_fractional_scale_config (void)
         }
       },
       .n_modes = 1,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = 0,
           .modes = { 0 },
@@ -3668,7 +3917,8 @@ meta_test_monitor_custom_fractional_scale_config (void)
         },
       },
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0
         },
@@ -3676,17 +3926,21 @@ meta_test_monitor_custom_fractional_scale_config (void)
       .n_crtcs = 1
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1200,
               .height = 900,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -3701,7 +3955,8 @@ meta_test_monitor_custom_fractional_scale_config (void)
         }
       },
       .n_monitors = 1,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -3712,7 +3967,8 @@ meta_test_monitor_custom_fractional_scale_config (void)
       .n_logical_monitors = 1,
       .primary_logical_monitor = 0,
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         }
@@ -3742,9 +3998,12 @@ meta_test_monitor_custom_fractional_scale_config (void)
 static void
 meta_test_monitor_custom_high_precision_fractional_scale_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 1024,
           .height = 768,
@@ -3752,7 +4011,8 @@ meta_test_monitor_custom_high_precision_fractional_scale_config (void)
         }
       },
       .n_modes = 1,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = 0,
           .modes = { 0 },
@@ -3765,7 +4025,8 @@ meta_test_monitor_custom_high_precision_fractional_scale_config (void)
         },
       },
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0
         },
@@ -3773,17 +4034,21 @@ meta_test_monitor_custom_high_precision_fractional_scale_config (void)
       .n_crtcs = 1
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -3798,18 +4063,20 @@ meta_test_monitor_custom_high_precision_fractional_scale_config (void)
         }
       },
       .n_monitors = 1,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
           .layout = { .x = 0, .y = 0, .width = 744, .height = 558 },
-          .scale = 1024.0/744.0 /* 1.3763440847396851 */
+          .scale = 1024.0 / 744.0 /* 1.3763440847396851 */
         }
       },
       .n_logical_monitors = 1,
       .primary_logical_monitor = 0,
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         }
@@ -3839,9 +4106,12 @@ meta_test_monitor_custom_high_precision_fractional_scale_config (void)
 static void
 meta_test_monitor_custom_tiled_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 400,
           .height = 600,
@@ -3849,7 +4119,8 @@ meta_test_monitor_custom_tiled_config (void)
         }
       },
       .n_modes = 1,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = -1,
           .modes = { 0 },
@@ -3859,7 +4130,8 @@ meta_test_monitor_custom_tiled_config (void)
           .n_possible_crtcs = 2,
           .width_mm = 222,
           .height_mm = 125,
-          .tile_info = {
+          .tile_info =
+          {
             .group_id = 1,
             .max_h_tiles = 2,
             .max_v_tiles = 1,
@@ -3878,7 +4150,8 @@ meta_test_monitor_custom_tiled_config (void)
           .n_possible_crtcs = 2,
           .width_mm = 222,
           .height_mm = 125,
-          .tile_info = {
+          .tile_info =
+          {
             .group_id = 1,
             .max_h_tiles = 2,
             .max_v_tiles = 1,
@@ -3890,7 +4163,8 @@ meta_test_monitor_custom_tiled_config (void)
         }
       },
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0
         },
@@ -3901,17 +4175,21 @@ meta_test_monitor_custom_tiled_config (void)
       .n_crtcs = 2
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0, 1 },
           .n_outputs = 2,
-          .modes = {
+          .modes =
+          {
             {
               .width = 800,
               .height = 600,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0,
@@ -3930,7 +4208,8 @@ meta_test_monitor_custom_tiled_config (void)
         }
       },
       .n_monitors = 1,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -3941,7 +4220,8 @@ meta_test_monitor_custom_tiled_config (void)
       .n_logical_monitors = 1,
       .primary_logical_monitor = 0,
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         },
@@ -3976,9 +4256,12 @@ meta_test_monitor_custom_tiled_config (void)
 static void
 meta_test_monitor_custom_tiled_custom_resolution_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 400,
           .height = 600,
@@ -3991,7 +4274,8 @@ meta_test_monitor_custom_tiled_custom_resolution_config (void)
         }
       },
       .n_modes = 2,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = -1,
           .modes = { 0, 1 },
@@ -4001,7 +4285,8 @@ meta_test_monitor_custom_tiled_custom_resolution_config (void)
           .n_possible_crtcs = 2,
           .width_mm = 222,
           .height_mm = 125,
-          .tile_info = {
+          .tile_info =
+          {
             .group_id = 1,
             .max_h_tiles = 2,
             .max_v_tiles = 1,
@@ -4020,7 +4305,8 @@ meta_test_monitor_custom_tiled_custom_resolution_config (void)
           .n_possible_crtcs = 2,
           .width_mm = 222,
           .height_mm = 125,
-          .tile_info = {
+          .tile_info =
+          {
             .group_id = 1,
             .max_h_tiles = 2,
             .max_v_tiles = 1,
@@ -4032,7 +4318,8 @@ meta_test_monitor_custom_tiled_custom_resolution_config (void)
         }
       },
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = -1
         },
@@ -4043,17 +4330,21 @@ meta_test_monitor_custom_tiled_custom_resolution_config (void)
       .n_crtcs = 2
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0, 1 },
           .n_outputs = 2,
-          .modes = {
+          .modes =
+          {
             {
               .width = 800,
               .height = 600,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0,
@@ -4068,7 +4359,8 @@ meta_test_monitor_custom_tiled_custom_resolution_config (void)
               .width = 640,
               .height = 480,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 1,
@@ -4087,7 +4379,8 @@ meta_test_monitor_custom_tiled_custom_resolution_config (void)
         }
       },
       .n_monitors = 1,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -4098,7 +4391,8 @@ meta_test_monitor_custom_tiled_custom_resolution_config (void)
       .n_logical_monitors = 1,
       .primary_logical_monitor = 0,
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 1,
         },
@@ -4133,9 +4427,12 @@ meta_test_monitor_custom_tiled_custom_resolution_config (void)
 static void
 meta_test_monitor_custom_tiled_non_preferred_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 640,
           .height = 480,
@@ -4158,7 +4455,8 @@ meta_test_monitor_custom_tiled_non_preferred_config (void)
         },
       },
       .n_modes = 4,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = -1,
           .modes = { 0, 2 },
@@ -4168,7 +4466,8 @@ meta_test_monitor_custom_tiled_non_preferred_config (void)
           .n_possible_crtcs = 1,
           .width_mm = 222,
           .height_mm = 125,
-          .tile_info = {
+          .tile_info =
+          {
             .group_id = 1,
             .max_h_tiles = 2,
             .max_v_tiles = 1,
@@ -4187,7 +4486,8 @@ meta_test_monitor_custom_tiled_non_preferred_config (void)
           .n_possible_crtcs = 1,
           .width_mm = 222,
           .height_mm = 125,
-          .tile_info = {
+          .tile_info =
+          {
             .group_id = 1,
             .max_h_tiles = 2,
             .max_v_tiles = 1,
@@ -4199,7 +4499,8 @@ meta_test_monitor_custom_tiled_non_preferred_config (void)
         }
       },
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = -1
         },
@@ -4210,17 +4511,21 @@ meta_test_monitor_custom_tiled_non_preferred_config (void)
       .n_crtcs = 2
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0, 1 },
           .n_outputs = 2,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 120.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 2
@@ -4235,7 +4540,8 @@ meta_test_monitor_custom_tiled_non_preferred_config (void)
               .width = 800,
               .height = 600,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = -1
@@ -4250,7 +4556,8 @@ meta_test_monitor_custom_tiled_non_preferred_config (void)
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = -1
@@ -4269,7 +4576,8 @@ meta_test_monitor_custom_tiled_non_preferred_config (void)
         }
       },
       .n_monitors = 1,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -4280,7 +4588,8 @@ meta_test_monitor_custom_tiled_non_preferred_config (void)
       .n_logical_monitors = 1,
       .primary_logical_monitor = 0,
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = -1,
         },
@@ -4307,9 +4616,12 @@ meta_test_monitor_custom_tiled_non_preferred_config (void)
 static void
 meta_test_monitor_custom_mirrored_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 800,
           .height = 600,
@@ -4317,7 +4629,8 @@ meta_test_monitor_custom_mirrored_config (void)
         }
       },
       .n_modes = 1,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = 0,
           .modes = { 0 },
@@ -4340,7 +4653,8 @@ meta_test_monitor_custom_mirrored_config (void)
         }
       },
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0
         },
@@ -4351,17 +4665,21 @@ meta_test_monitor_custom_mirrored_config (void)
       .n_crtcs = 2
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 800,
               .height = 600,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -4377,12 +4695,14 @@ meta_test_monitor_custom_mirrored_config (void)
         {
           .outputs = { 1 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 800,
               .height = 600,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 1,
                   .crtc_mode = 0
@@ -4397,7 +4717,8 @@ meta_test_monitor_custom_mirrored_config (void)
         }
       },
       .n_monitors = 2,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0, 1 },
           .n_monitors = 2,
@@ -4408,7 +4729,8 @@ meta_test_monitor_custom_mirrored_config (void)
       .n_logical_monitors = 1,
       .primary_logical_monitor = 0,
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         },
@@ -4435,9 +4757,12 @@ meta_test_monitor_custom_mirrored_config (void)
 static void
 meta_test_monitor_custom_first_rotated_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 1024,
           .height = 768,
@@ -4445,7 +4770,8 @@ meta_test_monitor_custom_first_rotated_config (void)
         }
       },
       .n_modes = 1,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = 0,
           .modes = { 0 },
@@ -4468,7 +4794,8 @@ meta_test_monitor_custom_first_rotated_config (void)
         }
       },
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         },
@@ -4479,17 +4806,21 @@ meta_test_monitor_custom_first_rotated_config (void)
       .n_crtcs = 2
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -4505,12 +4836,14 @@ meta_test_monitor_custom_first_rotated_config (void)
         {
           .outputs = { 1 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 1,
                   .crtc_mode = 0
@@ -4525,7 +4858,8 @@ meta_test_monitor_custom_first_rotated_config (void)
         }
       },
       .n_monitors = 2,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -4543,7 +4877,8 @@ meta_test_monitor_custom_first_rotated_config (void)
       .n_logical_monitors = 2,
       .primary_logical_monitor = 0,
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
           .transform = META_MONITOR_TRANSFORM_270
@@ -4569,9 +4904,12 @@ meta_test_monitor_custom_first_rotated_config (void)
 static void
 meta_test_monitor_custom_second_rotated_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 1024,
           .height = 768,
@@ -4579,7 +4917,8 @@ meta_test_monitor_custom_second_rotated_config (void)
         }
       },
       .n_modes = 1,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = 0,
           .modes = { 0 },
@@ -4602,7 +4941,8 @@ meta_test_monitor_custom_second_rotated_config (void)
         }
       },
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0
         },
@@ -4613,17 +4953,21 @@ meta_test_monitor_custom_second_rotated_config (void)
       .n_crtcs = 2
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -4639,12 +4983,14 @@ meta_test_monitor_custom_second_rotated_config (void)
         {
           .outputs = { 1 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 1,
                   .crtc_mode = 0
@@ -4659,7 +5005,8 @@ meta_test_monitor_custom_second_rotated_config (void)
         }
       },
       .n_monitors = 2,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -4677,7 +5024,8 @@ meta_test_monitor_custom_second_rotated_config (void)
       .n_logical_monitors = 2,
       .primary_logical_monitor = 0,
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         },
@@ -4703,9 +5051,12 @@ meta_test_monitor_custom_second_rotated_config (void)
 static void
 meta_test_monitor_custom_second_rotated_tiled_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 1024,
           .height = 768,
@@ -4718,7 +5069,8 @@ meta_test_monitor_custom_second_rotated_tiled_config (void)
         }
       },
       .n_modes = 2,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = 0,
           .modes = { 0 },
@@ -4738,7 +5090,8 @@ meta_test_monitor_custom_second_rotated_tiled_config (void)
           .n_possible_crtcs = 2,
           .width_mm = 222,
           .height_mm = 125,
-          .tile_info = {
+          .tile_info =
+          {
             .group_id = 1,
             .max_h_tiles = 2,
             .max_v_tiles = 1,
@@ -4757,7 +5110,8 @@ meta_test_monitor_custom_second_rotated_tiled_config (void)
           .n_possible_crtcs = 2,
           .width_mm = 222,
           .height_mm = 125,
-          .tile_info = {
+          .tile_info =
+          {
             .group_id = 1,
             .max_h_tiles = 2,
             .max_v_tiles = 1,
@@ -4769,7 +5123,8 @@ meta_test_monitor_custom_second_rotated_tiled_config (void)
         }
       },
       .n_outputs = 3,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = -1
         },
@@ -4783,17 +5138,21 @@ meta_test_monitor_custom_second_rotated_tiled_config (void)
       .n_crtcs = 3
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -4809,12 +5168,14 @@ meta_test_monitor_custom_second_rotated_tiled_config (void)
         {
           .outputs = { 1, 2 },
           .n_outputs = 2,
-          .modes = {
+          .modes =
+          {
             {
               .width = 800,
               .height = 600,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 1,
                   .crtc_mode = 1,
@@ -4833,7 +5194,8 @@ meta_test_monitor_custom_second_rotated_tiled_config (void)
         }
       },
       .n_monitors = 2,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -4851,7 +5213,8 @@ meta_test_monitor_custom_second_rotated_tiled_config (void)
       .n_logical_monitors = 2,
       .primary_logical_monitor = 0,
       .n_outputs = 3,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         },
@@ -4892,9 +5255,12 @@ meta_test_monitor_custom_second_rotated_tiled_config (void)
 static void
 meta_test_monitor_custom_second_rotated_nonnative_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 1024,
           .height = 768,
@@ -4902,7 +5268,8 @@ meta_test_monitor_custom_second_rotated_nonnative_config (void)
         }
       },
       .n_modes = 1,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = 0,
           .modes = { 0 },
@@ -4925,7 +5292,8 @@ meta_test_monitor_custom_second_rotated_nonnative_config (void)
         }
       },
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0
         },
@@ -4936,17 +5304,21 @@ meta_test_monitor_custom_second_rotated_nonnative_config (void)
       .n_crtcs = 2
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -4962,12 +5334,14 @@ meta_test_monitor_custom_second_rotated_nonnative_config (void)
         {
           .outputs = { 1 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 1,
                   .crtc_mode = 0
@@ -4982,7 +5356,8 @@ meta_test_monitor_custom_second_rotated_nonnative_config (void)
         }
       },
       .n_monitors = 2,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -5000,7 +5375,8 @@ meta_test_monitor_custom_second_rotated_nonnative_config (void)
       .n_logical_monitors = 2,
       .primary_logical_monitor = 0,
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         },
@@ -5040,9 +5416,12 @@ meta_test_monitor_custom_second_rotated_nonnative_config (void)
 static void
 meta_test_monitor_custom_interlaced_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 1024,
           .height = 768,
@@ -5056,7 +5435,8 @@ meta_test_monitor_custom_interlaced_config (void)
         }
       },
       .n_modes = 2,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = 0,
           .modes = { 0, 1 },
@@ -5069,7 +5449,8 @@ meta_test_monitor_custom_interlaced_config (void)
         },
       },
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0
         },
@@ -5077,18 +5458,22 @@ meta_test_monitor_custom_interlaced_config (void)
       .n_crtcs = 1
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.000495910644531,
               .flags = META_CRTC_MODE_FLAG_NONE,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0,
@@ -5100,7 +5485,8 @@ meta_test_monitor_custom_interlaced_config (void)
               .height = 768,
               .refresh_rate = 60.000495910644531,
               .flags = META_CRTC_MODE_FLAG_INTERLACE,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 1,
@@ -5115,7 +5501,8 @@ meta_test_monitor_custom_interlaced_config (void)
         }
       },
       .n_monitors = 1,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -5126,7 +5513,8 @@ meta_test_monitor_custom_interlaced_config (void)
       .n_logical_monitors = 1,
       .primary_logical_monitor = 0,
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 1,
         }
@@ -5150,9 +5538,12 @@ meta_test_monitor_custom_interlaced_config (void)
 static void
 meta_test_monitor_custom_oneoff (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 800,
           .height = 600,
@@ -5160,7 +5551,8 @@ meta_test_monitor_custom_oneoff (void)
         }
       },
       .n_modes = 1,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = -1,
           .modes = { 0 },
@@ -5184,7 +5576,8 @@ meta_test_monitor_custom_oneoff (void)
         }
       },
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = -1
         },
@@ -5195,17 +5588,21 @@ meta_test_monitor_custom_oneoff (void)
       .n_crtcs = 2
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 800,
               .height = 600,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -5221,12 +5618,14 @@ meta_test_monitor_custom_oneoff (void)
         {
           .outputs = { 1 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 800,
               .height = 600,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 1,
                   .crtc_mode = 0
@@ -5241,7 +5640,8 @@ meta_test_monitor_custom_oneoff (void)
         }
       },
       .n_monitors = 2,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -5253,7 +5653,8 @@ meta_test_monitor_custom_oneoff (void)
       .n_logical_monitors = 1,
       .primary_logical_monitor = 0,
       .n_outputs = 2,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         },
@@ -5279,9 +5680,12 @@ meta_test_monitor_custom_oneoff (void)
 static void
 meta_test_monitor_custom_lid_switch_config (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 1024,
           .height = 768,
@@ -5289,7 +5693,8 @@ meta_test_monitor_custom_lid_switch_config (void)
         }
       },
       .n_modes = 1,
-      .outputs = {
+      .outputs =
+      {
         {
           .modes = { 0 },
           .n_modes = 1,
@@ -5311,7 +5716,8 @@ meta_test_monitor_custom_lid_switch_config (void)
         }
       },
       .n_outputs = 1, /* Second one hot plugged later */
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         },
@@ -5322,17 +5728,21 @@ meta_test_monitor_custom_lid_switch_config (void)
       .n_crtcs = 2
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -5348,12 +5758,14 @@ meta_test_monitor_custom_lid_switch_config (void)
         {
           .outputs = { 1 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 1024,
               .height = 768,
               .refresh_rate = 60.000495910644531,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 1,
                   .crtc_mode = 0
@@ -5368,7 +5780,8 @@ meta_test_monitor_custom_lid_switch_config (void)
         }
       },
       .n_monitors = 1, /* Second one hot plugged later */
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -5386,7 +5799,8 @@ meta_test_monitor_custom_lid_switch_config (void)
       .n_logical_monitors = 1, /* Second one hot plugged later */
       .primary_logical_monitor = 0,
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
           .transform = META_MONITOR_TRANSFORM_270
@@ -5418,8 +5832,11 @@ meta_test_monitor_custom_lid_switch_config (void)
   test_case.expect.crtcs[1].current_mode = 0;
   test_case.expect.crtcs[1].transform = META_MONITOR_TRANSFORM_270;
   test_case.expect.logical_monitors[0].layout =
-    (MetaRectangle) { .width = 1024, .height = 768 };
-  test_case.expect.logical_monitors[0].transform = META_MONITOR_TRANSFORM_NORMAL;
+    (MetaRectangle) {
+    .width = 1024, .height = 768
+  };
+  test_case.expect.logical_monitors[0].transform =
+    META_MONITOR_TRANSFORM_NORMAL;
   test_case.expect.logical_monitors[1].transform = META_MONITOR_TRANSFORM_270;
   test_case.expect.n_logical_monitors = 2;
   test_case.expect.screen_width = 1024 + 768;
@@ -5435,7 +5852,9 @@ meta_test_monitor_custom_lid_switch_config (void)
   test_case.expect.crtcs[1].transform = META_MONITOR_TRANSFORM_90;
   test_case.expect.monitors[0].current_mode = -1;
   test_case.expect.logical_monitors[0].layout =
-    (MetaRectangle) { .width = 768, .height = 1024 };
+    (MetaRectangle) {
+    .width = 768, .height = 1024
+  };
   test_case.expect.logical_monitors[0].monitors[0] = 1;
   test_case.expect.logical_monitors[0].transform = META_MONITOR_TRANSFORM_90;
   test_case.expect.n_logical_monitors = 1;
@@ -5455,9 +5874,12 @@ meta_test_monitor_custom_lid_switch_config (void)
   test_case.expect.crtcs[1].transform = META_MONITOR_TRANSFORM_270;
   test_case.expect.monitors[0].current_mode = 0;
   test_case.expect.logical_monitors[0].layout =
-    (MetaRectangle) { .width = 1024, .height = 768 };
+    (MetaRectangle) {
+    .width = 1024, .height = 768
+  };
   test_case.expect.logical_monitors[0].monitors[0] = 0;
-  test_case.expect.logical_monitors[0].transform = META_MONITOR_TRANSFORM_NORMAL;
+  test_case.expect.logical_monitors[0].transform =
+    META_MONITOR_TRANSFORM_NORMAL;
   test_case.expect.logical_monitors[1].transform = META_MONITOR_TRANSFORM_270;
   test_case.expect.n_logical_monitors = 2;
   test_case.expect.screen_width = 1024 + 768;
@@ -5472,9 +5894,12 @@ meta_test_monitor_custom_lid_switch_config (void)
 static void
 meta_test_monitor_migrated_rotated (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 800,
           .height = 600,
@@ -5482,7 +5907,8 @@ meta_test_monitor_migrated_rotated (void)
         }
       },
       .n_modes = 1,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = -1,
           .modes = { 0 },
@@ -5495,7 +5921,8 @@ meta_test_monitor_migrated_rotated (void)
         }
       },
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = -1
         }
@@ -5503,17 +5930,21 @@ meta_test_monitor_migrated_rotated (void)
       .n_crtcs = 1
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 800,
               .height = 600,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -5528,7 +5959,8 @@ meta_test_monitor_migrated_rotated (void)
         }
       },
       .n_monitors = 1,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -5540,7 +5972,8 @@ meta_test_monitor_migrated_rotated (void)
       .n_logical_monitors = 1,
       .primary_logical_monitor = 0,
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
           .transform = META_MONITOR_TRANSFORM_270
@@ -5613,9 +6046,12 @@ meta_test_monitor_migrated_rotated (void)
 static void
 meta_test_monitor_migrated_wiggle_discard (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 800,
           .height = 600,
@@ -5623,7 +6059,8 @@ meta_test_monitor_migrated_wiggle_discard (void)
         }
       },
       .n_modes = 1,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = -1,
           .modes = { 0 },
@@ -5636,7 +6073,8 @@ meta_test_monitor_migrated_wiggle_discard (void)
         }
       },
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = -1
         }
@@ -5644,17 +6082,21 @@ meta_test_monitor_migrated_wiggle_discard (void)
       .n_crtcs = 1
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 800,
               .height = 600,
               .refresh_rate = 59.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -5669,7 +6111,8 @@ meta_test_monitor_migrated_wiggle_discard (void)
         }
       },
       .n_monitors = 1,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -5681,7 +6124,8 @@ meta_test_monitor_migrated_wiggle_discard (void)
       .n_logical_monitors = 1,
       .primary_logical_monitor = 0,
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
         }
@@ -5757,9 +6201,12 @@ meta_test_monitor_migrated_wiggle_discard (void)
 static void
 meta_test_monitor_migrated_wiggle (void)
 {
-  MonitorTestCase test_case = {
-    .setup = {
-      .modes = {
+  MonitorTestCase test_case =
+  {
+    .setup =
+    {
+      .modes =
+      {
         {
           .width = 800,
           .height = 600,
@@ -5767,7 +6214,8 @@ meta_test_monitor_migrated_wiggle (void)
         }
       },
       .n_modes = 1,
-      .outputs = {
+      .outputs =
+      {
         {
           .crtc = -1,
           .modes = { 0 },
@@ -5780,7 +6228,8 @@ meta_test_monitor_migrated_wiggle (void)
         }
       },
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = -1
         }
@@ -5788,17 +6237,21 @@ meta_test_monitor_migrated_wiggle (void)
       .n_crtcs = 1
     },
 
-    .expect = {
-      .monitors = {
+    .expect =
+    {
+      .monitors =
+      {
         {
           .outputs = { 0 },
           .n_outputs = 1,
-          .modes = {
+          .modes =
+          {
             {
               .width = 800,
               .height = 600,
               .refresh_rate = 60.0,
-              .crtc_modes = {
+              .crtc_modes =
+              {
                 {
                   .output = 0,
                   .crtc_mode = 0
@@ -5813,7 +6266,8 @@ meta_test_monitor_migrated_wiggle (void)
         }
       },
       .n_monitors = 1,
-      .logical_monitors = {
+      .logical_monitors =
+      {
         {
           .monitors = { 0 },
           .n_monitors = 1,
@@ -5825,7 +6279,8 @@ meta_test_monitor_migrated_wiggle (void)
       .n_logical_monitors = 1,
       .primary_logical_monitor = 0,
       .n_outputs = 1,
-      .crtcs = {
+      .crtcs =
+      {
         {
           .current_mode = 0,
           .transform = META_MONITOR_TRANSFORM_90
@@ -5896,8 +6351,8 @@ meta_test_monitor_migrated_wiggle (void)
 }
 
 static void
-test_case_setup (void       **fixture,
-                 const void   *data)
+test_case_setup (void      **fixture,
+                 const void *data)
 {
   MetaBackend *backend = meta_get_backend ();
   MetaMonitorManager *monitor_manager =
@@ -5918,7 +6373,7 @@ add_monitor_test (const char *test_path,
 {
   g_test_add (test_path, gpointer, NULL,
               test_case_setup,
-              (void (* ) (void **, const void *)) test_func,
+              (void (*)(void **, const void *))test_func,
               NULL);
 }
 
@@ -5978,8 +6433,9 @@ init_monitor_tests (void)
                     meta_test_monitor_custom_scale_config);
   add_monitor_test ("/backends/monitor/custom/fractional-scale-config",
                     meta_test_monitor_custom_fractional_scale_config);
-  add_monitor_test ("/backends/monitor/custom/high-precision-fractional-scale-config",
-                    meta_test_monitor_custom_high_precision_fractional_scale_config);
+  add_monitor_test (
+    "/backends/monitor/custom/high-precision-fractional-scale-config",
+    meta_test_monitor_custom_high_precision_fractional_scale_config);
   add_monitor_test ("/backends/monitor/custom/tiled-config",
                     meta_test_monitor_custom_tiled_config);
   add_monitor_test ("/backends/monitor/custom/tiled-custom-resolution-config",
diff --git a/src/tests/test-client.c b/src/tests/test-client.c
index f1d004cd6..535e30109 100644
--- a/src/tests/test-client.c
+++ b/src/tests/test-client.c
@@ -81,7 +81,7 @@ process_line (const char *line)
     {
       int i;
 
-      if (argc  < 2)
+      if (argc < 2)
         {
           g_print ("usage: create <id> [override|csd]");
           goto out;
@@ -109,7 +109,8 @@ process_line (const char *line)
           goto out;
         }
 
-      GtkWidget *window = gtk_window_new (override ? GTK_WINDOW_POPUP : GTK_WINDOW_TOPLEVEL);
+      GtkWidget *window = gtk_window_new (
+        override ? GTK_WINDOW_POPUP : GTK_WINDOW_TOPLEVEL);
       g_hash_table_insert (windows, g_strdup (argv[1]), window);
 
       if (csd)
@@ -135,12 +136,12 @@ process_line (const char *line)
            * destroying it, we force initialization at a more predictable time.
            */
           GdkWindow *window_gdk = gtk_widget_get_window (window);
-          cairo_surface_t *surface = gdk_window_create_similar_surface (window_gdk,
-                                                                        CAIRO_CONTENT_COLOR,
-                                                                        1, 1);
+          cairo_surface_t *surface = gdk_window_create_similar_surface (
+            window_gdk,
+            CAIRO_CONTENT_COLOR,
+            1, 1);
           cairo_surface_destroy (surface);
         }
-
     }
   else if (strcmp (argv[0], "set_parent") == 0)
     {
@@ -342,12 +343,13 @@ process_line (const char *line)
           goto out;
         }
 
-      counter = strtoul(argv[1], NULL, 10);
-      value = atoi(argv[2]);
+      counter = strtoul (argv[1], NULL, 10);
+      value = atoi (argv[2]);
       XSyncValue sync_value;
       XSyncIntToValue (&sync_value, value);
 
-      XSyncSetCounter (gdk_x11_display_get_xdisplay (gdk_display_get_default ()),
+      XSyncSetCounter (gdk_x11_display_get_xdisplay (
+                         gdk_display_get_default ()),
                        counter, sync_value);
     }
   else if (strcmp (argv[0], "minimize") == 0)
@@ -386,7 +388,7 @@ process_line (const char *line)
 
   g_print ("OK\n");
 
- out:
+out:
   g_strfreev (argv);
 }
 
@@ -398,7 +400,8 @@ on_line_received (GObject      *source,
   GDataInputStream *in = G_DATA_INPUT_STREAM (source);
   GError *error = NULL;
   gsize length;
-  char *line = g_data_input_stream_read_line_finish_utf8 (in, result, &length, &error);
+  char *line = g_data_input_stream_read_line_finish_utf8 (in, result, &length,
+                                                          &error);
 
   if (line == NULL)
     {
@@ -420,7 +423,8 @@ read_next_line (GDataInputStream *in)
                                        on_line_received, NULL);
 }
 
-const GOptionEntry options[] = {
+const GOptionEntry options[] =
+{
   {
     "wayland", 0, 0, G_OPTION_ARG_NONE,
     &wayland,
diff --git a/src/tests/test-runner.c b/src/tests/test-runner.c
index f90d9f928..b6e0f01d8 100644
--- a/src/tests/test-runner.c
+++ b/src/tests/test-runner.c
@@ -34,7 +34,8 @@
 #include "wayland/meta-wayland.h"
 #include "x11/meta-x11-display-private.h"
 
-typedef struct {
+typedef struct
+{
   GHashTable *clients;
   AsyncWaiter *waiter;
   GString *warning_messages;
@@ -123,10 +124,10 @@ test_case_wait (TestCase *test,
 
 #define BAD_COMMAND(...)                                                \
   G_STMT_START {                                                        \
-      g_set_error (error,                                               \
-                   TEST_RUNNER_ERROR, TEST_RUNNER_ERROR_BAD_COMMAND,    \
-                   __VA_ARGS__);                                        \
-      return FALSE;                                                     \
+    g_set_error (error,                                               \
+                 TEST_RUNNER_ERROR, TEST_RUNNER_ERROR_BAD_COMMAND,    \
+                 __VA_ARGS__);                                        \
+    return FALSE;                                                     \
   } G_STMT_END
 
 static TestClient *
@@ -152,7 +153,8 @@ test_case_parse_window_id (TestCase    *test,
   const char *slash = strchr (client_and_window_id, '/');
   char *tmp;
   if (slash == NULL)
-    BAD_COMMAND ("client/window ID %s doesnt' contain a /", client_and_window_id);
+    BAD_COMMAND ("client/window ID %s doesnt' contain a /",
+                 client_and_window_id);
 
   *window_id = slash + 1;
 
@@ -182,7 +184,8 @@ test_case_assert_stacking (TestCase *test,
       MetaWindow *window = meta_display_lookup_stack_id (display, windows[i]);
       if (window != NULL && window->title)
         {
-          /* See comment in meta_ui_new() about why the dummy window for GTK+ theming
+          /* See comment in meta_ui_new() about why the dummy window for GTK+
+           * theming
            * is managed as a MetaWindow.
            */
           if (META_STACK_ID_IS_X11 (windows[i]) &&
@@ -257,7 +260,7 @@ test_case_check_xserver_stacking (TestCase *test,
           if (local_string->len > 0)
             g_string_append_c (local_string, ' ');
 
-          g_string_append_printf (local_string, "%#lx", (Window)windows[i]);
+          g_string_append_printf (local_string, "%#lx", (Window) windows[i]);
         }
     }
 
@@ -269,12 +272,12 @@ test_case_check_xserver_stacking (TestCase *test,
               display->x11_display->xroot,
               &root, &parent, &children, &n_children);
 
-  for (i = 0; i < (int)n_children; i++)
+  for (i = 0; i < (int) n_children; i++)
     {
       if (x11_string->len > 0)
         g_string_append_c (x11_string, ' ');
 
-      g_string_append_printf (x11_string, "%#lx", (Window)children[i]);
+      g_string_append_printf (x11_string, "%#lx", (Window) children[i]);
     }
 
   if (strcmp (x11_string->str, local_string->str) != 0)
@@ -335,17 +338,17 @@ test_case_do (TestCase *test,
       TestClient *client;
 
       if (argc != 3)
-        BAD_COMMAND("usage: new_client <client-id> [wayland|x11]");
+        BAD_COMMAND ("usage: new_client <client-id> [wayland|x11]");
 
       if (strcmp (argv[2], "x11") == 0)
         type = META_WINDOW_CLIENT_TYPE_X11;
       else if (strcmp (argv[2], "wayland") == 0)
         type = META_WINDOW_CLIENT_TYPE_WAYLAND;
       else
-        BAD_COMMAND("usage: new_client <client-id> [wayland|x11]");
+        BAD_COMMAND ("usage: new_client <client-id> [wayland|x11]");
 
       if (g_hash_table_lookup (test->clients, argv[1]))
-        BAD_COMMAND("client %s already exists", argv[1]);
+        BAD_COMMAND ("client %s already exists", argv[1]);
 
       client = test_client_new (argv[1], type, error);
       if (!client)
@@ -356,7 +359,7 @@ test_case_do (TestCase *test,
   else if (strcmp (argv[0], "quit_client") == 0)
     {
       if (argc != 2)
-        BAD_COMMAND("usage: quit_client <client-id>");
+        BAD_COMMAND ("usage: quit_client <client-id>");
 
       TestClient *client = test_case_lookup_client (test, argv[1], error);
       if (!client)
@@ -373,11 +376,13 @@ test_case_do (TestCase *test,
       if (!(argc == 2 ||
             (argc == 3 && strcmp (argv[2], "override") == 0) ||
             (argc == 3 && strcmp (argv[2], "csd") == 0)))
-        BAD_COMMAND("usage: %s <client-id>/<window-id > [override|csd]", argv[0]);
+        BAD_COMMAND ("usage: %s <client-id>/<window-id > [override|csd]",
+                     argv[0]);
 
       TestClient *client;
       const char *window_id;
-      if (!test_case_parse_window_id (test, argv[1], &client, &window_id, error))
+      if (!test_case_parse_window_id (test, argv[1], &client, &window_id,
+                                      error))
         return FALSE;
 
       if (!test_client_do (client, error,
@@ -390,12 +395,13 @@ test_case_do (TestCase *test,
            strcmp (argv[0], "set_parent_exported") == 0)
     {
       if (argc != 3)
-        BAD_COMMAND("usage: %s <client-id>/<window-id> <parent-window-id>",
-                    argv[0]);
+        BAD_COMMAND ("usage: %s <client-id>/<window-id> <parent-window-id>",
+                     argv[0]);
 
       TestClient *client;
       const char *window_id;
-      if (!test_case_parse_window_id (test, argv[1], &client, &window_id, error))
+      if (!test_case_parse_window_id (test, argv[1], &client, &window_id,
+                                      error))
         return FALSE;
 
       if (!test_client_do (client, error,
@@ -407,11 +413,12 @@ test_case_do (TestCase *test,
   else if (strcmp (argv[0], "show") == 0)
     {
       if (argc != 2)
-        BAD_COMMAND("usage: %s <client-id>/<window-id>", argv[0]);
+        BAD_COMMAND ("usage: %s <client-id>/<window-id>", argv[0]);
 
       TestClient *client;
       const char *window_id;
-      if (!test_case_parse_window_id (test, argv[1], &client, &window_id, error))
+      if (!test_case_parse_window_id (test, argv[1], &client, &window_id,
+                                      error))
         return FALSE;
 
       if (!test_client_do (client, error, argv[0], window_id, NULL))
@@ -421,7 +428,8 @@ test_case_do (TestCase *test,
       if (!window)
         return FALSE;
 
-      WaitForShownData data = {
+      WaitForShownData data =
+      {
         .loop = g_main_loop_new (NULL, FALSE),
         .window = window,
       };
@@ -443,11 +451,12 @@ test_case_do (TestCase *test,
            strcmp (argv[0], "destroy") == 0)
     {
       if (argc != 2)
-        BAD_COMMAND("usage: %s <client-id>/<window-id>", argv[0]);
+        BAD_COMMAND ("usage: %s <client-id>/<window-id>", argv[0]);
 
       TestClient *client;
       const char *window_id;
-      if (!test_case_parse_window_id (test, argv[1], &client, &window_id, error))
+      if (!test_case_parse_window_id (test, argv[1], &client, &window_id,
+                                      error))
         return FALSE;
 
       if (!test_client_do (client, error, argv[0], window_id, NULL))
@@ -456,11 +465,12 @@ test_case_do (TestCase *test,
   else if (strcmp (argv[0], "local_activate") == 0)
     {
       if (argc != 2)
-        BAD_COMMAND("usage: %s <client-id>/<window-id>", argv[0]);
+        BAD_COMMAND ("usage: %s <client-id>/<window-id>", argv[0]);
 
       TestClient *client;
       const char *window_id;
-      if (!test_case_parse_window_id (test, argv[1], &client, &window_id, error))
+      if (!test_case_parse_window_id (test, argv[1], &client, &window_id,
+                                      error))
         return FALSE;
 
       MetaWindow *window = test_client_find_window (client, window_id, error);
@@ -472,7 +482,7 @@ test_case_do (TestCase *test,
   else if (strcmp (argv[0], "wait") == 0)
     {
       if (argc != 1)
-        BAD_COMMAND("usage: %s", argv[0]);
+        BAD_COMMAND ("usage: %s", argv[0]);
 
       if (!test_case_wait (test, error))
         return FALSE;
@@ -487,7 +497,7 @@ test_case_do (TestCase *test,
     }
   else
     {
-      BAD_COMMAND("Unknown command %s", argv[0]);
+      BAD_COMMAND ("Unknown command %s", argv[0]);
     }
 
   return TRUE;
@@ -509,7 +519,6 @@ test_case_destroy (TestCase *test,
     {
       if (!test_client_do (value, error, "destroy_all", NULL))
         return FALSE;
-
     }
 
   if (!test_case_wait (test, error))
@@ -567,7 +576,8 @@ run_test (const char *filename,
       char **argv = NULL;
       if (!g_shell_parse_argv (line, &argc, &argv, &error))
         {
-          if (g_error_matches (error, G_SHELL_ERROR, G_SHELL_ERROR_EMPTY_STRING))
+          if (g_error_matches (error, G_SHELL_ERROR,
+                               G_SHELL_ERROR_EMPTY_STRING))
             {
               g_clear_error (&error);
               goto next;
@@ -578,7 +588,7 @@ run_test (const char *filename,
 
       test_case_do (test, argc, argv, &error);
 
-    next:
+next:
       if (error)
         g_prefix_error (&error, "%d: ", line_no);
 
@@ -597,7 +607,7 @@ run_test (const char *filename,
       }
   }
 
- out:
+out:
   if (in != NULL)
     g_object_unref (in);
 
@@ -607,7 +617,7 @@ run_test (const char *filename,
   const char *testspos = strstr (filename, "tests/");
   char *pretty_name;
   if (testspos)
-    pretty_name = g_strdup (testspos + strlen("tests/"));
+    pretty_name = g_strdup (testspos + strlen ("tests/"));
   else
     pretty_name = g_strdup (filename);
 
@@ -640,7 +650,8 @@ run_test (const char *filename,
   return success;
 }
 
-typedef struct {
+typedef struct
+{
   int n_tests;
   char **tests;
 } RunTestsInfo;
@@ -687,12 +698,12 @@ find_metatests_in_directory (GFile     *directory,
       switch (g_file_info_get_file_type (info))
         {
         case G_FILE_TYPE_REGULAR:
-          {
-            const char *name = g_file_info_get_name (info);
-            if (g_str_has_suffix (name, ".metatest"))
-              g_ptr_array_add (results, g_file_get_path (child));
-            break;
-          }
+        {
+          const char *name = g_file_info_get_name (info);
+          if (g_str_has_suffix (name, ".metatest"))
+            g_ptr_array_add (results, g_file_get_path (child));
+          break;
+        }
         case G_FILE_TYPE_DIRECTORY:
           find_metatests_in_directory (child, results, error);
           break;
@@ -721,7 +732,8 @@ find_metatests_in_directory (GFile     *directory,
 
 static gboolean all_tests = FALSE;
 
-const GOptionEntry options[] = {
+const GOptionEntry options[] =
+{
   {
     "all", 0, 0, G_OPTION_ARG_NONE,
     &all_tests,
@@ -783,7 +795,7 @@ main (int argc, char **argv)
 
   /* Then initalize mutter with a different set of arguments */
 
-  char *fake_args[] = { NULL, (char *)"--wayland", (char *)"--nested" };
+  char *fake_args[] = { NULL, (char *) "--wayland", (char *) "--nested" };
   fake_args[0] = argv[0];
   char **fake_argv = fake_args;
   int fake_argc = G_N_ELEMENTS (fake_args);
@@ -802,7 +814,7 @@ main (int argc, char **argv)
   meta_register_with_session ();
 
   RunTestsInfo info;
-  info.tests = (char **)tests->pdata;
+  info.tests = (char **) tests->pdata;
   info.n_tests = tests->len;
 
   g_idle_add (run_tests, &info);
diff --git a/src/tests/test-utils.c b/src/tests/test-utils.c
index 980b20acd..db484a39c 100644
--- a/src/tests/test-utils.c
+++ b/src/tests/test-utils.c
@@ -30,7 +30,8 @@
 #include "wayland/meta-xwayland.h"
 #include "x11/meta-x11-display-private.h"
 
-struct _TestClient {
+struct _TestClient
+{
   char *id;
   MetaWindowClientType type;
   GSubprocess *subprocess;
@@ -45,7 +46,8 @@ struct _TestClient {
   AsyncWaiter *waiter;
 };
 
-struct _AsyncWaiter {
+struct _AsyncWaiter
+{
   XSyncCounter counter;
   int counter_value;
   XSyncAlarm alarm;
@@ -54,7 +56,7 @@ struct _AsyncWaiter {
   int counter_wait_value;
 };
 
-G_DEFINE_QUARK (test-runner-error-quark, test_runner_error)
+G_DEFINE_QUARK (test - runner - error - quark, test_runner_error)
 
 static char *test_client_path;
 
@@ -285,7 +287,7 @@ test_client_do (TestClient *client,
       goto out;
     }
 
- out:
+out:
   g_string_free (command, TRUE);
   g_free (line);
 
@@ -384,8 +386,8 @@ test_client_new (const char          *id,
   const char *wayland_display_name;
   const char *x11_display_name;
 
-  launcher =  g_subprocess_launcher_new ((G_SUBPROCESS_FLAGS_STDIN_PIPE |
-                                          G_SUBPROCESS_FLAGS_STDOUT_PIPE));
+  launcher = g_subprocess_launcher_new ((G_SUBPROCESS_FLAGS_STDIN_PIPE |
+                                         G_SUBPROCESS_FLAGS_STDOUT_PIPE));
 
   g_assert (meta_is_wayland_compositor ());
   compositor = meta_wayland_compositor_get_default ();
@@ -404,7 +406,8 @@ test_client_new (const char          *id,
                                             test_client_path,
                                             "--client-id",
                                             id,
-                                            (type == META_WINDOW_CLIENT_TYPE_WAYLAND ?
+                                            (type ==
+                                             META_WINDOW_CLIENT_TYPE_WAYLAND ?
                                              "--wayland" : NULL),
                                             NULL);
   g_object_unref (launcher);
diff --git a/src/tests/unit-tests.c b/src/tests/unit-tests.c
index 103d68b2e..a16fca5b9 100644
--- a/src/tests/unit-tests.c
+++ b/src/tests/unit-tests.c
@@ -188,7 +188,8 @@ static void
 meta_test_adjecent_to (void)
 {
   MetaRectangle base = { .x = 10, .y = 10, .width = 10, .height = 10 };
-  MetaRectangle adjecent[] = {
+  MetaRectangle adjecent[] =
+  {
     { .x = 20, .y = 10, .width = 10, .height = 10 },
     { .x = 0, .y = 10, .width = 10, .height = 10 },
     { .x = 0, .y = 1, .width = 10, .height = 10 },
@@ -196,7 +197,8 @@ meta_test_adjecent_to (void)
     { .x = 10, .y = 20, .width = 10, .height = 10 },
     { .x = 10, .y = 0, .width = 10, .height = 10 },
   };
-  MetaRectangle not_adjecent[] = {
+  MetaRectangle not_adjecent[] =
+  {
     { .x = 0, .y = 0, .width = 10, .height = 10 },
     { .x = 20, .y = 20, .width = 10, .height = 10 },
     { .x = 21, .y = 10, .width = 10, .height = 10 },
diff --git a/src/ui/frames.c b/src/ui/frames.c
index 8743db91e..a2ed3b1b3 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -41,17 +41,17 @@
 
 #define DEFAULT_INNER_BUTTON_BORDER 3
 
-static void meta_frames_destroy       (GtkWidget       *object);
-static void meta_frames_finalize      (GObject         *object);
-static void meta_frames_style_updated (GtkWidget       *widget);
+static void meta_frames_destroy (GtkWidget *object);
+static void meta_frames_finalize (GObject *object);
+static void meta_frames_style_updated (GtkWidget *widget);
 
-static gboolean meta_frames_draw                  (GtkWidget           *widget,
-                                                   cairo_t             *cr);
+static gboolean meta_frames_draw (GtkWidget *widget,
+                                  cairo_t   *cr);
 
 static void meta_ui_frame_attach_style (MetaUIFrame *frame);
 
-static void meta_ui_frame_paint        (MetaUIFrame  *frame,
-                                        cairo_t      *cr);
+static void meta_ui_frame_paint (MetaUIFrame *frame,
+                                 cairo_t     *cr);
 
 static void meta_ui_frame_calc_geometry (MetaUIFrame       *frame,
                                          MetaFrameGeometry *fgeom);
@@ -59,19 +59,20 @@ static void meta_ui_frame_calc_geometry (MetaUIFrame       *frame,
 static void meta_ui_frame_update_prelit_control (MetaUIFrame     *frame,
                                                  MetaFrameControl control);
 
-static void meta_frames_font_changed          (MetaFrames *frames);
+static void meta_frames_font_changed (MetaFrames *frames);
 static void meta_frames_button_layout_changed (MetaFrames *frames);
 
 
-static GdkRectangle*    control_rect (MetaFrameControl   control,
-                                      MetaFrameGeometry *fgeom);
-static MetaFrameControl get_control  (MetaUIFrame       *frame,
-                                      int                x,
-                                      int                y);
+static GdkRectangle *control_rect (MetaFrameControl   control,
+                                   MetaFrameGeometry *fgeom);
+static MetaFrameControl get_control (MetaUIFrame *frame,
+                                     int          x,
+                                     int          y);
 
 G_DEFINE_TYPE (MetaFrames, meta_frames, GTK_TYPE_WINDOW);
 
-enum {
+enum
+{
   META_ACTION_CLICK,
   META_ACTION_RIGHT_CLICK,
   META_ACTION_MIDDLE_CLICK,
@@ -100,11 +101,11 @@ meta_frames_constructor (GType                  gtype,
 static void
 meta_frames_class_init (MetaFramesClass *class)
 {
-  GObjectClass   *gobject_class;
+  GObjectClass *gobject_class;
   GtkWidgetClass *widget_class;
 
   gobject_class = G_OBJECT_CLASS (class);
-  widget_class = (GtkWidgetClass*) class;
+  widget_class = (GtkWidgetClass *) class;
 
   gobject_class->constructor = meta_frames_constructor;
   gobject_class->finalize = meta_frames_finalize;
@@ -120,13 +121,13 @@ static gint
 unsigned_long_equal (gconstpointer v1,
                      gconstpointer v2)
 {
-  return *((const gulong*) v1) == *((const gulong*) v2);
+  return *((const gulong *) v1) == *((const gulong *) v2);
 }
 
 static guint
 unsigned_long_hash (gconstpointer v)
 {
-  gulong val = * (const gulong *) v;
+  gulong val = *(const gulong *) v;
 
   /* I'm not sure this works so well. */
 #if GLIB_SIZEOF_LONG > 4
@@ -168,8 +169,12 @@ meta_frames_get_theme_variant (MetaFrames  *frames,
   style_info = g_hash_table_lookup (frames->style_variants, variant);
   if (style_info == NULL)
     {
-      style_info = meta_theme_create_style_info (gtk_widget_get_screen (GTK_WIDGET (frames)), variant);
-      g_hash_table_insert (frames->style_variants, g_strdup (variant), style_info);
+      style_info =
+        meta_theme_create_style_info (gtk_widget_get_screen (GTK_WIDGET (
+                                                               frames)),
+                                      variant);
+      g_hash_table_insert (frames->style_variants, g_strdup (
+                             variant), style_info);
     }
 
   return style_info;
@@ -191,7 +196,8 @@ update_style_contexts (MetaFrames *frames)
   variants = g_hash_table_get_keys (frames->style_variants);
   for (variant = variants; variant; variant = variant->next)
     {
-      style_info = meta_theme_create_style_info (screen, (char *)variant->data);
+      style_info =
+        meta_theme_create_style_info (screen, (char *) variant->data);
       g_hash_table_insert (frames->style_variants,
                            g_strdup (variant->data), style_info);
     }
@@ -206,7 +212,8 @@ meta_frames_init (MetaFrames *frames)
   frames->frames = g_hash_table_new (unsigned_long_hash, unsigned_long_equal);
 
   frames->style_variants = g_hash_table_new_full (g_str_hash, g_str_equal,
-                                                  g_free, (GDestroyNotify)meta_style_info_unref);
+                                                  g_free,
+                                                  (GDestroyNotify) meta_style_info_unref);
 
   update_style_contexts (frames);
 
@@ -280,7 +287,8 @@ queue_recalc_func (gpointer key, gpointer value, gpointer data)
   MetaUIFrame *frame = value;
 
   invalidate_whole_window (frame);
-  meta_core_queue_frame_resize (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
+  meta_core_queue_frame_resize (GDK_DISPLAY_XDISPLAY (
+                                  gdk_display_get_default ()),
                                 frame->xwindow);
 
   g_clear_object (&frame->text_layout);
@@ -298,7 +306,6 @@ meta_frames_font_changed (MetaFrames *frames)
   /* Queue a draw/resize on all frames */
   g_hash_table_foreach (frames->frames,
                         queue_recalc_func, frames);
-
 }
 
 static void
@@ -341,8 +348,8 @@ meta_frames_style_updated  (GtkWidget *widget)
 }
 
 static void
-meta_ui_frame_ensure_layout (MetaUIFrame    *frame,
-                             MetaFrameType   type)
+meta_ui_frame_ensure_layout (MetaUIFrame  *frame,
+                             MetaFrameType type)
 {
   MetaFrames *frames = frame->frames;
   GtkWidget *widget;
@@ -365,7 +372,8 @@ meta_ui_frame_ensure_layout (MetaUIFrame    *frame,
       PangoFontDescription *font_desc;
       int size;
 
-      frame->text_layout = gtk_widget_create_pango_layout (widget, frame->title);
+      frame->text_layout =
+        gtk_widget_create_pango_layout (widget, frame->title);
 
       pango_layout_set_ellipsize (frame->text_layout, PANGO_ELLIPSIZE_END);
       pango_layout_set_auto_dir (frame->text_layout, FALSE);
@@ -386,7 +394,8 @@ meta_ui_frame_ensure_layout (MetaUIFrame    *frame,
         {
           frame->text_height =
             meta_pango_font_desc_get_text_height (font_desc,
-                                                  gtk_widget_get_pango_context (widget));
+                                                  gtk_widget_get_pango_context (
+                                                    widget));
 
           g_hash_table_replace (frames->text_heights,
                                 GINT_TO_POINTER (size),
@@ -428,7 +437,7 @@ meta_ui_frame_calc_geometry (MetaUIFrame       *frame,
                             fgeom);
 }
 
-MetaFrames*
+MetaFrames *
 meta_frames_new (void)
 {
   MetaFrames *frames;
@@ -483,13 +492,15 @@ meta_ui_frame_attach_style (MetaUIFrame *frame)
 
   variant = frame->meta_window->gtk_theme_variant;
   if (variant == NULL)
-    variant = get_global_theme_variant (frame->frames);;
+    variant = get_global_theme_variant (frame->frames);
+  ;
 
   if (variant == NULL || *variant == '\0')
     frame->style_info = meta_style_info_ref (frames->normal_style);
   else
-    frame->style_info = meta_style_info_ref (meta_frames_get_theme_variant (frames,
-                                                                            variant));
+    frame->style_info =
+      meta_style_info_ref (meta_frames_get_theme_variant (frames,
+                                                          variant));
 }
 
 MetaUIFrame *
@@ -522,7 +533,8 @@ meta_frames_manage_window (MetaFrames *frames,
   frame->prelit_control = META_FRAME_CONTROL_NONE;
   frame->button_state = META_BUTTON_STATE_NORMAL;
 
-  meta_core_grab_buttons (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow);
+  meta_core_grab_buttons (GDK_DISPLAY_XDISPLAY (
+                            gdk_display_get_default ()), frame->xwindow);
 
   g_hash_table_replace (frames->frames, &frame->xwindow, frame);
 
@@ -535,7 +547,8 @@ meta_ui_frame_unmanage (MetaUIFrame *frame)
   MetaFrames *frames = frame->frames;
 
   /* restore the cursor */
-  meta_core_set_screen_cursor (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
+  meta_core_set_screen_cursor (GDK_DISPLAY_XDISPLAY (
+                                 gdk_display_get_default ()),
                                frame->xwindow,
                                META_CURSOR_DEFAULT);
 
@@ -556,7 +569,7 @@ meta_ui_frame_unmanage (MetaUIFrame *frame)
 }
 
 void
-meta_ui_frame_get_borders (MetaUIFrame *frame,
+meta_ui_frame_get_borders (MetaUIFrame      *frame,
                            MetaFrameBorders *borders)
 {
   MetaFrameFlags flags;
@@ -614,9 +627,12 @@ get_visible_region (MetaUIFrame       *frame,
       const float radius = corner;
       int i;
 
-      for (i=0; i<corner; i++)
+      for (i = 0; i < corner; i++)
         {
-          const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
+          const int width =
+            floor (0.5 + radius -
+                   sqrt (radius * radius - (radius - (i + 0.5)) *
+                         (radius - (i + 0.5))));
           rect.x = frame_rect.x;
           rect.y = frame_rect.y + i;
           rect.width = width;
@@ -632,9 +648,12 @@ get_visible_region (MetaUIFrame       *frame,
       const float radius = corner;
       int i;
 
-      for (i=0; i<corner; i++)
+      for (i = 0; i < corner; i++)
         {
-          const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
+          const int width =
+            floor (0.5 + radius -
+                   sqrt (radius * radius - (radius - (i + 0.5)) *
+                         (radius - (i + 0.5))));
           rect.x = frame_rect.x + frame_rect.width - width;
           rect.y = frame_rect.y + i;
           rect.width = width;
@@ -650,9 +669,12 @@ get_visible_region (MetaUIFrame       *frame,
       const float radius = corner;
       int i;
 
-      for (i=0; i<corner; i++)
+      for (i = 0; i < corner; i++)
         {
-          const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
+          const int width =
+            floor (0.5 + radius -
+                   sqrt (radius * radius - (radius - (i + 0.5)) *
+                         (radius - (i + 0.5))));
           rect.x = frame_rect.x;
           rect.y = frame_rect.y + frame_rect.height - i - 1;
           rect.width = width;
@@ -668,9 +690,12 @@ get_visible_region (MetaUIFrame       *frame,
       const float radius = corner;
       int i;
 
-      for (i=0; i<corner; i++)
+      for (i = 0; i < corner; i++)
         {
-          const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
+          const int width =
+            floor (0.5 + radius -
+                   sqrt (radius * radius - (radius - (i + 0.5)) *
+                         (radius - (i + 0.5))));
           rect.x = frame_rect.x + frame_rect.width - width;
           rect.y = frame_rect.y + frame_rect.height - i - 1;
           rect.width = width;
@@ -718,7 +743,7 @@ meta_ui_frame_queue_draw (MetaUIFrame *frame)
 
 void
 meta_ui_frame_set_title (MetaUIFrame *frame,
-                         const char *title)
+                         const char  *title)
 {
   g_free (frame->title);
   frame->title = g_strdup (title);
@@ -736,7 +761,7 @@ meta_ui_frame_update_style (MetaUIFrame *frame)
 }
 
 static void
-redraw_control (MetaUIFrame *frame,
+redraw_control (MetaUIFrame     *frame,
                 MetaFrameControl control)
 {
   MetaFrameGeometry fgeom;
@@ -772,50 +797,50 @@ meta_frame_titlebar_event (MetaUIFrame        *frame,
   switch (action)
     {
     case G_DESKTOP_TITLEBAR_ACTION_TOGGLE_SHADE:
-      {
-        if (flags & META_FRAME_ALLOWS_SHADE)
-          {
-            if (flags & META_FRAME_SHADED)
-              meta_window_unshade (frame->meta_window, evtime);
-            else
-              meta_window_shade (frame->meta_window, evtime);
-          }
-      }
-      break;
+    {
+      if (flags & META_FRAME_ALLOWS_SHADE)
+        {
+          if (flags & META_FRAME_SHADED)
+            meta_window_unshade (frame->meta_window, evtime);
+          else
+            meta_window_shade (frame->meta_window, evtime);
+        }
+    }
+    break;
 
     case G_DESKTOP_TITLEBAR_ACTION_TOGGLE_MAXIMIZE:
-      {
-        if (flags & META_FRAME_ALLOWS_MAXIMIZE)
-          {
-            meta_core_toggle_maximize (display, frame->xwindow);
-          }
-      }
-      break;
+    {
+      if (flags & META_FRAME_ALLOWS_MAXIMIZE)
+        {
+          meta_core_toggle_maximize (display, frame->xwindow);
+        }
+    }
+    break;
 
     case G_DESKTOP_TITLEBAR_ACTION_TOGGLE_MAXIMIZE_HORIZONTALLY:
-      {
-        if (flags & META_FRAME_ALLOWS_MAXIMIZE)
-          {
-            meta_core_toggle_maximize_horizontally (display, frame->xwindow);
-          }
-      }
-      break;
+    {
+      if (flags & META_FRAME_ALLOWS_MAXIMIZE)
+        {
+          meta_core_toggle_maximize_horizontally (display, frame->xwindow);
+        }
+    }
+    break;
 
     case G_DESKTOP_TITLEBAR_ACTION_TOGGLE_MAXIMIZE_VERTICALLY:
-      {
-        if (flags & META_FRAME_ALLOWS_MAXIMIZE)
-          {
-            meta_core_toggle_maximize_vertically (display, frame->xwindow);
-          }
-      }
-      break;
+    {
+      if (flags & META_FRAME_ALLOWS_MAXIMIZE)
+        {
+          meta_core_toggle_maximize_vertically (display, frame->xwindow);
+        }
+    }
+    break;
 
     case G_DESKTOP_TITLEBAR_ACTION_MINIMIZE:
-      {
-        if (flags & META_FRAME_ALLOWS_MINIMIZE)
-          meta_window_minimize (frame->meta_window);
-      }
-      break;
+    {
+      if (flags & META_FRAME_ALLOWS_MINIMIZE)
+        meta_window_minimize (frame->meta_window);
+    }
+    break;
 
     case G_DESKTOP_TITLEBAR_ACTION_NONE:
       /* Yaay, a sane user that doesn't use that other weird crap! */
@@ -848,20 +873,20 @@ meta_frame_double_click_event (MetaUIFrame        *frame,
 }
 
 static gboolean
-meta_frame_middle_click_event (MetaUIFrame *frame,
+meta_frame_middle_click_event (MetaUIFrame        *frame,
                                ClutterButtonEvent *event)
 {
-  int action = meta_prefs_get_action_middle_click_titlebar();
+  int action = meta_prefs_get_action_middle_click_titlebar ();
 
   return meta_frame_titlebar_event (frame, (const ClutterEvent *) event,
                                     action);
 }
 
 static gboolean
-meta_frame_right_click_event (MetaUIFrame *frame,
+meta_frame_right_click_event (MetaUIFrame        *frame,
                               ClutterButtonEvent *event)
 {
-  int action = meta_prefs_get_action_right_click_titlebar();
+  int action = meta_prefs_get_action_right_click_titlebar ();
 
   return meta_frame_titlebar_event (frame, (const ClutterEvent *) event,
                                     action);
@@ -978,7 +1003,8 @@ get_action (const ClutterEvent *event)
         default:
           meta_verbose ("No action triggered for button %u %s\n",
                         event->button.button,
-                        (event->type == CLUTTER_BUTTON_PRESS) ? "press" : "release");
+                        (event->type ==
+                         CLUTTER_BUTTON_PRESS) ? "press" : "release");
         }
     }
   else if (event->type == CLUTTER_TOUCH_BEGIN ||
@@ -1052,7 +1078,7 @@ meta_frame_left_click_event (MetaUIFrame        *frame,
           root_rect.height = rect->height;
 
           menu = control == META_FRAME_CONTROL_MENU ? META_WINDOW_MENU_WM
-            : META_WINDOW_MENU_APP;
+                 : META_WINDOW_MENU_APP;
 
           /* if the compositor takes a grab for showing the menu, we will
            * get a LeaveNotify event we want to ignore, to keep the pressed
@@ -1086,16 +1112,16 @@ meta_frame_left_click_event (MetaUIFrame        *frame,
 
       return TRUE;
     case META_FRAME_CONTROL_TITLE:
-      {
-        MetaFrameFlags flags = meta_frame_get_flags (frame->meta_window->frame);
+    {
+      MetaFrameFlags flags = meta_frame_get_flags (frame->meta_window->frame);
 
-        if (flags & META_FRAME_ALLOWS_MOVE)
-          {
-            meta_frames_try_grab_op (frame,
-                                     META_GRAB_OP_MOVING,
-                                     x, y, evtime);
-          }
-      }
+      if (flags & META_FRAME_ALLOWS_MOVE)
+        {
+          meta_frames_try_grab_op (frame,
+                                   META_GRAB_OP_MOVING,
+                                   x, y, evtime);
+        }
+    }
 
       return TRUE;
     case META_FRAME_CONTROL_NONE:
@@ -1164,7 +1190,8 @@ handle_press_event (MetaUIFrame        *frame,
     case META_ACTION_CLICK:
       return meta_frame_left_click_event (frame, event);
     case META_ACTION_MIDDLE_CLICK:
-      return meta_frame_middle_click_event (frame, (ClutterButtonEvent *) event);
+      return meta_frame_middle_click_event (frame,
+                                            (ClutterButtonEvent *) event);
     case META_ACTION_RIGHT_CLICK:
       return meta_frame_right_click_event (frame, (ClutterButtonEvent *) event);
     default:
@@ -1292,7 +1319,8 @@ meta_ui_frame_update_prelit_control (MetaUIFrame     *frame,
     }
 
   /* set/unset the prelight cursor */
-  meta_core_set_screen_cursor (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
+  meta_core_set_screen_cursor (GDK_DISPLAY_XDISPLAY (
+                                 gdk_display_get_default ()),
                                frame->xwindow,
                                cursor);
 
@@ -1443,17 +1471,20 @@ meta_ui_frame_get_mask (MetaUIFrame *frame,
   meta_style_info_set_flags (frame->style_info, flags);
   meta_ui_frame_get_borders (frame, &borders);
 
-  /* See comment in meta_frame_layout_draw_with_style() for details on HiDPI handling */
+  /* See comment in meta_frame_layout_draw_with_style() for details on HiDPI
+   * handling */
   scale = meta_theme_get_window_scaling_factor ();
   surface = cairo_get_target (cr);
   cairo_surface_get_device_scale (surface, &xscale, &yscale);
   cairo_surface_set_device_scale (surface, scale, scale);
 
-  gtk_render_background (frame->style_info->styles[META_STYLE_ELEMENT_FRAME], cr,
+  gtk_render_background (frame->style_info->styles[META_STYLE_ELEMENT_FRAME],
+                         cr,
                          borders.invisible.left / scale,
                          borders.invisible.top / scale,
                          frame_rect.width / scale, frame_rect.height / scale);
-  gtk_render_background (frame->style_info->styles[META_STYLE_ELEMENT_TITLEBAR], cr,
+  gtk_render_background (frame->style_info->styles[META_STYLE_ELEMENT_TITLEBAR],
+                         cr,
                          borders.invisible.left / scale,
                          borders.invisible.top / scale,
                          frame_rect.width / scale, borders.total.top / scale);
@@ -1510,8 +1541,8 @@ meta_frames_draw (GtkWidget *widget,
 }
 
 static void
-meta_ui_frame_paint (MetaUIFrame  *frame,
-                     cairo_t      *cr)
+meta_ui_frame_paint (MetaUIFrame *frame,
+                     cairo_t     *cr)
 {
   MetaFrameFlags flags;
   MetaFrameType type;
@@ -1577,7 +1608,7 @@ meta_ui_frame_paint (MetaUIFrame  *frame,
 }
 
 static gboolean
-handle_enter_notify_event (MetaUIFrame *frame,
+handle_enter_notify_event (MetaUIFrame          *frame,
                            ClutterCrossingEvent *event)
 {
   MetaFrameControl control;
@@ -1591,7 +1622,7 @@ handle_enter_notify_event (MetaUIFrame *frame,
 }
 
 static gboolean
-handle_leave_notify_event (MetaUIFrame *frame,
+handle_leave_notify_event (MetaUIFrame          *frame,
                            ClutterCrossingEvent *event)
 {
   Display *display;
@@ -1615,7 +1646,7 @@ handle_leave_notify_event (MetaUIFrame *frame,
 }
 
 gboolean
-meta_ui_frame_handle_event (MetaUIFrame *frame,
+meta_ui_frame_handle_event (MetaUIFrame        *frame,
                             const ClutterEvent *event)
 {
   if (event->type == CLUTTER_TOUCH_BEGIN ||
@@ -1672,8 +1703,8 @@ meta_ui_frame_handle_event (MetaUIFrame *frame,
     }
 }
 
-static GdkRectangle*
-control_rect (MetaFrameControl control,
+static GdkRectangle *
+control_rect (MetaFrameControl   control,
               MetaFrameGeometry *fgeom)
 {
   GdkRectangle *rect;
@@ -1801,7 +1832,8 @@ get_control (MetaUIFrame *frame, int root_x, int root_y)
       else if (has_horiz)
         return META_FRAME_CONTROL_RESIZE_E;
     }
-  else if (y >= (fgeom.height - fgeom.borders.total.bottom * CORNER_SIZE_MULT) &&
+  else if (y >=
+           (fgeom.height - fgeom.borders.total.bottom * CORNER_SIZE_MULT) &&
            x <= fgeom.borders.total.left * CORNER_SIZE_MULT)
     {
       if (has_vert && has_horiz)
@@ -1812,7 +1844,8 @@ get_control (MetaUIFrame *frame, int root_x, int root_y)
         return META_FRAME_CONTROL_RESIZE_W;
     }
   else if (y < (fgeom.borders.invisible.top * CORNER_SIZE_MULT) &&
-           x <= (fgeom.borders.total.left * CORNER_SIZE_MULT) && has_north_resize)
+           x <= (fgeom.borders.total.left * CORNER_SIZE_MULT) &&
+           has_north_resize)
     {
       if (has_vert && has_horiz)
         return META_FRAME_CONTROL_RESIZE_NW;
@@ -1822,7 +1855,8 @@ get_control (MetaUIFrame *frame, int root_x, int root_y)
         return META_FRAME_CONTROL_RESIZE_W;
     }
   else if (y < (fgeom.borders.invisible.top * CORNER_SIZE_MULT) &&
-           x >= (fgeom.width - fgeom.borders.total.right * CORNER_SIZE_MULT) && has_north_resize)
+           x >= (fgeom.width - fgeom.borders.total.right * CORNER_SIZE_MULT) &&
+           has_north_resize)
     {
       if (has_vert && has_horiz)
         return META_FRAME_CONTROL_RESIZE_NE;
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 223bc04ae..fc3d4ea3a 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -83,18 +83,20 @@ meta_frame_layout_get_borders (const MetaFrameLayout *layout,
   if (!layout->has_title)
     text_height = 0;
   else
-    text_height = layout->title_margin.top + text_height + layout->title_margin.bottom;
+    text_height = layout->title_margin.top + text_height +
+                  layout->title_margin.bottom;
 
-  buttons_height = MAX ((int)layout->icon_size, layout->button_min_size.height) +
+  buttons_height =
+    MAX ((int) layout->icon_size, layout->button_min_size.height) +
     layout->button_margin.top + layout->button_border.top +
     layout->button_margin.bottom + layout->button_border.bottom;
   content_height = MAX (buttons_height, text_height);
   content_height = MAX (content_height, layout->titlebar_min_size.height) +
                    layout->titlebar_border.top + layout->titlebar_border.bottom;
 
-  borders->visible.top    = layout->frame_border.top + content_height;
-  borders->visible.left   = layout->frame_border.left;
-  borders->visible.right  = layout->frame_border.right;
+  borders->visible.top = layout->frame_border.top + content_height;
+  borders->visible.left = layout->frame_border.left;
+  borders->visible.right = layout->frame_border.right;
   borders->visible.bottom = layout->frame_border.bottom;
 
   borders->invisible = layout->invisible_border;
@@ -103,30 +105,36 @@ meta_frame_layout_get_borders (const MetaFrameLayout *layout,
 
   if (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE)
     {
-      borders->invisible.left   = MAX (borders->invisible.left,
-                                       draggable_borders - borders->visible.left);
-      borders->invisible.right  = MAX (borders->invisible.right,
-                                       draggable_borders - borders->visible.right);
+      borders->invisible.left = MAX (borders->invisible.left,
+                                     draggable_borders - borders->visible.left);
+      borders->invisible.right = MAX (borders->invisible.right,
+                                      draggable_borders -
+                                      borders->visible.right);
     }
 
   if (flags & META_FRAME_ALLOWS_VERTICAL_RESIZE)
     {
       borders->invisible.bottom = MAX (borders->invisible.bottom,
-                                       draggable_borders - borders->visible.bottom);
+                                       draggable_borders -
+                                       borders->visible.bottom);
 
-      /* borders.visible.top is the height of the *title bar*. We can't do the same
-       * algorithm here, titlebars are expectedly much bigger. Just subtract a couple
+      /* borders.visible.top is the height of the *title bar*. We can't do the
+       * same
+       * algorithm here, titlebars are expectedly much bigger. Just subtract a
+       *couple
        * pixels to get a proper feel. */
       if (type != META_FRAME_TYPE_ATTACHED)
-        borders->invisible.top    = MAX (borders->invisible.top, draggable_borders - 2);
+        borders->invisible.top = MAX (borders->invisible.top,
+                                      draggable_borders - 2);
     }
 
-  borders->total.left   = borders->invisible.left   + borders->visible.left;
-  borders->total.right  = borders->invisible.right  + borders->visible.right;
+  borders->total.left = borders->invisible.left + borders->visible.left;
+  borders->total.right = borders->invisible.right + borders->visible.right;
   borders->total.bottom = borders->invisible.bottom + borders->visible.bottom;
-  borders->total.top    = borders->invisible.top    + borders->visible.top;
+  borders->total.top = borders->invisible.top + borders->visible.top;
 
-  /* Scale geometry for HiDPI, see comment in meta_frame_layout_draw_with_style() */
+  /* Scale geometry for HiDPI, see comment in
+   * meta_frame_layout_draw_with_style() */
   scale_border (&borders->visible, scale);
   scale_border (&borders->invisible, scale);
   scale_border (&borders->total, scale);
@@ -156,7 +164,7 @@ meta_frame_layout_apply_scale (const MetaFrameLayout *layout,
   pango_font_description_set_size (font_desc, MAX (size * scale, 1));
 }
 
-static MetaButtonSpace*
+static MetaButtonSpace *
 rect_for_function (MetaFrameGeometry *fgeom,
                    MetaFrameFlags     flags,
                    MetaButtonFunction function,
@@ -214,7 +222,7 @@ strip_button (MetaButtonSpace *func_rects[MAX_BUTTONS_PER_CORNER],
           /* shift the other rects back in the array */
           while (i < *n_rects)
             {
-              func_rects[i] = func_rects[i+1];
+              func_rects[i] = func_rects[i + 1];
 
               ++i;
             }
@@ -345,10 +353,10 @@ meta_frame_layout_sync_with_style (MetaFrameLayout *layout,
   layout->button_border.top += border.top;
   layout->button_border.bottom += border.bottom;
 
-  layout->button_min_size.width = MAX(layout->button_min_size.width,
-                                      requisition.width);
-  layout->button_min_size.height = MAX(layout->button_min_size.height,
-                                       requisition.height);
+  layout->button_min_size.width = MAX (layout->button_min_size.width,
+                                       requisition.width);
+  layout->button_min_size.height = MAX (layout->button_min_size.height,
+                                        requisition.height);
 }
 
 static void
@@ -391,11 +399,12 @@ meta_frame_layout_calc_geometry (MetaFrameLayout        *layout,
 
   fgeom->borders = borders;
 
-  /* Scale geometry for HiDPI, see comment in meta_frame_layout_draw_with_style() */
+  /* Scale geometry for HiDPI, see comment in
+   * meta_frame_layout_draw_with_style() */
   fgeom->content_border = layout->frame_border;
-  fgeom->content_border.left   += layout->titlebar_border.left * scale;
-  fgeom->content_border.right  += layout->titlebar_border.right * scale;
-  fgeom->content_border.top    += layout->titlebar_border.top * scale;
+  fgeom->content_border.left += layout->titlebar_border.left * scale;
+  fgeom->content_border.right += layout->titlebar_border.right * scale;
+  fgeom->content_border.top += layout->titlebar_border.top * scale;
   fgeom->content_border.bottom += layout->titlebar_border.bottom * scale;
 
   width = client_width + borders.total.left + borders.total.right;
@@ -410,12 +419,14 @@ meta_frame_layout_calc_geometry (MetaFrameLayout        *layout,
   content_width = width -
                   (fgeom->content_border.left + borders.invisible.left) -
                   (fgeom->content_border.right + borders.invisible.right);
-  content_height = borders.visible.top - fgeom->content_border.top - fgeom->content_border.bottom;
+  content_height = borders.visible.top - fgeom->content_border.top -
+                   fgeom->content_border.bottom;
 
-  button_width = MAX ((int)layout->icon_size, layout->button_min_size.width) +
+  button_width = MAX ((int) layout->icon_size, layout->button_min_size.width) +
                  layout->button_border.left + layout->button_border.right;
-  button_height = MAX ((int)layout->icon_size, layout->button_min_size.height) +
-                  layout->button_border.top + layout->button_border.bottom;
+  button_height =
+    MAX ((int) layout->icon_size, layout->button_min_size.height) +
+    layout->button_border.top + layout->button_border.bottom;
   button_width *= scale;
   button_height *= scale;
 
@@ -437,14 +448,18 @@ meta_frame_layout_calc_geometry (MetaFrameLayout        *layout,
   if (!layout->hide_buttons)
     {
       /* Try to fill in rects */
-      for (i = 0; i < MAX_BUTTONS_PER_CORNER && button_layout->left_buttons[i] != META_BUTTON_FUNCTION_LAST; 
i++)
+      for (i = 0;
+           i < MAX_BUTTONS_PER_CORNER &&
+           button_layout->left_buttons[i] != META_BUTTON_FUNCTION_LAST; i++)
         {
           left_func_rects[n_left] = rect_for_function (fgeom, flags,
-                                                       button_layout->left_buttons[i],
+                                                       button_layout->left_buttons[
+                                                         i],
                                                        theme);
           if (left_func_rects[n_left] != NULL)
             {
-              left_buttons_has_spacer[n_left] = button_layout->left_buttons_has_spacer[i];
+              left_buttons_has_spacer[n_left] =
+                button_layout->left_buttons_has_spacer[i];
               if (button_layout->left_buttons_has_spacer[i])
                 ++n_left_spacers;
 
@@ -452,14 +467,18 @@ meta_frame_layout_calc_geometry (MetaFrameLayout        *layout,
             }
         }
 
-      for (i = 0; i < MAX_BUTTONS_PER_CORNER && button_layout->right_buttons[i] != 
META_BUTTON_FUNCTION_LAST; i++)
+      for (i = 0;
+           i < MAX_BUTTONS_PER_CORNER &&
+           button_layout->right_buttons[i] != META_BUTTON_FUNCTION_LAST; i++)
         {
           right_func_rects[n_right] = rect_for_function (fgeom, flags,
-                                                         button_layout->right_buttons[i],
+                                                         button_layout->right_buttons[
+                                                           i],
                                                          theme);
           if (right_func_rects[n_right] != NULL)
             {
-              right_buttons_has_spacer[n_right] = button_layout->right_buttons_has_spacer[i];
+              right_buttons_has_spacer[n_right] =
+                button_layout->right_buttons_has_spacer[i];
               if (button_layout->right_buttons_has_spacer[i])
                 ++n_right_spacers;
 
@@ -479,13 +498,15 @@ meta_frame_layout_calc_geometry (MetaFrameLayout        *layout,
       space_used_by_buttons += button_width * n_left;
       space_used_by_buttons += layout->button_margin.right * scale * n_left;
       space_used_by_buttons += (button_width * 0.75) * n_left_spacers;
-      space_used_by_buttons += layout->titlebar_spacing * scale * MAX (n_left - 1, 0);
+      space_used_by_buttons += layout->titlebar_spacing * scale * MAX (
+        n_left - 1, 0);
 
       space_used_by_buttons += layout->button_margin.left * scale * n_right;
       space_used_by_buttons += button_width * n_right;
       space_used_by_buttons += layout->button_margin.right * scale * n_right;
       space_used_by_buttons += (button_width * 0.75) * n_right_spacers;
-      space_used_by_buttons += layout->titlebar_spacing * scale * MAX (n_right - 1, 0);
+      space_used_by_buttons += layout->titlebar_spacing * scale * MAX (
+        n_right - 1, 0);
 
       if (space_used_by_buttons <= content_width)
         break; /* Everything fits, bail out */
@@ -528,8 +549,9 @@ meta_frame_layout_calc_geometry (MetaFrameLayout        *layout,
         continue;
       else
         {
-          meta_bug ("Could not find a button to strip. n_left = %d n_right = %d\n",
-                    n_left, n_right);
+          meta_bug (
+            "Could not find a button to strip. n_left = %d n_right = %d\n",
+            n_left, n_right);
         }
     }
 
@@ -550,7 +572,8 @@ meta_frame_layout_calc_geometry (MetaFrameLayout        *layout,
     {
       MetaButtonSpace *rect;
 
-      if (x < 0) /* if we go negative, leave the buttons we don't get to as 0-width */
+      if (x < 0) /* if we go negative, leave the buttons we don't get to as
+                  * 0-width */
         break;
 
       x -= layout->button_margin.right * scale;
@@ -575,10 +598,10 @@ meta_frame_layout_calc_geometry (MetaFrameLayout        *layout,
 
           if (i == n_right - 1)
             rect->clickable.width += fgeom->content_border.right;
-
         }
       else
-        g_memmove (&(rect->clickable), &(rect->visible), sizeof(rect->clickable));
+        g_memmove (&(rect->clickable), &(rect->visible),
+                   sizeof (rect->clickable));
 
       x = rect->visible.x - layout->button_margin.left * scale;
 
@@ -610,7 +633,7 @@ meta_frame_layout_calc_geometry (MetaFrameLayout        *layout,
 
       if (flags & META_FRAME_MAXIMIZED)
         {
-          if (i==0)
+          if (i == 0)
             {
               rect->clickable.x = 0;
               rect->clickable.width = button_width + x;
@@ -625,9 +648,11 @@ meta_frame_layout_calc_geometry (MetaFrameLayout        *layout,
           rect->clickable.height = button_height + button_y;
         }
       else
-        g_memmove (&(rect->clickable), &(rect->visible), sizeof(rect->clickable));
+        g_memmove (&(rect->clickable), &(rect->visible),
+                   sizeof (rect->clickable));
 
-      x = rect->visible.x + rect->visible.width + layout->button_margin.right * scale;
+      x = rect->visible.x + rect->visible.width + layout->button_margin.right *
+          scale;
       if (i < n_left - 1)
         x += layout->titlebar_spacing * scale;
       if (left_buttons_has_spacer[i])
@@ -660,14 +685,18 @@ meta_frame_layout_calc_geometry (MetaFrameLayout        *layout,
   fgeom->bottom_right_corner_rounded_radius = 0;
 
   if (borders.visible.top + borders.visible.left >= min_size_for_rounding)
-    fgeom->top_left_corner_rounded_radius = layout->top_left_corner_rounded_radius * scale;
+    fgeom->top_left_corner_rounded_radius =
+      layout->top_left_corner_rounded_radius * scale;
   if (borders.visible.top + borders.visible.right >= min_size_for_rounding)
-    fgeom->top_right_corner_rounded_radius = layout->top_right_corner_rounded_radius * scale;
+    fgeom->top_right_corner_rounded_radius =
+      layout->top_right_corner_rounded_radius * scale;
 
   if (borders.visible.bottom + borders.visible.left >= min_size_for_rounding)
-    fgeom->bottom_left_corner_rounded_radius = layout->bottom_left_corner_rounded_radius * scale;
+    fgeom->bottom_left_corner_rounded_radius =
+      layout->bottom_left_corner_rounded_radius * scale;
   if (borders.visible.bottom + borders.visible.right >= min_size_for_rounding)
-    fgeom->bottom_right_corner_rounded_radius = layout->bottom_right_corner_rounded_radius * scale;
+    fgeom->bottom_right_corner_rounded_radius =
+      layout->bottom_right_corner_rounded_radius * scale;
 }
 
 static void
@@ -766,8 +795,11 @@ meta_frame_layout_draw_with_style (MetaFrameLayout         *layout,
 
   visible_rect.x = borders->invisible.left / scale;
   visible_rect.y = borders->invisible.top / scale;
-  visible_rect.width = (fgeom->width - borders->invisible.left - borders->invisible.right) / scale;
-  visible_rect.height = (fgeom->height - borders->invisible.top - borders->invisible.bottom) / scale;
+  visible_rect.width =
+    (fgeom->width - borders->invisible.left - borders->invisible.right) / scale;
+  visible_rect.height =
+    (fgeom->height - borders->invisible.top - borders->invisible.bottom) /
+    scale;
 
   meta_style_info_set_flags (style_info, flags);
 
@@ -800,7 +832,7 @@ meta_frame_layout_draw_with_style (MetaFrameLayout         *layout,
       pango_layout_set_width (title_layout, -1);
       pango_layout_get_pixel_extents (title_layout, NULL, &logical);
 
-      text_width = MIN(fgeom->title_rect.width / scale, logical.width);
+      text_width = MIN (fgeom->title_rect.width / scale, logical.width);
 
       if (text_width < logical.width)
         pango_layout_set_width (title_layout, PANGO_SCALE * text_width);
@@ -811,8 +843,10 @@ meta_frame_layout_draw_with_style (MetaFrameLayout         *layout,
 
       if (x < fgeom->title_rect.x / scale)
         x = fgeom->title_rect.x / scale;
-      else if (x + text_width > (fgeom->title_rect.x + fgeom->title_rect.width) / scale)
-        x = (fgeom->title_rect.x + fgeom->title_rect.width) / scale - text_width;
+      else if (x + text_width >
+               (fgeom->title_rect.x + fgeom->title_rect.width) / scale)
+        x = (fgeom->title_rect.x + fgeom->title_rect.width) / scale -
+            text_width;
 
       style = style_info->styles[META_STYLE_ELEMENT_TITLE];
       gtk_render_layout (style, cr, x, y, title_layout);
@@ -820,7 +854,9 @@ meta_frame_layout_draw_with_style (MetaFrameLayout         *layout,
 
   style = style_info->styles[META_STYLE_ELEMENT_BUTTON];
   state = gtk_style_context_get_state (style);
-  for (button_type = META_BUTTON_TYPE_CLOSE; button_type < META_BUTTON_TYPE_LAST; button_type++)
+  for (button_type =
+         META_BUTTON_TYPE_CLOSE; button_type < META_BUTTON_TYPE_LAST;
+       button_type++)
     {
       const char *button_class = get_class_from_button_type (button_type);
       if (button_class)
@@ -857,26 +893,26 @@ meta_frame_layout_draw_with_style (MetaFrameLayout         *layout,
           switch (button_type)
             {
             case META_BUTTON_TYPE_CLOSE:
-               icon_name = "window-close-symbolic";
-               break;
+              icon_name = "window-close-symbolic";
+              break;
             case META_BUTTON_TYPE_MAXIMIZE:
-               if (flags & META_FRAME_MAXIMIZED)
-                 icon_name = "window-restore-symbolic";
-               else
-                 icon_name = "window-maximize-symbolic";
-               break;
+              if (flags & META_FRAME_MAXIMIZED)
+                icon_name = "window-restore-symbolic";
+              else
+                icon_name = "window-maximize-symbolic";
+              break;
             case META_BUTTON_TYPE_MINIMIZE:
-               icon_name = "window-minimize-symbolic";
-               break;
+              icon_name = "window-minimize-symbolic";
+              break;
             case META_BUTTON_TYPE_MENU:
-               icon_name = "open-menu-symbolic";
-               break;
+              icon_name = "open-menu-symbolic";
+              break;
             case META_BUTTON_TYPE_APPMENU:
-               surface = cairo_surface_reference (mini_icon);
-               break;
+              surface = cairo_surface_reference (mini_icon);
+              break;
             default:
-               icon_name = NULL;
-               break;
+              icon_name = NULL;
+              break;
             }
 
           if (icon_name)
@@ -886,9 +922,12 @@ meta_frame_layout_draw_with_style (MetaFrameLayout         *layout,
               GdkPixbuf *pixbuf;
 
               info = gtk_icon_theme_lookup_icon_for_scale (theme, icon_name,
-                                                           layout->icon_size, scale, 0);
-              pixbuf = gtk_icon_info_load_symbolic_for_context (info, style, NULL, NULL);
-              surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, scale, NULL);
+                                                           layout->icon_size,
+                                                           scale, 0);
+              pixbuf = gtk_icon_info_load_symbolic_for_context (info, style,
+                                                                NULL, NULL);
+              surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, scale,
+                                                              NULL);
             }
 
           if (surface)
@@ -924,7 +963,7 @@ meta_frame_layout_draw_with_style (MetaFrameLayout         *layout,
  * meta_theme_get_default: (skip)
  *
  */
-MetaTheme*
+MetaTheme *
 meta_theme_get_default (void)
 {
   static MetaTheme *theme = NULL;
@@ -967,7 +1006,7 @@ meta_theme_get_default (void)
  * meta_theme_new: (skip)
  *
  */
-MetaTheme*
+MetaTheme *
 meta_theme_new (void)
 {
   return g_new0 (MetaTheme, 1);
@@ -989,9 +1028,9 @@ meta_theme_free (MetaTheme *theme)
   g_free (theme);
 }
 
-MetaFrameLayout*
-meta_theme_get_frame_layout (MetaTheme     *theme,
-                             MetaFrameType  type)
+MetaFrameLayout *
+meta_theme_get_frame_layout (MetaTheme    *theme,
+                             MetaFrameType type)
 {
   g_return_val_if_fail (type < META_FRAME_TYPE_LAST, NULL);
 
@@ -1027,7 +1066,7 @@ create_style_context (GType            widget_type,
     gtk_widget_path_iter_set_object_name (path, -1, object_name);
 
   state = gtk_style_context_get_state (style);
-  if (meta_get_locale_direction() == META_LOCALE_DIRECTION_RTL)
+  if (meta_get_locale_direction () == META_LOCALE_DIRECTION_RTL)
     {
       state |= GTK_STATE_FLAG_DIR_RTL;
       state &= ~GTK_STATE_FLAG_DIR_LTR;
@@ -1140,7 +1179,7 @@ meta_style_info_ref (MetaStyleInfo *style_info)
   g_return_val_if_fail (style_info != NULL, NULL);
   g_return_val_if_fail (style_info->refcount > 0, NULL);
 
-  g_atomic_int_inc ((volatile int *)&style_info->refcount);
+  g_atomic_int_inc ((volatile int *) &style_info->refcount);
   return style_info;
 }
 
@@ -1150,7 +1189,7 @@ meta_style_info_unref (MetaStyleInfo *style_info)
   g_return_if_fail (style_info != NULL);
   g_return_if_fail (style_info->refcount > 0);
 
-  if (g_atomic_int_dec_and_test ((volatile int *)&style_info->refcount))
+  if (g_atomic_int_dec_and_test ((volatile int *) &style_info->refcount))
     {
       int i;
       for (i = 0; i < META_STYLE_ELEMENT_LAST; i++)
@@ -1194,8 +1233,8 @@ remove_toplevel_class (GtkStyleContext *style,
 }
 
 void
-meta_style_info_set_flags (MetaStyleInfo  *style_info,
-                           MetaFrameFlags  flags)
+meta_style_info_set_flags (MetaStyleInfo *style_info,
+                           MetaFrameFlags flags)
 {
   GtkStyleContext *style;
   const char *class_name = NULL;
@@ -1231,7 +1270,7 @@ meta_style_info_set_flags (MetaStyleInfo  *style_info,
     }
 }
 
-PangoFontDescription*
+PangoFontDescription *
 meta_style_info_create_font_desc (MetaStyleInfo *style_info)
 {
   PangoFontDescription *font_desc;
@@ -1364,7 +1403,7 @@ meta_theme_calc_geometry (MetaTheme              *theme,
  */
 int
 meta_pango_font_desc_get_text_height (const PangoFontDescription *font_desc,
-                                      PangoContext         *context)
+                                      PangoContext               *context)
 {
   PangoFontMetrics *metrics;
   PangoLanguage *lang;
@@ -1390,7 +1429,7 @@ meta_pango_font_desc_get_text_height (const PangoFontDescription *font_desc,
  *
  * Return value: the string value
  */
-const char*
+const char *
 meta_frame_type_to_string (MetaFrameType type)
 {
   switch (type)
@@ -1413,7 +1452,7 @@ meta_frame_type_to_string (MetaFrameType type)
     case META_FRAME_TYPE_TOOLBAR:
       return "toolbar";
 #endif
-    case  META_FRAME_TYPE_LAST:
+    case META_FRAME_TYPE_LAST:
       break;
     }
 
diff --git a/src/ui/ui.c b/src/ui/ui.c
index e96fe86fd..21361404f 100644
--- a/src/ui/ui.c
+++ b/src/ui/ui.c
@@ -98,15 +98,15 @@ set_background_none (Display *xdisplay,
 }
 
 MetaUIFrame *
-meta_ui_create_frame (MetaUI *ui,
-                      Display *xdisplay,
+meta_ui_create_frame (MetaUI     *ui,
+                      Display    *xdisplay,
                       MetaWindow *meta_window,
-                      Visual *xvisual,
-                      gint x,
-                      gint y,
-                      gint width,
-                      gint height,
-                      gulong *create_serial)
+                      Visual     *xvisual,
+                      gint        x,
+                      gint        y,
+                      gint        width,
+                      gint        height,
+                      gulong     *create_serial)
 {
   GdkDisplay *display = gdk_x11_lookup_xdisplay (xdisplay);
   GdkScreen *screen;
@@ -143,7 +143,7 @@ meta_ui_create_frame (MetaUI *ui,
   attrs.wmclass_class = NULL;
   attrs.override_redirect = FALSE;
 
-  attrs.width  = width;
+  attrs.width = width;
   attrs.height = height;
 
   attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
@@ -155,13 +155,14 @@ meta_ui_create_frame (MetaUI *ui,
   if (create_serial)
     *create_serial = XNextRequest (xdisplay);
   window =
-    gdk_window_new (gdk_screen_get_root_window(screen),
-                   &attrs, attributes_mask);
+    gdk_window_new (gdk_screen_get_root_window (screen),
+                    &attrs, attributes_mask);
 
   gdk_window_resize (window, width, height);
   set_background_none (xdisplay, GDK_WINDOW_XID (window));
 
-  return meta_frames_manage_window (ui->frames, meta_window, GDK_WINDOW_XID (window), window);
+  return meta_frames_manage_window (ui->frames, meta_window,
+                                    GDK_WINDOW_XID (window), window);
 }
 
 void
@@ -212,10 +213,10 @@ meta_ui_window_should_not_cause_focus (Display *xdisplay,
 }
 
 void
-meta_ui_theme_get_frame_borders (MetaUI *ui,
-                                 MetaFrameType      type,
-                                 MetaFrameFlags     flags,
-                                 MetaFrameBorders  *borders)
+meta_ui_theme_get_frame_borders (MetaUI           *ui,
+                                 MetaFrameType     type,
+                                 MetaFrameFlags    flags,
+                                 MetaFrameBorders *borders)
 {
   GdkDisplay *display;
   GdkScreen *screen;
diff --git a/src/wayland/meta-pointer-confinement-wayland.c b/src/wayland/meta-pointer-confinement-wayland.c
index b8a900467..d19ecd737 100644
--- a/src/wayland/meta-pointer-confinement-wayland.c
+++ b/src/wayland/meta-pointer-confinement-wayland.c
@@ -122,7 +122,7 @@ add_non_overlapping_edges (MetaBox     *boxes,
     }
   for (i = band_below_start; i < band_below_end; i++)
     {
-      MetaBox *box= &boxes[i];
+      MetaBox *box = &boxes[i];
       add_border (band_merge, box->x1, box->y1, box->x2, box->y1,
                   META_BORDER_MOTION_DIRECTION_NEGATIVE_Y);
     }
@@ -254,7 +254,7 @@ region_to_outline (cairo_region_t *region,
    *
    */
 
-  num_boxes  = cairo_region_num_rectangles (region);
+  num_boxes = cairo_region_num_rectangles (region);
   boxes = g_new (MetaBox, num_boxes);
   for (i = 0; i < num_boxes; i++)
     {
@@ -392,7 +392,7 @@ get_closest_border (GArray    *borders,
         continue;
 
       delta = meta_vector2_subtract (intersection, motion->a);
-      distance_2 = delta.x*delta.x + delta.y*delta.y;
+      distance_2 = delta.x * delta.x + delta.y * delta.y;
       if (distance_2 < closest_distance_2)
         {
           closest_border = border;
@@ -467,8 +467,8 @@ meta_pointer_confinement_wayland_constrain (MetaPointerConstraint *constraint,
                                             guint32                time,
                                             float                  prev_x,
                                             float                  prev_y,
-                                            float                  *x,
-                                            float                  *y)
+                                            float                 *x,
+                                            float                 *y)
 {
   MetaPointerConfinementWayland *self =
     META_POINTER_CONFINEMENT_WAYLAND (constraint);
@@ -493,9 +493,9 @@ meta_pointer_confinement_wayland_constrain (MetaPointerConstraint *constraint,
    * won't be clamped, but will be rounded up to be outside of the range
    * of wl_fixed_t. */
   if (sx > prev_sx)
-    sx += (float)wl_fixed_to_double(1);
+    sx += (float) wl_fixed_to_double (1);
   if (sy > prev_sy)
-    sy += (float)wl_fixed_to_double(1);
+    sy += (float) wl_fixed_to_double (1);
 
   borders = g_array_new (FALSE, FALSE, sizeof (MetaBorder));
 
@@ -572,7 +572,7 @@ point_to_border_distance_2 (MetaBorder *border,
 
   dx = fabsf (orig_x - x);
   dy = fabsf (orig_y - y);
-  return dx*dx + dy*dy;
+  return dx * dx + dy * dy;
 }
 
 static void
@@ -584,7 +584,8 @@ warp_to_behind_border (MetaBorder *border,
     {
     case META_BORDER_MOTION_DIRECTION_POSITIVE_X:
     case META_BORDER_MOTION_DIRECTION_NEGATIVE_X:
-      if (border->blocking_directions == META_BORDER_MOTION_DIRECTION_POSITIVE_X)
+      if (border->blocking_directions ==
+          META_BORDER_MOTION_DIRECTION_POSITIVE_X)
         *sx = border->line.a.x - wl_fixed_to_double (1);
       else
         *sx = border->line.a.x + wl_fixed_to_double (1);
@@ -595,7 +596,8 @@ warp_to_behind_border (MetaBorder *border,
       break;
     case META_BORDER_MOTION_DIRECTION_POSITIVE_Y:
     case META_BORDER_MOTION_DIRECTION_NEGATIVE_Y:
-      if (border->blocking_directions == META_BORDER_MOTION_DIRECTION_POSITIVE_Y)
+      if (border->blocking_directions ==
+          META_BORDER_MOTION_DIRECTION_POSITIVE_Y)
         *sy = border->line.a.y - wl_fixed_to_double (1);
       else
         *sy = border->line.a.y + wl_fixed_to_double (1);
@@ -628,7 +630,7 @@ meta_pointer_confinement_wayland_maybe_warp (MetaPointerConfinementWayland *self
   region =
     meta_wayland_pointer_constraint_calculate_effective_region (self->constraint);
 
-  if (!cairo_region_contains_point (region, (int)sx, (int)sy))
+  if (!cairo_region_contains_point (region, (int) sx, (int) sy))
     {
       GArray *borders;
       float closest_distance_2 = FLT_MAX;
@@ -657,7 +659,7 @@ meta_pointer_confinement_wayland_maybe_warp (MetaPointerConfinementWayland *self
       warp_to_behind_border (closest_border, &sx, &sy);
 
       meta_wayland_surface_get_absolute_coordinates (surface, sx, sy, &x, &y);
-      meta_backend_warp_pointer (meta_get_backend (), (int)x, (int)y);
+      meta_backend_warp_pointer (meta_get_backend (), (int) x, (int) y);
     }
 
   cairo_region_destroy (region);
@@ -708,15 +710,18 @@ meta_pointer_confinement_wayland_new (MetaWaylandPointerConstraint *constraint)
 }
 
 static void
-meta_pointer_confinement_wayland_init (MetaPointerConfinementWayland *confinement_wayland)
+meta_pointer_confinement_wayland_init (
+  MetaPointerConfinementWayland *confinement_wayland)
 {
 }
 
 static void
-meta_pointer_confinement_wayland_class_init (MetaPointerConfinementWaylandClass *klass)
+meta_pointer_confinement_wayland_class_init (
+  MetaPointerConfinementWaylandClass *klass)
 {
   MetaPointerConstraintClass *pointer_constraint_class =
     META_POINTER_CONSTRAINT_CLASS (klass);
 
-  pointer_constraint_class->constrain = meta_pointer_confinement_wayland_constrain;
+  pointer_constraint_class->constrain =
+    meta_pointer_confinement_wayland_constrain;
 }
diff --git a/src/wayland/meta-wayland-actor-surface.c b/src/wayland/meta-wayland-actor-surface.c
index b69c31f72..e74721894 100644
--- a/src/wayland/meta-wayland-actor-surface.c
+++ b/src/wayland/meta-wayland-actor-surface.c
@@ -53,7 +53,8 @@ static void
 meta_wayland_actor_surface_dispose (GObject *object)
 {
   MetaWaylandActorSurfacePrivate *priv =
-    meta_wayland_actor_surface_get_instance_private (META_WAYLAND_ACTOR_SURFACE (object));
+    meta_wayland_actor_surface_get_instance_private (META_WAYLAND_ACTOR_SURFACE (
+                                                       object));
   MetaWaylandSurface *surface =
     meta_wayland_surface_role_get_surface (META_WAYLAND_SURFACE_ROLE (object));
 
@@ -73,12 +74,14 @@ static void
 meta_wayland_actor_surface_assigned (MetaWaylandSurfaceRole *surface_role)
 {
   MetaWaylandActorSurfacePrivate *priv =
-    meta_wayland_actor_surface_get_instance_private (META_WAYLAND_ACTOR_SURFACE (surface_role));
+    meta_wayland_actor_surface_get_instance_private (META_WAYLAND_ACTOR_SURFACE (
+                                                       surface_role));
   MetaWaylandSurface *surface =
     meta_wayland_surface_role_get_surface (surface_role);
   GList *l;
 
-  meta_surface_actor_wayland_add_frame_callbacks (META_SURFACE_ACTOR_WAYLAND (priv->actor),
+  meta_surface_actor_wayland_add_frame_callbacks (META_SURFACE_ACTOR_WAYLAND (
+                                                    priv->actor),
                                                   &surface->pending_frame_callback_list);
   wl_list_init (&surface->pending_frame_callback_list);
 
@@ -91,8 +94,9 @@ meta_wayland_actor_surface_assigned (MetaWaylandSurfaceRole *surface_role)
 }
 
 void
-meta_wayland_actor_surface_queue_frame_callbacks (MetaWaylandActorSurface *actor_surface,
-                                                  MetaWaylandPendingState *pending)
+meta_wayland_actor_surface_queue_frame_callbacks (
+  MetaWaylandActorSurface *actor_surface,
+  MetaWaylandPendingState *pending)
 {
   MetaWaylandActorSurfacePrivate *priv =
     meta_wayland_actor_surface_get_instance_private (actor_surface);
@@ -105,7 +109,8 @@ meta_wayland_actor_surface_queue_frame_callbacks (MetaWaylandActorSurface *actor
 }
 
 static double
-meta_wayland_actor_surface_get_geometry_scale (MetaWaylandActorSurface *actor_surface)
+meta_wayland_actor_surface_get_geometry_scale (
+  MetaWaylandActorSurface *actor_surface)
 {
   MetaWaylandSurfaceRole *surface_role =
     META_WAYLAND_SURFACE_ROLE (actor_surface);
@@ -129,7 +134,8 @@ meta_wayland_actor_surface_get_geometry_scale (MetaWaylandActorSurface *actor_su
 }
 
 double
-meta_wayland_actor_surface_calculate_scale (MetaWaylandActorSurface *actor_surface)
+meta_wayland_actor_surface_calculate_scale (
+  MetaWaylandActorSurface *actor_surface)
 {
   MetaWaylandSurfaceRole *surface_role =
     META_WAYLAND_SURFACE_ROLE (actor_surface);
@@ -144,7 +150,8 @@ meta_wayland_actor_surface_calculate_scale (MetaWaylandActorSurface *actor_surfa
 }
 
 static void
-meta_wayland_actor_surface_real_sync_actor_state (MetaWaylandActorSurface *actor_surface)
+meta_wayland_actor_surface_real_sync_actor_state (
+  MetaWaylandActorSurface *actor_surface)
 {
   MetaWaylandActorSurfacePrivate *priv =
     meta_wayland_actor_surface_get_instance_private (actor_surface);
@@ -166,7 +173,8 @@ meta_wayland_actor_surface_real_sync_actor_state (MetaWaylandActorSurface *actor
   clutter_actor_set_scale (CLUTTER_ACTOR (stex), actor_scale, actor_scale);
 
   /* Wayland surface coordinate space -> stage coordinate space */
-  geometry_scale = meta_wayland_actor_surface_get_geometry_scale (actor_surface);
+  geometry_scale =
+    meta_wayland_actor_surface_get_geometry_scale (actor_surface);
 
   surface_rect = (cairo_rectangle_int_t) {
     .width = meta_wayland_surface_get_width (surface) * geometry_scale,
@@ -216,7 +224,8 @@ meta_wayland_actor_surface_real_sync_actor_state (MetaWaylandActorSurface *actor
 }
 
 void
-meta_wayland_actor_surface_sync_actor_state (MetaWaylandActorSurface *actor_surface)
+meta_wayland_actor_surface_sync_actor_state (
+  MetaWaylandActorSurface *actor_surface)
 {
   MetaWaylandActorSurfaceClass *actor_surface_class =
     META_WAYLAND_ACTOR_SURFACE_GET_CLASS (actor_surface);
@@ -244,11 +253,13 @@ meta_wayland_actor_surface_commit (MetaWaylandSurfaceRole  *surface_role,
 }
 
 static gboolean
-meta_wayland_actor_surface_is_on_logical_monitor (MetaWaylandSurfaceRole *surface_role,
-                                                  MetaLogicalMonitor     *logical_monitor)
+meta_wayland_actor_surface_is_on_logical_monitor (
+  MetaWaylandSurfaceRole *surface_role,
+  MetaLogicalMonitor     *logical_monitor)
 {
   MetaWaylandActorSurfacePrivate *priv =
-    meta_wayland_actor_surface_get_instance_private (META_WAYLAND_ACTOR_SURFACE (surface_role));
+    meta_wayland_actor_surface_get_instance_private (META_WAYLAND_ACTOR_SURFACE (
+                                                       surface_role));
   ClutterActor *actor = CLUTTER_ACTOR (priv->actor);
   float x, y, width, height;
   cairo_rectangle_int_t actor_rect;
@@ -270,12 +281,12 @@ meta_wayland_actor_surface_is_on_logical_monitor (MetaWaylandSurfaceRole *surfac
   logical_monitor_layout = meta_logical_monitor_get_layout (logical_monitor);
 
   cairo_region_intersect_rectangle (region,
-                                   &((cairo_rectangle_int_t) {
-                                     .x = logical_monitor_layout.x,
-                                     .y = logical_monitor_layout.y,
-                                     .width = logical_monitor_layout.width,
-                                     .height = logical_monitor_layout.height,
-                                   }));
+                                    &((cairo_rectangle_int_t) {
+    .x = logical_monitor_layout.x,
+    .y = logical_monitor_layout.y,
+    .width = logical_monitor_layout.width,
+    .height = logical_monitor_layout.height,
+  }));
 
   is_on_monitor = !cairo_region_is_empty (region);
   cairo_region_destroy (region);
@@ -321,7 +332,8 @@ meta_wayland_actor_surface_reset_actor (MetaWaylandActorSurface *actor_surface)
   MetaWaylandActorSurfacePrivate *priv =
     meta_wayland_actor_surface_get_instance_private (actor_surface);
   MetaWaylandSurface *surface =
-    meta_wayland_surface_role_get_surface (META_WAYLAND_SURFACE_ROLE (actor_surface));
+    meta_wayland_surface_role_get_surface (META_WAYLAND_SURFACE_ROLE (
+                                             actor_surface));
 
   if (priv->actor)
     {
@@ -334,12 +346,15 @@ meta_wayland_actor_surface_reset_actor (MetaWaylandActorSurface *actor_surface)
   priv->actor = g_object_ref_sink (meta_surface_actor_wayland_new (surface));
 
   g_signal_connect_swapped (priv->actor, "notify::allocation",
-                            G_CALLBACK (meta_wayland_surface_notify_geometry_changed),
+                            G_CALLBACK (
+                              meta_wayland_surface_notify_geometry_changed),
                             surface);
   g_signal_connect_swapped (priv->actor, "notify::position",
-                            G_CALLBACK (meta_wayland_surface_notify_geometry_changed),
+                            G_CALLBACK (
+                              meta_wayland_surface_notify_geometry_changed),
                             surface);
   g_signal_connect_swapped (priv->actor, "notify::mapped",
-                            G_CALLBACK (meta_wayland_surface_notify_geometry_changed),
+                            G_CALLBACK (
+                              meta_wayland_surface_notify_geometry_changed),
                             surface);
 }
diff --git a/src/wayland/meta-wayland-buffer.c b/src/wayland/meta-wayland-buffer.c
index 9fee02d52..16f6009b0 100644
--- a/src/wayland/meta-wayland-buffer.c
+++ b/src/wayland/meta-wayland-buffer.c
@@ -51,7 +51,7 @@ G_DEFINE_TYPE (MetaWaylandBuffer, meta_wayland_buffer, G_TYPE_OBJECT);
 
 static void
 meta_wayland_buffer_destroy_handler (struct wl_listener *listener,
-                                     void *data)
+                                     void               *data)
 {
   MetaWaylandBuffer *buffer =
     wl_container_of (listener, buffer, destroy_listener);
@@ -106,7 +106,8 @@ meta_wayland_buffer_realize (MetaWaylandBuffer *buffer)
   MetaBackend *backend = meta_get_backend ();
   MetaEgl *egl = meta_backend_get_egl (backend);
   ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
-  CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend);
+  CoglContext *cogl_context =
+    clutter_backend_get_cogl_context (clutter_backend);
   EGLDisplay egl_display = cogl_egl_context_get_egl_display (cogl_context);
 #ifdef HAVE_WAYLAND_EGLSTREAM
   MetaWaylandEglStream *stream;
@@ -201,7 +202,8 @@ shm_buffer_attach (MetaWaylandBuffer *buffer,
 {
   MetaBackend *backend = meta_get_backend ();
   ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
-  CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend);
+  CoglContext *cogl_context =
+    clutter_backend_get_cogl_context (clutter_backend);
   struct wl_shm_buffer *shm_buffer;
   int stride, width, height;
   CoglPixelFormat format;
@@ -253,7 +255,8 @@ egl_image_buffer_attach (MetaWaylandBuffer *buffer,
   MetaBackend *backend = meta_get_backend ();
   MetaEgl *egl = meta_backend_get_egl (backend);
   ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
-  CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend);
+  CoglContext *cogl_context =
+    clutter_backend_get_cogl_context (clutter_backend);
   EGLDisplay egl_display = cogl_egl_context_get_egl_display (cogl_context);
   int format, width, height, y_inverted;
   CoglPixelFormat cogl_format;
@@ -326,8 +329,8 @@ egl_image_buffer_attach (MetaWaylandBuffer *buffer,
 
 #ifdef HAVE_WAYLAND_EGLSTREAM
 static gboolean
-egl_stream_buffer_attach (MetaWaylandBuffer  *buffer,
-                          GError            **error)
+egl_stream_buffer_attach (MetaWaylandBuffer *buffer,
+                          GError           **error)
 {
   MetaWaylandEglStream *stream = buffer->egl_stream.stream;
 
diff --git a/src/wayland/meta-wayland-cursor-surface.c b/src/wayland/meta-wayland-cursor-surface.c
index 92f86c9ec..24705543e 100644
--- a/src/wayland/meta-wayland-cursor-surface.c
+++ b/src/wayland/meta-wayland-cursor-surface.c
@@ -56,7 +56,8 @@ update_cursor_sprite_texture (MetaWaylandCursorSurface *cursor_surface)
   MetaWaylandCursorSurfacePrivate *priv =
     meta_wayland_cursor_surface_get_instance_private (cursor_surface);
   MetaWaylandSurface *surface =
-    meta_wayland_surface_role_get_surface (META_WAYLAND_SURFACE_ROLE (cursor_surface));
+    meta_wayland_surface_role_get_surface (META_WAYLAND_SURFACE_ROLE (
+                                             cursor_surface));
   MetaWaylandBuffer *buffer = meta_wayland_surface_get_buffer (surface);
   MetaCursorSprite *cursor_sprite = META_CURSOR_SPRITE (priv->cursor_sprite);
 
@@ -207,10 +208,11 @@ meta_wayland_cursor_surface_dispose (GObject *object)
   MetaWaylandFrameCallback *cb, *next;
 
   wl_list_for_each_safe (cb, next, &priv->frame_callbacks, link)
-    wl_resource_destroy (cb->resource);
+  wl_resource_destroy (cb->resource);
 
   g_signal_handlers_disconnect_by_func (priv->cursor_sprite,
-                                        cursor_sprite_prepare_at, cursor_surface);
+                                        cursor_sprite_prepare_at,
+                                        cursor_surface);
 
   g_clear_object (&priv->cursor_renderer);
   g_clear_object (&priv->cursor_sprite);
@@ -291,9 +293,10 @@ meta_wayland_cursor_surface_get_sprite (MetaWaylandCursorSurface *cursor_surface
 }
 
 void
-meta_wayland_cursor_surface_set_hotspot (MetaWaylandCursorSurface *cursor_surface,
-                                         int                       hotspot_x,
-                                         int                       hotspot_y)
+meta_wayland_cursor_surface_set_hotspot (
+  MetaWaylandCursorSurface *cursor_surface,
+  int                       hotspot_x,
+  int                       hotspot_y)
 {
   MetaWaylandCursorSurfacePrivate *priv =
     meta_wayland_cursor_surface_get_instance_private (cursor_surface);
@@ -308,9 +311,10 @@ meta_wayland_cursor_surface_set_hotspot (MetaWaylandCursorSurface *cursor_surfac
 }
 
 void
-meta_wayland_cursor_surface_get_hotspot (MetaWaylandCursorSurface *cursor_surface,
-                                         int                      *hotspot_x,
-                                         int                      *hotspot_y)
+meta_wayland_cursor_surface_get_hotspot (
+  MetaWaylandCursorSurface *cursor_surface,
+  int                      *hotspot_x,
+  int                      *hotspot_y)
 {
   MetaWaylandCursorSurfacePrivate *priv =
     meta_wayland_cursor_surface_get_instance_private (cursor_surface);
@@ -344,8 +348,9 @@ on_cursor_painted (MetaCursorRenderer       *renderer,
 }
 
 void
-meta_wayland_cursor_surface_set_renderer (MetaWaylandCursorSurface *cursor_surface,
-                                          MetaCursorRenderer       *renderer)
+meta_wayland_cursor_surface_set_renderer (
+  MetaWaylandCursorSurface *cursor_surface,
+  MetaCursorRenderer       *renderer)
 {
   MetaWaylandCursorSurfacePrivate *priv =
     meta_wayland_cursor_surface_get_instance_private (cursor_surface);
@@ -364,7 +369,8 @@ meta_wayland_cursor_surface_set_renderer (MetaWaylandCursorSurface *cursor_surfa
     {
       priv->cursor_painted_handler_id =
         g_signal_connect_object (renderer, "cursor-painted",
-                                 G_CALLBACK (on_cursor_painted), cursor_surface, 0);
+                                 G_CALLBACK (
+                                   on_cursor_painted), cursor_surface, 0);
       g_object_ref (renderer);
     }
 
@@ -373,7 +379,8 @@ meta_wayland_cursor_surface_set_renderer (MetaWaylandCursorSurface *cursor_surfa
 }
 
 MetaCursorRenderer *
-meta_wayland_cursor_surface_get_renderer (MetaWaylandCursorSurface *cursor_surface)
+meta_wayland_cursor_surface_get_renderer (
+  MetaWaylandCursorSurface *cursor_surface)
 {
   MetaWaylandCursorSurfacePrivate *priv =
     meta_wayland_cursor_surface_get_instance_private (cursor_surface);
diff --git a/src/wayland/meta-wayland-data-device.c b/src/wayland/meta-wayland-data-device.c
index 9a20e3eb4..292d57026 100644
--- a/src/wayland/meta-wayland-data-device.c
+++ b/src/wayland/meta-wayland-data-device.c
@@ -180,7 +180,7 @@ data_offer_update_action (MetaWaylandDataOffer *offer)
 
 static void
 meta_wayland_data_source_target (MetaWaylandDataSource *source,
-                                 const char *mime_type)
+                                 const char            *mime_type)
 {
   if (META_WAYLAND_DATA_SOURCE_GET_CLASS (source)->target)
     META_WAYLAND_DATA_SOURCE_GET_CLASS (source)->target (source, mime_type);
@@ -188,8 +188,8 @@ meta_wayland_data_source_target (MetaWaylandDataSource *source,
 
 void
 meta_wayland_data_source_send (MetaWaylandDataSource *source,
-                               const char *mime_type,
-                               int fd)
+                               const char            *mime_type,
+                               int                    fd)
 {
   META_WAYLAND_DATA_SOURCE_GET_CLASS (source)->send (source, mime_type, fd);
 }
@@ -224,7 +224,7 @@ meta_wayland_data_source_get_seat (MetaWaylandDataSource *source)
 
 void
 meta_wayland_data_source_set_has_target (MetaWaylandDataSource *source,
-                                         gboolean has_target)
+                                         gboolean               has_target)
 {
   MetaWaylandDataSourcePrivate *priv =
     meta_wayland_data_source_get_instance_private (source);
@@ -236,7 +236,8 @@ struct wl_array *
 meta_wayland_data_source_get_mime_types (const MetaWaylandDataSource *source)
 {
   MetaWaylandDataSourcePrivate *priv =
-    meta_wayland_data_source_get_instance_private ((MetaWaylandDataSource *)source);
+    meta_wayland_data_source_get_instance_private (
+      (MetaWaylandDataSource *) source);
 
   return &priv->mime_types;
 }
@@ -297,8 +298,9 @@ meta_wayland_data_source_get_current_offer (MetaWaylandDataSource *source)
 }
 
 void
-meta_wayland_data_source_set_current_action (MetaWaylandDataSource                  *source,
-                                             enum wl_data_device_manager_dnd_action  action)
+meta_wayland_data_source_set_current_action (
+  MetaWaylandDataSource                 *source,
+  enum wl_data_device_manager_dnd_action action)
 {
   MetaWaylandDataSourcePrivate *priv =
     meta_wayland_data_source_get_instance_private (source);
@@ -324,8 +326,9 @@ meta_wayland_data_source_set_actions (MetaWaylandDataSource *source,
 }
 
 static void
-meta_wayland_data_source_set_user_action (MetaWaylandDataSource                  *source,
-                                          enum wl_data_device_manager_dnd_action  action)
+meta_wayland_data_source_set_user_action (
+  MetaWaylandDataSource                 *source,
+  enum wl_data_device_manager_dnd_action action)
 {
   MetaWaylandDataSourcePrivate *priv =
     meta_wayland_data_source_get_instance_private (source);
@@ -342,10 +345,10 @@ meta_wayland_data_source_set_user_action (MetaWaylandDataSource
 }
 
 static void
-data_offer_accept (struct wl_client *client,
+data_offer_accept (struct wl_client   *client,
                    struct wl_resource *resource,
-                   guint32 serial,
-                   const char *mime_type)
+                   guint32             serial,
+                   const char         *mime_type)
 {
   MetaWaylandDataOffer *offer = wl_resource_get_user_data (resource);
 
@@ -384,7 +387,7 @@ default_destructor (struct wl_client   *client,
 
 static void
 data_offer_finish (struct wl_client   *client,
-                  struct wl_resource *resource)
+                   struct wl_resource *resource)
 {
   MetaWaylandDataOffer *offer = wl_resource_get_user_data (resource);
   enum wl_data_device_manager_dnd_action current_action;
@@ -447,7 +450,8 @@ data_offer_set_actions (struct wl_client   *client,
   data_offer_update_action (offer);
 }
 
-static const struct wl_data_offer_interface data_offer_interface = {
+static const struct wl_data_offer_interface data_offer_interface =
+{
   data_offer_accept,
   data_offer_receive,
   default_destructor,
@@ -481,7 +485,9 @@ primary_offer_receive (struct wl_client *client, struct wl_resource *resource,
   meta_wayland_data_source_send (offer->source, mime_type, fd);
 }
 
-static const struct gtk_primary_selection_offer_interface primary_offer_interface = {
+static const struct gtk_primary_selection_offer_interface
+  primary_offer_interface =
+{
   primary_offer_receive,
   default_destructor,
 };
@@ -522,7 +528,7 @@ destroy_data_offer (struct wl_resource *resource)
         }
 
       g_object_remove_weak_pointer (G_OBJECT (offer->source),
-                                    (gpointer *)&offer->source);
+                                    (gpointer *) &offer->source);
       offer->source = NULL;
     }
 
@@ -544,7 +550,7 @@ destroy_primary_offer (struct wl_resource *resource)
         }
 
       g_object_remove_weak_pointer (G_OBJECT (offer->source),
-                                    (gpointer *)&offer->source);
+                                    (gpointer *) &offer->source);
       offer->source = NULL;
     }
 
@@ -554,7 +560,7 @@ destroy_primary_offer (struct wl_resource *resource)
 
 static struct wl_resource *
 meta_wayland_data_source_send_offer (MetaWaylandDataSource *source,
-                                     struct wl_resource *target)
+                                     struct wl_resource    *target)
 {
   MetaWaylandDataSourcePrivate *priv =
     meta_wayland_data_source_get_instance_private (source);
@@ -562,7 +568,7 @@ meta_wayland_data_source_send_offer (MetaWaylandDataSource *source,
   char **p;
 
   offer->source = source;
-  g_object_add_weak_pointer (G_OBJECT (source), (gpointer *)&offer->source);
+  g_object_add_weak_pointer (G_OBJECT (source), (gpointer *) &offer->source);
   offer->resource = wl_resource_create (wl_resource_get_client (target),
                                         &wl_data_offer_interface,
                                         wl_resource_get_version (target), 0);
@@ -574,7 +580,7 @@ meta_wayland_data_source_send_offer (MetaWaylandDataSource *source,
   wl_data_device_send_data_offer (target, offer->resource);
 
   wl_array_for_each (p, &priv->mime_types)
-    wl_data_offer_send_offer (offer->resource, *p);
+  wl_data_offer_send_offer (offer->resource, *p);
 
   data_offer_update_action (offer);
   meta_wayland_data_source_set_current_offer (source, offer);
@@ -584,7 +590,7 @@ meta_wayland_data_source_send_offer (MetaWaylandDataSource *source,
 
 static struct wl_resource *
 meta_wayland_data_source_send_primary_offer (MetaWaylandDataSource *source,
-                                            struct wl_resource    *target)
+                                             struct wl_resource    *target)
 {
   MetaWaylandDataSourcePrivate *priv =
     meta_wayland_data_source_get_instance_private (source);
@@ -592,7 +598,7 @@ meta_wayland_data_source_send_primary_offer (MetaWaylandDataSource *source,
   char **p;
 
   offer->source = source;
-  g_object_add_weak_pointer (G_OBJECT (source), (gpointer *)&offer->source);
+  g_object_add_weak_pointer (G_OBJECT (source), (gpointer *) &offer->source);
   offer->resource = wl_resource_create (wl_resource_get_client (target),
                                         &gtk_primary_selection_offer_interface,
                                         wl_resource_get_version (target), 0);
@@ -604,7 +610,7 @@ meta_wayland_data_source_send_primary_offer (MetaWaylandDataSource *source,
   gtk_primary_selection_device_send_data_offer (target, offer->resource);
 
   wl_array_for_each (p, &priv->mime_types)
-    gtk_primary_selection_offer_send_offer (offer->resource, *p);
+  gtk_primary_selection_offer_send_offer (offer->resource, *p);
 
   meta_wayland_data_source_set_current_offer (source, offer);
 
@@ -660,7 +666,8 @@ data_source_set_actions (struct wl_client   *client,
   meta_wayland_data_source_set_actions (source, dnd_actions);
 }
 
-static struct wl_data_source_interface data_source_interface = {
+static struct wl_data_source_interface data_source_interface =
+{
   data_source_offer,
   default_destructor,
   data_source_set_actions
@@ -677,44 +684,47 @@ primary_source_offer (struct wl_client   *client,
     wl_resource_post_no_memory (resource);
 }
 
-static struct gtk_primary_selection_source_interface primary_source_interface = {
+static struct gtk_primary_selection_source_interface primary_source_interface =
+{
   primary_source_offer,
   default_destructor,
 };
 
-struct _MetaWaylandDragGrab {
-  MetaWaylandPointerGrab  generic;
+struct _MetaWaylandDragGrab
+{
+  MetaWaylandPointerGrab generic;
 
   MetaWaylandKeyboardGrab keyboard_grab;
 
-  MetaWaylandSeat        *seat;
-  struct wl_client       *drag_client;
+  MetaWaylandSeat *seat;
+  struct wl_client *drag_client;
 
-  MetaWaylandSurface     *drag_focus;
-  gulong                  drag_focus_destroy_handler_id;
-  struct wl_resource     *drag_focus_data_device;
-  struct wl_listener      drag_focus_listener;
+  MetaWaylandSurface *drag_focus;
+  gulong drag_focus_destroy_handler_id;
+  struct wl_resource *drag_focus_data_device;
+  struct wl_listener drag_focus_listener;
 
-  MetaWaylandSurface     *drag_surface;
-  struct wl_listener      drag_icon_listener;
+  MetaWaylandSurface *drag_surface;
+  struct wl_listener drag_icon_listener;
 
-  MetaWaylandDataSource  *drag_data_source;
+  MetaWaylandDataSource *drag_data_source;
 
-  ClutterActor           *feedback_actor;
+  ClutterActor *feedback_actor;
 
-  MetaWaylandSurface     *drag_origin;
-  struct wl_listener      drag_origin_listener;
+  MetaWaylandSurface *drag_origin;
+  struct wl_listener drag_origin_listener;
 
-  int                     drag_start_x, drag_start_y;
-  ClutterModifierType     buttons;
+  int drag_start_x, drag_start_y;
+  ClutterModifierType buttons;
 
-  guint                   need_initial_focus : 1;
+  guint need_initial_focus : 1;
 };
 
 static void
 destroy_drag_focus (struct wl_listener *listener, void *data)
 {
-  MetaWaylandDragGrab *grab = wl_container_of (listener, grab, drag_focus_listener);
+  MetaWaylandDragGrab *grab = wl_container_of (listener, grab,
+                                               drag_focus_listener);
 
   grab->drag_focus_data_device = NULL;
 
@@ -813,7 +823,8 @@ meta_wayland_drag_grab_set_focus (MetaWaylandDragGrab *drag_grab,
 
   client = wl_resource_get_client (surface->resource);
 
-  data_device_resource = wl_resource_find_for_client (&seat->data_device.resource_list, client);
+  data_device_resource = wl_resource_find_for_client (
+    &seat->data_device.resource_list, client);
 
   if (source && data_device_resource)
     offer = meta_wayland_data_source_send_offer (source, data_device_resource);
@@ -826,7 +837,8 @@ meta_wayland_drag_grab_set_focus (MetaWaylandDragGrab *drag_grab,
   drag_grab->drag_focus_data_device = data_device_resource;
 
   meta_wayland_surface_drag_dest_focus_in (drag_grab->drag_focus,
-                                           offer ? wl_resource_get_user_data (offer) : NULL);
+                                           offer ? wl_resource_get_user_data (
+                                             offer) : NULL);
 }
 
 MetaWaylandSurface *
@@ -847,7 +859,7 @@ static void
 drag_grab_focus (MetaWaylandPointerGrab *grab,
                  MetaWaylandSurface     *surface)
 {
-  MetaWaylandDragGrab *drag_grab = (MetaWaylandDragGrab*) grab;
+  MetaWaylandDragGrab *drag_grab = (MetaWaylandDragGrab *) grab;
 
   meta_wayland_drag_grab_set_focus (drag_grab, surface);
 }
@@ -870,9 +882,9 @@ data_source_update_user_dnd_action (MetaWaylandDataSource *source,
 
 static void
 drag_grab_motion (MetaWaylandPointerGrab *grab,
-                 const ClutterEvent     *event)
+                  const ClutterEvent     *event)
 {
-  MetaWaylandDragGrab *drag_grab = (MetaWaylandDragGrab*) grab;
+  MetaWaylandDragGrab *drag_grab = (MetaWaylandDragGrab *) grab;
 
   if (drag_grab->drag_focus)
     meta_wayland_surface_drag_dest_motion (drag_grab->drag_focus, event);
@@ -922,9 +934,9 @@ data_device_end_drag_grab (MetaWaylandDragGrab *drag_grab)
 }
 
 static gboolean
-on_fake_read_hup (GIOChannel   *channel,
-                  GIOCondition  condition,
-                  gpointer      data)
+on_fake_read_hup (GIOChannel  *channel,
+                  GIOCondition condition,
+                  gpointer     data)
 {
   MetaWaylandDataSource *source = data;
 
@@ -964,13 +976,14 @@ meta_wayland_data_source_fake_read (MetaWaylandDataSource *source,
 
 static void
 drag_grab_button (MetaWaylandPointerGrab *grab,
-                 const ClutterEvent     *event)
+                  const ClutterEvent     *event)
 {
-  MetaWaylandDragGrab *drag_grab = (MetaWaylandDragGrab*) grab;
+  MetaWaylandDragGrab *drag_grab = (MetaWaylandDragGrab *) grab;
   MetaWaylandSeat *seat = drag_grab->seat;
   ClutterEventType event_type = clutter_event_type (event);
 
-  if (drag_grab->generic.pointer->grab_button == clutter_event_get_button (event) &&
+  if (drag_grab->generic.pointer->grab_button ==
+      clutter_event_get_button (event) &&
       event_type == CLUTTER_BUTTON_RELEASE)
     {
       MetaWaylandDataSource *source = drag_grab->drag_data_source;
@@ -993,9 +1006,11 @@ drag_grab_button (MetaWaylandPointerGrab *grab,
       else if (!drag_grab->drag_focus && source &&
                meta_wayland_data_source_has_target (source) &&
                meta_wayland_data_source_get_current_action (source) &&
-               meta_wayland_data_source_has_mime_type (source, ROOTWINDOW_DROP_MIME))
+               meta_wayland_data_source_has_mime_type (source,
+                                                       ROOTWINDOW_DROP_MIME))
         {
-          /* Perform a fake read, that will lead to notify_finish() being called */
+          /* Perform a fake read, that will lead to notify_finish() being called
+           * */
           meta_wayland_data_source_fake_read (source, ROOTWINDOW_DROP_MIME);
           success = TRUE;
         }
@@ -1004,11 +1019,12 @@ drag_grab_button (MetaWaylandPointerGrab *grab,
           meta_wayland_data_source_cancel (source);
           meta_wayland_data_source_set_current_offer (source, NULL);
           meta_wayland_data_device_set_dnd_source (&seat->data_device, NULL);
-          success= FALSE;
+          success = FALSE;
         }
 
       /* Finish drag and let actor self-destruct */
-      meta_dnd_actor_drag_finish (META_DND_ACTOR (drag_grab->feedback_actor), success);
+      meta_dnd_actor_drag_finish (META_DND_ACTOR (
+                                    drag_grab->feedback_actor), success);
       drag_grab->feedback_actor = NULL;
     }
 
@@ -1017,7 +1033,8 @@ drag_grab_button (MetaWaylandPointerGrab *grab,
     data_device_end_drag_grab (drag_grab);
 }
 
-static const MetaWaylandPointerGrabInterface drag_grab_interface = {
+static const MetaWaylandPointerGrabInterface drag_grab_interface =
+{
   drag_grab_focus,
   drag_grab_motion,
   drag_grab_button,
@@ -1045,14 +1062,16 @@ keyboard_drag_grab_modifiers (MetaWaylandKeyboardGrab *grab,
 
   if (drag_grab->drag_data_source)
     {
-      data_source_update_user_dnd_action (drag_grab->drag_data_source, modifiers);
+      data_source_update_user_dnd_action (drag_grab->drag_data_source,
+                                          modifiers);
 
       if (drag_grab->drag_focus)
         meta_wayland_surface_drag_dest_update (drag_grab->drag_focus);
     }
 }
 
-static const MetaWaylandKeyboardGrabInterface keyboard_drag_grab_interface = {
+static const MetaWaylandKeyboardGrabInterface keyboard_drag_grab_interface =
+{
   keyboard_drag_grab_key,
   keyboard_drag_grab_modifiers
 };
@@ -1091,12 +1110,13 @@ destroy_data_device_icon (struct wl_listener *listener, void *data)
 }
 
 void
-meta_wayland_data_device_start_drag (MetaWaylandDataDevice                 *data_device,
-                                     struct wl_client                      *client,
-                                     const MetaWaylandPointerGrabInterface *funcs,
-                                     MetaWaylandSurface                    *surface,
-                                     MetaWaylandDataSource                 *source,
-                                     MetaWaylandSurface                    *icon_surface)
+meta_wayland_data_device_start_drag (
+  MetaWaylandDataDevice                 *data_device,
+  struct wl_client                      *client,
+  const MetaWaylandPointerGrabInterface *funcs,
+  MetaWaylandSurface                    *surface,
+  MetaWaylandDataSource                 *source,
+  MetaWaylandSurface                    *icon_surface)
 {
   MetaWaylandSeat *seat = wl_container_of (data_device, seat, data_device);
   MetaWaylandDragGrab *drag_grab;
@@ -1122,7 +1142,9 @@ meta_wayland_data_device_start_drag (MetaWaylandDataDevice                 *data
 
   surface_actor = meta_wayland_surface_get_actor (surface);
 
-  clutter_actor_transform_stage_point (CLUTTER_ACTOR (meta_surface_actor_get_texture (surface_actor)),
+  clutter_actor_transform_stage_point (CLUTTER_ACTOR (
+                                         meta_surface_actor_get_texture (
+                                           surface_actor)),
                                        seat->pointer->grab_x,
                                        seat->pointer->grab_y,
                                        &surface_pos.x, &surface_pos.y);
@@ -1133,8 +1155,9 @@ meta_wayland_data_device_start_drag (MetaWaylandDataDevice                 *data
 
   modifiers = clutter_input_device_get_modifier_state (seat->pointer->device);
   drag_grab->buttons = modifiers &
-    (CLUTTER_BUTTON1_MASK | CLUTTER_BUTTON2_MASK | CLUTTER_BUTTON3_MASK |
-     CLUTTER_BUTTON4_MASK | CLUTTER_BUTTON5_MASK);
+                       (CLUTTER_BUTTON1_MASK | CLUTTER_BUTTON2_MASK |
+                        CLUTTER_BUTTON3_MASK |
+                        CLUTTER_BUTTON4_MASK | CLUTTER_BUTTON5_MASK);
 
   meta_wayland_drag_grab_set_source (drag_grab, source);
   meta_wayland_data_device_set_dnd_source (data_device,
@@ -1151,22 +1174,25 @@ meta_wayland_data_device_start_drag (MetaWaylandDataDevice                 *data
       wl_resource_add_destroy_listener (icon_surface->resource,
                                         &drag_grab->drag_icon_listener);
 
-      drag_origin_actor = CLUTTER_ACTOR (meta_wayland_surface_get_actor (drag_grab->drag_origin));
+      drag_origin_actor =
+        CLUTTER_ACTOR (meta_wayland_surface_get_actor (drag_grab->drag_origin));
 
       drag_grab->feedback_actor = meta_dnd_actor_new (drag_origin_actor,
                                                       drag_grab->drag_start_x,
                                                       drag_grab->drag_start_y);
-      meta_feedback_actor_set_anchor (META_FEEDBACK_ACTOR (drag_grab->feedback_actor),
+      meta_feedback_actor_set_anchor (META_FEEDBACK_ACTOR (drag_grab->
+                                                           feedback_actor),
                                       0, 0);
       clutter_actor_add_child (drag_grab->feedback_actor, drag_origin_actor);
 
       clutter_input_device_get_coords (seat->pointer->device, NULL, &pos);
-      meta_feedback_actor_set_position (META_FEEDBACK_ACTOR (drag_grab->feedback_actor),
+      meta_feedback_actor_set_position (META_FEEDBACK_ACTOR (drag_grab->
+                                                             feedback_actor),
                                         pos.x, pos.y);
     }
 
   meta_wayland_pointer_start_grab (seat->pointer,
-                                   (MetaWaylandPointerGrab*) drag_grab);
+                                   (MetaWaylandPointerGrab *) drag_grab);
   meta_wayland_data_source_set_seat (source, seat);
 }
 
@@ -1249,7 +1275,8 @@ selection_data_source_destroyed (gpointer data, GObject *object_was_here)
   focus_client = meta_wayland_keyboard_get_focus_client (seat->keyboard);
   if (focus_client)
     {
-      data_device_resource = wl_resource_find_for_client (&data_device->resource_list, focus_client);
+      data_device_resource = wl_resource_find_for_client (
+        &data_device->resource_list, focus_client);
       if (data_device_resource)
         wl_data_device_send_selection (data_device_resource, NULL);
     }
@@ -1289,8 +1316,8 @@ meta_wayland_source_cancel (MetaWaylandDataSource *source)
 }
 
 static void
-meta_wayland_source_action (MetaWaylandDataSource                  *source,
-                            enum wl_data_device_manager_dnd_action  action)
+meta_wayland_source_action (MetaWaylandDataSource                 *source,
+                            enum wl_data_device_manager_dnd_action action)
 {
   MetaWaylandDataSourceWayland *source_wayland =
     META_WAYLAND_DATA_SOURCE_WAYLAND (source);
@@ -1336,12 +1363,14 @@ meta_wayland_source_finalize (GObject *object)
 }
 
 static void
-meta_wayland_data_source_wayland_init (MetaWaylandDataSourceWayland *source_wayland)
+meta_wayland_data_source_wayland_init (
+  MetaWaylandDataSourceWayland *source_wayland)
 {
 }
 
 static void
-meta_wayland_data_source_wayland_class_init (MetaWaylandDataSourceWaylandClass *klass)
+meta_wayland_data_source_wayland_class_init (
+  MetaWaylandDataSourceWaylandClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
   MetaWaylandDataSourceClass *data_source_class =
@@ -1380,12 +1409,14 @@ meta_wayland_data_source_primary_cancel (MetaWaylandDataSource *source)
 }
 
 static void
-meta_wayland_data_source_primary_init (MetaWaylandDataSourcePrimary *source_primary)
+meta_wayland_data_source_primary_init (
+  MetaWaylandDataSourcePrimary *source_primary)
 {
 }
 
 static void
-meta_wayland_data_source_primary_class_init (MetaWaylandDataSourcePrimaryClass *klass)
+meta_wayland_data_source_primary_class_init (
+  MetaWaylandDataSourcePrimaryClass *klass)
 {
   MetaWaylandDataSourceClass *data_source_class =
     META_WAYLAND_DATA_SOURCE_CLASS (klass);
@@ -1403,7 +1434,7 @@ meta_wayland_data_source_finalize (GObject *object)
   char **pos;
 
   wl_array_for_each (pos, &priv->mime_types)
-    g_free (*pos);
+  g_free (*pos);
   wl_array_release (&priv->mime_types);
 
   G_OBJECT_CLASS (meta_wayland_data_source_parent_class)->finalize (object);
@@ -1513,7 +1544,8 @@ meta_wayland_drag_dest_update (MetaWaylandDataDevice *data_device,
 {
 }
 
-static const MetaWaylandDragDestFuncs meta_wayland_drag_dest_funcs = {
+static const MetaWaylandDragDestFuncs meta_wayland_drag_dest_funcs =
+{
   meta_wayland_drag_dest_focus_in,
   meta_wayland_drag_dest_focus_out,
   meta_wayland_drag_dest_motion,
@@ -1536,13 +1568,13 @@ meta_wayland_data_device_set_dnd_source (MetaWaylandDataDevice *data_device,
 
   if (data_device->dnd_data_source)
     g_object_remove_weak_pointer (G_OBJECT (data_device->dnd_data_source),
-                                  (gpointer *)&data_device->dnd_data_source);
+                                  (gpointer *) &data_device->dnd_data_source);
 
   data_device->dnd_data_source = source;
 
   if (source)
     g_object_add_weak_pointer (G_OBJECT (data_device->dnd_data_source),
-                               (gpointer *)&data_device->dnd_data_source);
+                               (gpointer *) &data_device->dnd_data_source);
 
   wl_signal_emit (&data_device->dnd_ownership_signal, source);
 }
@@ -1550,7 +1582,7 @@ meta_wayland_data_device_set_dnd_source (MetaWaylandDataDevice *data_device,
 void
 meta_wayland_data_device_set_selection (MetaWaylandDataDevice *data_device,
                                         MetaWaylandDataSource *source,
-                                        guint32 serial)
+                                        guint32                serial)
 {
   MetaWaylandSeat *seat = wl_container_of (data_device, seat, data_device);
   struct wl_resource *data_device_resource, *offer;
@@ -1575,12 +1607,14 @@ meta_wayland_data_device_set_selection (MetaWaylandDataDevice *data_device,
   focus_client = meta_wayland_keyboard_get_focus_client (seat->keyboard);
   if (focus_client)
     {
-      data_device_resource = wl_resource_find_for_client (&data_device->resource_list, focus_client);
+      data_device_resource = wl_resource_find_for_client (
+        &data_device->resource_list, focus_client);
       if (data_device_resource)
         {
           if (data_device->selection_data_source)
             {
-              offer = meta_wayland_data_source_send_offer (data_device->selection_data_source, 
data_device_resource);
+              offer = meta_wayland_data_source_send_offer (
+                data_device->selection_data_source, data_device_resource);
               wl_data_device_send_selection (data_device_resource, offer);
             }
           else
@@ -1602,10 +1636,10 @@ meta_wayland_data_device_set_selection (MetaWaylandDataDevice *data_device,
 }
 
 static void
-data_device_set_selection (struct wl_client *client,
+data_device_set_selection (struct wl_client   *client,
                            struct wl_resource *resource,
                            struct wl_resource *source_resource,
-                           guint32 serial)
+                           guint32             serial)
 {
   MetaWaylandDataDevice *data_device = wl_resource_get_user_data (resource);
   MetaWaylandDataSourcePrivate *priv;
@@ -1622,9 +1656,9 @@ data_device_set_selection (struct wl_client *client,
 
       if (priv->actions_set)
         {
-          wl_resource_post_error(source_resource,
-                                 WL_DATA_SOURCE_ERROR_INVALID_SOURCE,
-                                 "cannot set drag-and-drop source as selection");
+          wl_resource_post_error (source_resource,
+                                  WL_DATA_SOURCE_ERROR_INVALID_SOURCE,
+                                  "cannot set drag-and-drop source as selection");
           return;
         }
     }
@@ -1633,15 +1667,16 @@ data_device_set_selection (struct wl_client *client,
   meta_wayland_data_device_set_selection (data_device, source, serial);
 }
 
-static const struct wl_data_device_interface data_device_interface = {
+static const struct wl_data_device_interface data_device_interface =
+{
   data_device_start_drag,
   data_device_set_selection,
   default_destructor,
 };
 
 static void
-primary_source_destroyed (gpointer  data,
-                          GObject  *object_was_here)
+primary_source_destroyed (gpointer data,
+                          GObject *object_was_here)
 {
   MetaWaylandDataDevice *data_device = data;
   MetaWaylandSeat *seat = wl_container_of (data_device, seat, data_device);
@@ -1654,9 +1689,11 @@ primary_source_destroyed (gpointer  data,
     {
       struct wl_resource *data_device_resource;
 
-      data_device_resource = wl_resource_find_for_client (&data_device->primary_resource_list, focus_client);
+      data_device_resource = wl_resource_find_for_client (
+        &data_device->primary_resource_list, focus_client);
       if (data_device_resource)
-        gtk_primary_selection_device_send_selection (data_device_resource, NULL);
+        gtk_primary_selection_device_send_selection (data_device_resource,
+                                                     NULL);
     }
 
   wl_signal_emit (&data_device->primary_ownership_signal, NULL);
@@ -1700,18 +1737,22 @@ meta_wayland_data_device_set_primary (MetaWaylandDataDevice *data_device,
   focus_client = meta_wayland_keyboard_get_focus_client (seat->keyboard);
   if (focus_client)
     {
-      data_device_resource = wl_resource_find_for_client (&data_device->primary_resource_list, focus_client);
+      data_device_resource = wl_resource_find_for_client (
+        &data_device->primary_resource_list, focus_client);
       if (data_device_resource)
         {
           if (data_device->primary_data_source)
             {
-              offer = meta_wayland_data_source_send_primary_offer (data_device->primary_data_source,
-                                                                   data_device_resource);
-              gtk_primary_selection_device_send_selection (data_device_resource, offer);
+              offer = meta_wayland_data_source_send_primary_offer (
+                data_device->primary_data_source,
+                data_device_resource);
+              gtk_primary_selection_device_send_selection (data_device_resource,
+                                                           offer);
             }
           else
             {
-              gtk_primary_selection_device_send_selection (data_device_resource, NULL);
+              gtk_primary_selection_device_send_selection (data_device_resource,
+                                                           NULL);
             }
         }
     }
@@ -1740,7 +1781,9 @@ primary_device_set_selection (struct wl_client   *client,
   meta_wayland_data_device_set_primary (data_device, source, serial);
 }
 
-static const struct gtk_primary_selection_device_interface primary_device_interface = {
+static const struct gtk_primary_selection_device_interface
+  primary_device_interface =
+{
   primary_device_set_selection,
   default_destructor,
 };
@@ -1773,12 +1816,15 @@ get_data_device (struct wl_client *client,
   MetaWaylandSeat *seat = wl_resource_get_user_data (seat_resource);
   struct wl_resource *cr;
 
-  cr = wl_resource_create (client, &wl_data_device_interface, wl_resource_get_version (manager_resource), 
id);
-  wl_resource_set_implementation (cr, &data_device_interface, &seat->data_device, unbind_resource);
+  cr = wl_resource_create (client, &wl_data_device_interface, wl_resource_get_version (
+                             manager_resource), id);
+  wl_resource_set_implementation (cr, &data_device_interface,
+                                  &seat->data_device, unbind_resource);
   wl_list_insert (&seat->data_device.resource_list, wl_resource_get_link (cr));
 }
 
-static const struct wl_data_device_manager_interface manager_interface = {
+static const struct wl_data_device_manager_interface manager_interface =
+{
   create_data_source,
   get_data_device
 };
@@ -1819,10 +1865,13 @@ primary_device_manager_get_device (struct wl_client   *client,
                            wl_resource_get_version (manager_resource), id);
   wl_resource_set_implementation (cr, &primary_device_interface,
                                   &seat->data_device, unbind_resource);
-  wl_list_insert (&seat->data_device.primary_resource_list, wl_resource_get_link (cr));
+  wl_list_insert (&seat->data_device.primary_resource_list, wl_resource_get_link (
+                    cr));
 }
 
-static const struct gtk_primary_selection_device_manager_interface primary_manager_interface = {
+static const struct gtk_primary_selection_device_manager_interface
+  primary_manager_interface =
+{
   primary_device_manager_create_source,
   primary_device_manager_get_device,
   default_destructor,
@@ -1833,7 +1882,8 @@ bind_manager (struct wl_client *client,
               void *data, guint32 version, guint32 id)
 {
   struct wl_resource *resource;
-  resource = wl_resource_create (client, &wl_data_device_manager_interface, version, id);
+  resource = wl_resource_create (client, &wl_data_device_manager_interface,
+                                 version, id);
   wl_resource_set_implementation (resource, &manager_interface, NULL, NULL);
 }
 
@@ -1845,23 +1895,25 @@ bind_primary_manager (struct wl_client *client,
 {
   struct wl_resource *resource;
 
-  resource = wl_resource_create (client, &gtk_primary_selection_device_manager_interface,
+  resource = wl_resource_create (client,
+                                 &gtk_primary_selection_device_manager_interface,
                                  version, id);
-  wl_resource_set_implementation (resource, &primary_manager_interface, NULL, NULL);
+  wl_resource_set_implementation (resource, &primary_manager_interface, NULL,
+                                  NULL);
 }
 
 void
 meta_wayland_data_device_manager_init (MetaWaylandCompositor *compositor)
 {
   if (wl_global_create (compositor->wayland_display,
-                       &wl_data_device_manager_interface,
-                       META_WL_DATA_DEVICE_MANAGER_VERSION,
-                       NULL, bind_manager) == NULL)
+                        &wl_data_device_manager_interface,
+                        META_WL_DATA_DEVICE_MANAGER_VERSION,
+                        NULL, bind_manager) == NULL)
     g_error ("Could not create data_device");
 
   if (wl_global_create (compositor->wayland_display,
-                       &gtk_primary_selection_device_manager_interface,
-                       1, NULL, bind_primary_manager) == NULL)
+                        &gtk_primary_selection_device_manager_interface,
+                        1, NULL, bind_primary_manager) == NULL)
     g_error ("Could not create data_device");
 }
 
@@ -1893,13 +1945,15 @@ meta_wayland_data_device_set_keyboard_focus (MetaWaylandDataDevice *data_device)
   if (!focus_client)
     return;
 
-  data_device_resource = wl_resource_find_for_client (&data_device->resource_list, focus_client);
+  data_device_resource = wl_resource_find_for_client (
+    &data_device->resource_list, focus_client);
   if (data_device_resource)
     {
       source = data_device->selection_data_source;
       if (source)
         {
-          offer = meta_wayland_data_source_send_offer (source, data_device_resource);
+          offer = meta_wayland_data_source_send_offer (source,
+                                                       data_device_resource);
           wl_data_device_send_selection (data_device_resource, offer);
         }
       else
@@ -1908,18 +1962,22 @@ meta_wayland_data_device_set_keyboard_focus (MetaWaylandDataDevice *data_device)
         }
     }
 
-  data_device_resource = wl_resource_find_for_client (&data_device->primary_resource_list, focus_client);
+  data_device_resource = wl_resource_find_for_client (
+    &data_device->primary_resource_list, focus_client);
   if (data_device_resource)
     {
       source = data_device->primary_data_source;
       if (source)
         {
-          offer = meta_wayland_data_source_send_primary_offer (source, data_device_resource);
-          gtk_primary_selection_device_send_selection (data_device_resource, offer);
+          offer = meta_wayland_data_source_send_primary_offer (source,
+                                                               data_device_resource);
+          gtk_primary_selection_device_send_selection (data_device_resource,
+                                                       offer);
         }
       else
         {
-          gtk_primary_selection_device_send_selection (data_device_resource, NULL);
+          gtk_primary_selection_device_send_selection (data_device_resource,
+                                                       NULL);
         }
     }
 }
@@ -1929,7 +1987,7 @@ meta_wayland_data_device_is_dnd_surface (MetaWaylandDataDevice *data_device,
                                          MetaWaylandSurface    *surface)
 {
   return data_device->current_grab &&
-    data_device->current_grab->drag_surface == surface;
+         data_device->current_grab->drag_surface == surface;
 }
 
 MetaWaylandDragGrab *
@@ -1943,14 +2001,15 @@ meta_wayland_data_source_has_mime_type (const MetaWaylandDataSource *source,
                                         const gchar                 *mime_type)
 {
   MetaWaylandDataSourcePrivate *priv =
-    meta_wayland_data_source_get_instance_private ((MetaWaylandDataSource *)source);
+    meta_wayland_data_source_get_instance_private (
+      (MetaWaylandDataSource *) source);
   gchar **p;
 
   wl_array_for_each (p, &priv->mime_types)
-    {
-      if (g_strcmp0 (mime_type, *p) == 0)
-        return TRUE;
-    }
+  {
+    if (g_strcmp0 (mime_type, *p) == 0)
+      return TRUE;
+  }
 
   return FALSE;
 }
@@ -1959,7 +2018,7 @@ static MetaWaylandDataSource *
 meta_wayland_data_source_wayland_new (struct wl_resource *resource)
 {
   MetaWaylandDataSourceWayland *source_wayland =
-   g_object_new (META_TYPE_WAYLAND_DATA_SOURCE_WAYLAND, NULL);
+    g_object_new (META_TYPE_WAYLAND_DATA_SOURCE_WAYLAND, NULL);
 
   source_wayland->resource = resource;
   wl_resource_set_implementation (resource, &data_source_interface,
diff --git a/src/wayland/meta-wayland-dma-buf.c b/src/wayland/meta-wayland-dma-buf.c
index 5f168f674..969f74fd2 100644
--- a/src/wayland/meta-wayland-dma-buf.c
+++ b/src/wayland/meta-wayland-dma-buf.c
@@ -62,7 +62,8 @@ struct _MetaWaylandDmaBufBuffer
   unsigned int strides[META_WAYLAND_DMA_BUF_MAX_FDS];
 };
 
-G_DEFINE_TYPE (MetaWaylandDmaBufBuffer, meta_wayland_dma_buf_buffer, G_TYPE_OBJECT);
+G_DEFINE_TYPE (MetaWaylandDmaBufBuffer, meta_wayland_dma_buf_buffer,
+               G_TYPE_OBJECT);
 
 gboolean
 meta_wayland_dma_buf_buffer_attach (MetaWaylandBuffer *buffer,
@@ -71,7 +72,8 @@ meta_wayland_dma_buf_buffer_attach (MetaWaylandBuffer *buffer,
   MetaBackend *backend = meta_get_backend ();
   MetaEgl *egl = meta_backend_get_egl (backend);
   ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
-  CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend);
+  CoglContext *cogl_context =
+    clutter_backend_get_cogl_context (clutter_backend);
   EGLDisplay egl_display = cogl_egl_context_get_egl_display (cogl_context);
   MetaWaylandDmaBufBuffer *dma_buf = buffer->dma_buf.dma_buf;
   CoglPixelFormat cogl_format;
@@ -289,7 +291,7 @@ meta_wayland_dma_buf_from_buffer (MetaWaylandBuffer *buffer)
 {
   if (wl_resource_instance_of (buffer->resource, &wl_buffer_interface,
                                &dma_buf_buffer_impl))
-      return wl_resource_get_user_data (buffer->resource);
+    return wl_resource_get_user_data (buffer->resource);
 
   return NULL;
 }
@@ -380,16 +382,16 @@ buffer_params_create_common (struct wl_client   *client,
                                   error ? error->message : "unknown error");
         }
 
-        /* will unref the MetaWaylandBuffer */
-        wl_resource_destroy (buffer->resource);
-        return;
+      /* will unref the MetaWaylandBuffer */
+      wl_resource_destroy (buffer->resource);
+      return;
     }
 
-    /* If buffer_id is 0, we are using the non-immediate interface, so
-     * need to send a success event with our buffer. */
-    if (buffer_id == 0)
-      zwp_linux_buffer_params_v1_send_created (params_resource,
-                                               buffer->resource);
+  /* If buffer_id is 0, we are using the non-immediate interface, so
+   * need to send a success event with our buffer. */
+  if (buffer_id == 0)
+    zwp_linux_buffer_params_v1_send_created (params_resource,
+                                             buffer->resource);
 }
 
 static void
@@ -417,7 +419,8 @@ buffer_params_create_immed (struct wl_client   *client,
                                height, format, flags);
 }
 
-static const struct zwp_linux_buffer_params_v1_interface buffer_params_implementation =
+static const struct zwp_linux_buffer_params_v1_interface
+  buffer_params_implementation =
 {
   buffer_params_destroy,
   buffer_params_add,
@@ -466,7 +469,8 @@ send_modifiers (struct wl_resource *resource,
   MetaBackend *backend = meta_get_backend ();
   MetaEgl *egl = meta_backend_get_egl (backend);
   ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
-  CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend);
+  CoglContext *cogl_context =
+    clutter_backend_get_cogl_context (clutter_backend);
   EGLDisplay egl_display = cogl_egl_context_get_egl_display (cogl_context);
   EGLint num_modifiers;
   EGLuint64KHR *modifiers;
@@ -478,7 +482,8 @@ send_modifiers (struct wl_resource *resource,
 
   /* The modifier event was only added in v3; v1 and v2 only have the format
    * event. */
-  if (wl_resource_get_version (resource) < ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION)
+  if (wl_resource_get_version (resource) <
+      ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION)
     return;
 
   /* First query the number of available modifiers, then allocate an array,
@@ -535,7 +540,8 @@ meta_wayland_dma_buf_init (MetaWaylandCompositor *compositor)
   MetaBackend *backend = meta_get_backend ();
   MetaEgl *egl = meta_backend_get_egl (backend);
   ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
-  CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend);
+  CoglContext *cogl_context =
+    clutter_backend_get_cogl_context (clutter_backend);
   EGLDisplay egl_display = cogl_egl_context_get_egl_display (cogl_context);
 
   g_assert (backend && egl && clutter_backend && cogl_context && egl_display);
diff --git a/src/wayland/meta-wayland-egl-stream.c b/src/wayland/meta-wayland-egl-stream.c
index 3f8908e67..e8cba2bb9 100644
--- a/src/wayland/meta-wayland-egl-stream.c
+++ b/src/wayland/meta-wayland-egl-stream.c
@@ -53,7 +53,8 @@ attach_eglstream_consumer (struct wl_client   *client,
 }
 
 static const struct wl_eglstream_controller_interface
-meta_eglstream_controller_interface = {
+  meta_eglstream_controller_interface =
+{
   attach_eglstream_consumer
 };
 
@@ -74,7 +75,7 @@ bind_eglstream_controller (struct wl_client *client,
 
   if (resource == NULL)
     {
-      wl_client_post_no_memory(client);
+      wl_client_post_no_memory (client);
       return;
     }
 
@@ -119,7 +120,7 @@ meta_wayland_eglstream_controller_init (MetaWaylandCompositor *compositor)
 
 fail:
   if (lib)
-    dlclose(lib);
+    dlclose (lib);
 
   g_debug ("WL: Unable to initialize wl_eglstream_controller.");
 
@@ -140,15 +141,17 @@ G_DEFINE_TYPE (MetaWaylandEglStream, meta_wayland_egl_stream,
                G_TYPE_OBJECT)
 
 MetaWaylandEglStream *
-meta_wayland_egl_stream_new (MetaWaylandBuffer *buffer,
-                             GError           **error)
+meta_wayland_egl_stream_new (MetaWaylandBuffer * buffer,
+                             GError * *error)
 {
   MetaBackend *backend = meta_get_backend ();
   MetaEgl *egl = meta_backend_get_egl (backend);
   ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
-  CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend);
+  CoglContext *cogl_context =
+    clutter_backend_get_cogl_context (clutter_backend);
   EGLDisplay egl_display = cogl_egl_context_get_egl_display (cogl_context);
-  EGLAttrib stream_attribs[] = {
+  EGLAttrib stream_attribs[] =
+  {
     EGL_WAYLAND_EGLSTREAM_WL, (EGLAttrib) buffer->resource,
     EGL_NONE
   };
@@ -190,7 +193,8 @@ alloc_egl_stream_texture (CoglTexture2D *texture,
   MetaBackend *backend = meta_get_backend ();
   MetaEgl *egl = meta_backend_get_egl (backend);
   ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
-  CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend);
+  CoglContext *cogl_context =
+    clutter_backend_get_cogl_context (clutter_backend);
   EGLDisplay egl_display = cogl_egl_context_get_egl_display (cogl_context);
   MetaWaylandEglStream *stream = user_data;
 
@@ -206,7 +210,8 @@ meta_wayland_egl_stream_create_texture (MetaWaylandEglStream *stream,
   MetaBackend *backend = meta_get_backend ();
   MetaEgl *egl = meta_backend_get_egl (backend);
   ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
-  CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend);
+  CoglContext *cogl_context =
+    clutter_backend_get_cogl_context (clutter_backend);
   EGLDisplay egl_display = cogl_egl_context_get_egl_display (cogl_context);
   CoglTexture2D *texture;
   int width, height;
@@ -262,7 +267,8 @@ meta_wayland_egl_stream_attach (MetaWaylandEglStream *stream,
   MetaBackend *backend = meta_get_backend ();
   MetaEgl *egl = meta_backend_get_egl (backend);
   ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
-  CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend);
+  CoglContext *cogl_context =
+    clutter_backend_get_cogl_context (clutter_backend);
   EGLDisplay egl_display = cogl_egl_context_get_egl_display (cogl_context);
   EGLint stream_state;
 
@@ -309,7 +315,8 @@ meta_wayland_is_egl_stream_buffer (MetaWaylandBuffer *buffer)
   MetaBackend *backend = meta_get_backend ();
   MetaEgl *egl = meta_backend_get_egl (backend);
   ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
-  CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend);
+  CoglContext *cogl_context =
+    clutter_backend_get_cogl_context (clutter_backend);
   EGLDisplay egl_display = cogl_egl_context_get_egl_display (cogl_context);
   int stream_fd;
 
@@ -334,7 +341,8 @@ meta_wayland_egl_stream_finalize (GObject *object)
   MetaBackend *backend = meta_get_backend ();
   MetaEgl *egl = meta_backend_get_egl (backend);
   ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
-  CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend);
+  CoglContext *cogl_context =
+    clutter_backend_get_cogl_context (clutter_backend);
   EGLDisplay egl_display = cogl_egl_context_get_egl_display (cogl_context);
 
   g_assert (!stream->texture);
diff --git a/src/wayland/meta-wayland-gtk-shell.c b/src/wayland/meta-wayland-gtk-shell.c
index f53818265..29d2faf02 100644
--- a/src/wayland/meta-wayland-gtk-shell.c
+++ b/src/wayland/meta-wayland-gtk-shell.c
@@ -141,7 +141,8 @@ gtk_surface_present (struct wl_client   *client,
                              META_CLIENT_TYPE_APPLICATION, NULL);
 }
 
-static const struct gtk_surface1_interface meta_wayland_gtk_surface_interface = {
+static const struct gtk_surface1_interface meta_wayland_gtk_surface_interface =
+{
   gtk_surface_set_dbus_properties,
   gtk_surface_set_modal,
   gtk_surface_unset_modal,
@@ -202,8 +203,8 @@ send_configure_edges (MetaWaylandGtkSurface *gtk_surface,
 }
 
 static void
-add_state_value (struct wl_array         *states,
-                 enum gtk_surface1_state  state)
+add_state_value (struct wl_array        *states,
+                 enum gtk_surface1_state state)
 {
   uint32_t *s;
 
@@ -263,7 +264,8 @@ on_configure (MetaWaylandSurface    *surface,
   send_configure (gtk_surface, surface->window);
 
 
-  if (wl_resource_get_version (gtk_surface->resource) >= GTK_SURFACE1_CONFIGURE_EDGES_SINCE_VERSION)
+  if (wl_resource_get_version (gtk_surface->resource) >=
+      GTK_SURFACE1_CONFIGURE_EDGES_SINCE_VERSION)
     send_configure_edges (gtk_surface, surface->window);
 }
 
@@ -289,7 +291,8 @@ gtk_shell_get_gtk_surface (struct wl_client   *client,
   gtk_surface->surface = surface;
   gtk_surface->resource = wl_resource_create (client,
                                               &gtk_surface1_interface,
-                                              wl_resource_get_version (resource),
+                                              wl_resource_get_version (
+                                                resource),
                                               id);
   wl_resource_set_implementation (gtk_surface->resource,
                                   &meta_wayland_gtk_surface_interface,
@@ -297,7 +300,8 @@ gtk_shell_get_gtk_surface (struct wl_client   *client,
 
   gtk_surface->configure_handler_id = g_signal_connect (surface,
                                                         "configure",
-                                                        G_CALLBACK (on_configure),
+                                                        G_CALLBACK (
+                                                          on_configure),
                                                         gtk_surface);
 
   g_object_set_qdata_full (G_OBJECT (surface),
@@ -342,7 +346,8 @@ gtk_shell_system_bell (struct wl_client   *client,
     }
 }
 
-static const struct gtk_shell1_interface meta_wayland_gtk_shell_interface = {
+static const struct gtk_shell1_interface meta_wayland_gtk_shell_interface =
+{
   gtk_shell_get_gtk_surface,
   gtk_shell_set_startup_id,
   gtk_shell_system_bell,
diff --git a/src/wayland/meta-wayland-inhibit-shortcuts-dialog.c 
b/src/wayland/meta-wayland-inhibit-shortcuts-dialog.c
index 659f5778c..a74812e16 100644
--- a/src/wayland/meta-wayland-inhibit-shortcuts-dialog.c
+++ b/src/wayland/meta-wayland-inhibit-shortcuts-dialog.c
@@ -27,12 +27,12 @@ static GQuark quark_surface_inhibit_shortcuts_data = 0;
 
 typedef struct _InhibitShortcutsData
 {
-  MetaWaylandSurface                *surface;
-  MetaWaylandSeat                   *seat;
-  MetaInhibitShortcutsDialog        *dialog;
-  gulong                             response_handler_id;
-  gboolean                           has_last_response;
-  gboolean                           request_canceled;
+  MetaWaylandSurface *surface;
+  MetaWaylandSeat *seat;
+  MetaInhibitShortcutsDialog *dialog;
+  gulong response_handler_id;
+  gboolean has_last_response;
+  gboolean request_canceled;
   MetaInhibitShortcutsDialogResponse last_response;
 } InhibitShortcutsData;
 
@@ -83,7 +83,8 @@ inhibit_shortcuts_dialog_response_apply (InhibitShortcutsData *data)
 {
   if (data->last_response == META_INHIBIT_SHORTCUTS_DIALOG_RESPONSE_ALLOW)
     meta_wayland_surface_inhibit_shortcuts (data->surface, data->seat);
-  else if (meta_wayland_surface_is_shortcuts_inhibited (data->surface, data->seat))
+  else if (meta_wayland_surface_is_shortcuts_inhibited (data->surface,
+                                                        data->seat))
     meta_wayland_surface_restore_shortcuts (data->surface, data->seat);
 }
 
@@ -104,8 +105,9 @@ inhibit_shortcuts_dialog_response_cb (MetaInhibitShortcutsDialog        *dialog,
 }
 
 static InhibitShortcutsData *
-meta_wayland_surface_ensure_inhibit_shortcuts_dialog (MetaWaylandSurface *surface,
-                                                      MetaWaylandSeat    *seat)
+meta_wayland_surface_ensure_inhibit_shortcuts_dialog (
+  MetaWaylandSurface *surface,
+  MetaWaylandSeat    *seat)
 {
   InhibitShortcutsData *data;
   MetaWindow *window;
@@ -165,7 +167,8 @@ meta_wayland_surface_show_inhibit_shortcuts_dialog (MetaWaylandSurface *surface,
 }
 
 void
-meta_wayland_surface_cancel_inhibit_shortcuts_dialog (MetaWaylandSurface *surface)
+meta_wayland_surface_cancel_inhibit_shortcuts_dialog (
+  MetaWaylandSurface *surface)
 {
   InhibitShortcutsData *data;
 
diff --git a/src/wayland/meta-wayland-inhibit-shortcuts.c b/src/wayland/meta-wayland-inhibit-shortcuts.c
index ff00b1b15..ca5e6f9f4 100644
--- a/src/wayland/meta-wayland-inhibit-shortcuts.c
+++ b/src/wayland/meta-wayland-inhibit-shortcuts.c
@@ -33,12 +33,12 @@
 
 struct _MetaWaylandKeyboardShotscutsInhibit
 {
-  MetaWaylandSurface      *surface;
-  MetaWaylandSeat         *seat;
-  gulong                   inhibit_shortcut_handler;
-  gulong                   restore_shortcut_handler;
-  gulong                   surface_destroyed_handler;
-  struct wl_resource      *resource;
+  MetaWaylandSurface *surface;
+  MetaWaylandSeat *seat;
+  gulong inhibit_shortcut_handler;
+  gulong restore_shortcut_handler;
+  gulong surface_destroyed_handler;
+  struct wl_resource *resource;
 };
 
 static void
@@ -49,7 +49,8 @@ zwp_keyboard_shortcuts_inhibit_destructor (struct wl_resource *resource)
   shortcut_inhibit = wl_resource_get_user_data (resource);
   if (shortcut_inhibit->surface)
     {
-      meta_wayland_surface_cancel_inhibit_shortcuts_dialog (shortcut_inhibit->surface);
+      meta_wayland_surface_cancel_inhibit_shortcuts_dialog (
+        shortcut_inhibit->surface);
 
       g_signal_handler_disconnect (shortcut_inhibit->surface,
                                    shortcut_inhibit->surface_destroyed_handler);
@@ -74,9 +75,10 @@ zwp_keyboard_shortcuts_inhibit_destroy (struct wl_client   *client,
 }
 
 static const struct zwp_keyboard_shortcuts_inhibit_manager_v1_interface
-  meta_keyboard_shortcuts_inhibit_interface = {
-    zwp_keyboard_shortcuts_inhibit_destroy,
-  };
+  meta_keyboard_shortcuts_inhibit_interface =
+{
+  zwp_keyboard_shortcuts_inhibit_destroy,
+};
 
 static void
 surface_destroyed_cb (MetaWaylandSurface                  *surface,
@@ -108,11 +110,12 @@ zwp_keyboard_shortcuts_inhibit_manager_destroy (struct wl_client   *client,
 }
 
 static void
-zwp_keyboard_shortcuts_inhibit_manager_inhibit_shortcuts (struct wl_client   *client,
-                                                          struct wl_resource *resource,
-                                                          uint32_t            id,
-                                                          struct wl_resource *surface_resource,
-                                                          struct wl_resource *seat_resource)
+zwp_keyboard_shortcuts_inhibit_manager_inhibit_shortcuts (
+  struct wl_client   *client,
+  struct wl_resource *resource,
+  uint32_t            id,
+  struct wl_resource *surface_resource,
+  struct wl_resource *seat_resource)
 {
   MetaWaylandKeyboardShotscutsInhibit *shortcut_inhibit;
   MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource);
@@ -120,10 +123,10 @@ zwp_keyboard_shortcuts_inhibit_manager_inhibit_shortcuts (struct wl_client   *cl
   struct wl_resource *keyboard_shortcuts_inhibit_resource;
 
   keyboard_shortcuts_inhibit_resource =
-      wl_resource_create (client,
-                          &zwp_keyboard_shortcuts_inhibitor_v1_interface,
-                          META_ZWP_KEYBOARD_SHORTCUTS_INHIBIT_V1_VERSION,
-                          id);
+    wl_resource_create (client,
+                        &zwp_keyboard_shortcuts_inhibitor_v1_interface,
+                        META_ZWP_KEYBOARD_SHORTCUTS_INHIBIT_V1_VERSION,
+                        id);
 
   shortcut_inhibit = g_new0 (MetaWaylandKeyboardShotscutsInhibit, 1);
   shortcut_inhibit->surface = surface;
@@ -154,10 +157,11 @@ zwp_keyboard_shortcuts_inhibit_manager_inhibit_shortcuts (struct wl_client   *cl
 }
 
 static const struct zwp_keyboard_shortcuts_inhibit_manager_v1_interface
-  meta_keyboard_shortcuts_inhibit_manager_interface = {
-    zwp_keyboard_shortcuts_inhibit_manager_destroy,
-    zwp_keyboard_shortcuts_inhibit_manager_inhibit_shortcuts,
-  };
+  meta_keyboard_shortcuts_inhibit_manager_interface =
+{
+  zwp_keyboard_shortcuts_inhibit_manager_destroy,
+  zwp_keyboard_shortcuts_inhibit_manager_inhibit_shortcuts,
+};
 
 static void
 bind_keyboard_shortcuts_inhibit (struct wl_client *client,
diff --git a/src/wayland/meta-wayland-input-device.c b/src/wayland/meta-wayland-input-device.c
index b82f204cf..b1e449db1 100644
--- a/src/wayland/meta-wayland-input-device.c
+++ b/src/wayland/meta-wayland-input-device.c
@@ -47,7 +47,7 @@ G_DEFINE_TYPE_WITH_PRIVATE (MetaWaylandInputDevice,
                             G_TYPE_OBJECT)
 
 MetaWaylandSeat *
-meta_wayland_input_device_get_seat (MetaWaylandInputDevice *input_device)
+meta_wayland_input_device_get_seat (MetaWaylandInputDevice * input_device)
 {
   MetaWaylandInputDevicePrivate *priv =
     meta_wayland_input_device_get_instance_private (input_device);
@@ -85,7 +85,7 @@ meta_wayland_input_device_set_property (GObject      *object,
 }
 
 static void
-meta_wayland_input_device_get_property (GObject      *object,
+meta_wayland_input_device_get_property (GObject    *object,
                                         guint       prop_id,
                                         GValue     *value,
                                         GParamSpec *pspec)
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c
index 8b23d76ce..a16259bd1 100644
--- a/src/wayland/meta-wayland-keyboard.c
+++ b/src/wayland/meta-wayland-keyboard.c
@@ -75,7 +75,8 @@ typedef enum
 G_DEFINE_TYPE (MetaWaylandKeyboard, meta_wayland_keyboard,
                META_TYPE_WAYLAND_INPUT_DEVICE)
 
-static void meta_wayland_keyboard_update_xkb_state (MetaWaylandKeyboard *keyboard);
+static void meta_wayland_keyboard_update_xkb_state (
+  MetaWaylandKeyboard *keyboard);
 static void meta_wayland_keyboard_set_numlock (MetaWaylandKeyboard *keyboard,
                                                gboolean             numlock_state);
 static void notify_modifiers (MetaWaylandKeyboard *keyboard);
@@ -115,7 +116,7 @@ create_anonymous_file (off_t    size,
 
   return fd;
 
- err:
+err:
   g_set_error_literal (error,
                        G_FILE_ERROR,
                        g_file_error_from_errno (errno),
@@ -175,14 +176,14 @@ inform_clients_of_new_keymap (MetaWaylandKeyboard *keyboard)
   struct wl_resource *keyboard_resource;
 
   wl_resource_for_each (keyboard_resource, &keyboard->resource_list)
-    send_keymap (keyboard, keyboard_resource);
+  send_keymap (keyboard, keyboard_resource);
   wl_resource_for_each (keyboard_resource, &keyboard->focus_resource_list)
-    send_keymap (keyboard, keyboard_resource);
+  send_keymap (keyboard, keyboard_resource);
 }
 
 static void
 meta_wayland_keyboard_take_keymap (MetaWaylandKeyboard *keyboard,
-                                  struct xkb_keymap   *keymap)
+                                   struct xkb_keymap   *keymap)
 {
   MetaWaylandXkbInfo *xkb_info = &keyboard->xkb_info;
 
@@ -218,22 +219,29 @@ kbd_a11y_apply_mask (MetaWaylandKeyboard *keyboard)
   xkb_mod_mask_t latched, locked, depressed, group;
   xkb_mod_mask_t update_mask = 0;
 
-  depressed = xkb_state_serialize_mods(keyboard->xkb_info.state, XKB_STATE_DEPRESSED);
-  latched = xkb_state_serialize_mods (keyboard->xkb_info.state, XKB_STATE_MODS_LATCHED);
-  locked = xkb_state_serialize_mods (keyboard->xkb_info.state, XKB_STATE_MODS_LOCKED);
-  group = xkb_state_serialize_layout (keyboard->xkb_info.state, XKB_STATE_LAYOUT_EFFECTIVE);
-
-  if ((latched & keyboard->kbd_a11y_latched_mods) != keyboard->kbd_a11y_latched_mods)
+  depressed = xkb_state_serialize_mods (keyboard->xkb_info.state,
+                                        XKB_STATE_DEPRESSED);
+  latched = xkb_state_serialize_mods (keyboard->xkb_info.state,
+                                      XKB_STATE_MODS_LATCHED);
+  locked = xkb_state_serialize_mods (keyboard->xkb_info.state,
+                                     XKB_STATE_MODS_LOCKED);
+  group = xkb_state_serialize_layout (keyboard->xkb_info.state,
+                                      XKB_STATE_LAYOUT_EFFECTIVE);
+
+  if ((latched & keyboard->kbd_a11y_latched_mods) !=
+      keyboard->kbd_a11y_latched_mods)
     update_mask |= XKB_STATE_MODS_LATCHED;
 
-  if ((locked & keyboard->kbd_a11y_locked_mods) != keyboard->kbd_a11y_locked_mods)
+  if ((locked & keyboard->kbd_a11y_locked_mods) !=
+      keyboard->kbd_a11y_locked_mods)
     update_mask |= XKB_STATE_MODS_LOCKED;
 
   if (update_mask)
     {
       latched |= keyboard->kbd_a11y_latched_mods;
       locked |= keyboard->kbd_a11y_locked_mods;
-      xkb_state_update_mask (keyboard->xkb_info.state, depressed, latched, locked, 0, 0, group);
+      xkb_state_update_mask (keyboard->xkb_info.state, depressed, latched,
+                             locked, 0, 0, group);
     }
 
   return update_mask;
@@ -245,7 +253,8 @@ on_keymap_changed (MetaBackend *backend,
 {
   MetaWaylandKeyboard *keyboard = data;
 
-  meta_wayland_keyboard_take_keymap (keyboard, meta_backend_get_keymap (backend));
+  meta_wayland_keyboard_take_keymap (keyboard,
+                                     meta_backend_get_keymap (backend));
 }
 
 static void
@@ -265,7 +274,8 @@ on_keymap_layout_group_changed (MetaBackend *backend,
   latched_mods = xkb_state_serialize_mods (state, XKB_STATE_MODS_LATCHED);
   locked_mods = xkb_state_serialize_mods (state, XKB_STATE_MODS_LOCKED);
 
-  xkb_state_update_mask (state, depressed_mods, latched_mods, locked_mods, 0, 0, idx);
+  xkb_state_update_mask (state, depressed_mods, latched_mods, locked_mods, 0, 0,
+                         idx);
   kbd_a11y_apply_mask (keyboard);
 
   notify_modifiers (keyboard);
@@ -308,7 +318,7 @@ meta_wayland_keyboard_broadcast_key (MetaWaylandKeyboard *keyboard,
         }
 
       wl_resource_for_each (resource, &keyboard->focus_resource_list)
-        wl_keyboard_send_key (resource, serial, time, key, state);
+      wl_keyboard_send_key (resource, serial, time, key, state);
     }
 
   /* Eat the key events if we have a focused surface. */
@@ -323,9 +333,9 @@ notify_key (MetaWaylandKeyboard *keyboard,
 }
 
 static xkb_mod_mask_t
-add_vmod (xkb_mod_mask_t mask,
-          xkb_mod_mask_t mod,
-          xkb_mod_mask_t vmod,
+add_vmod (xkb_mod_mask_t  mask,
+          xkb_mod_mask_t  mod,
+          xkb_mod_mask_t  vmod,
           xkb_mod_mask_t *added)
 {
   if ((mask & mod) && !(mod & *added))
@@ -343,14 +353,16 @@ add_virtual_mods (xkb_mod_mask_t mask)
   xkb_mod_mask_t added;
   guint i;
   /* Order is important here: if multiple vmods share the same real
-     modifier we only want to add the first. */
-  struct {
+   *  modifier we only want to add the first. */
+  struct
+  {
     xkb_mod_mask_t mod;
     xkb_mod_mask_t vmod;
-  } mods[] = {
+  } mods[] =
+  {
     { keys->super_mask, keys->virtual_super_mask },
     { keys->hyper_mask, keys->virtual_hyper_mask },
-    { keys->meta_mask,  keys->virtual_meta_mask },
+    { keys->meta_mask, keys->virtual_meta_mask },
   };
 
   added = 0;
@@ -368,12 +380,17 @@ keyboard_send_modifiers (MetaWaylandKeyboard *keyboard,
   struct xkb_state *state = keyboard->xkb_info.state;
   xkb_mod_mask_t depressed, latched, locked;
 
-  depressed = add_virtual_mods (xkb_state_serialize_mods (state, XKB_STATE_MODS_DEPRESSED));
-  latched = add_virtual_mods (xkb_state_serialize_mods (state, XKB_STATE_MODS_LATCHED));
-  locked = add_virtual_mods (xkb_state_serialize_mods (state, XKB_STATE_MODS_LOCKED));
+  depressed =
+    add_virtual_mods (xkb_state_serialize_mods (state,
+                                                XKB_STATE_MODS_DEPRESSED));
+  latched =
+    add_virtual_mods (xkb_state_serialize_mods (state, XKB_STATE_MODS_LATCHED));
+  locked =
+    add_virtual_mods (xkb_state_serialize_mods (state, XKB_STATE_MODS_LOCKED));
 
   wl_keyboard_send_modifiers (resource, serial, depressed, latched, locked,
-                              xkb_state_serialize_layout (state, XKB_STATE_LAYOUT_EFFECTIVE));
+                              xkb_state_serialize_layout (state,
+                                                          XKB_STATE_LAYOUT_EFFECTIVE));
 }
 
 static void
@@ -390,7 +407,7 @@ meta_wayland_keyboard_broadcast_modifiers (MetaWaylandKeyboard *keyboard)
       serial = meta_wayland_input_device_next_serial (input_device);
 
       wl_resource_for_each (resource, &keyboard->focus_resource_list)
-        keyboard_send_modifiers (keyboard, resource, serial);
+      keyboard_send_modifiers (keyboard, resource, serial);
     }
 }
 
@@ -401,7 +418,8 @@ notify_modifiers (MetaWaylandKeyboard *keyboard)
 
   state = keyboard->xkb_info.state;
   keyboard->grab->interface->modifiers (keyboard->grab,
-                                        xkb_state_serialize_mods (state, XKB_STATE_MODS_EFFECTIVE));
+                                        xkb_state_serialize_mods (state,
+                                                                  XKB_STATE_MODS_EFFECTIVE));
 }
 
 static void
@@ -459,12 +477,13 @@ maybe_save_numlock_state (MetaWaylandKeyboard *keyboard)
   if (!keyboard->gsd_settings)
     return;
 
-  if (!g_settings_get_boolean (keyboard->gsd_settings, "remember-numlock-state"))
+  if (!g_settings_get_boolean (keyboard->gsd_settings,
+                               "remember-numlock-state"))
     return;
 
-  numlock_active = xkb_state_mod_name_is_active(xkb_info->state,
-                                                "Mod2",
-                                                XKB_STATE_MODS_LOCKED);
+  numlock_active = xkb_state_mod_name_is_active (xkb_info->state,
+                                                 "Mod2",
+                                                 XKB_STATE_MODS_LOCKED);
   switch (numlock_active)
     {
     case -1:
@@ -483,7 +502,7 @@ maybe_save_numlock_state (MetaWaylandKeyboard *keyboard)
 
 static void
 meta_wayland_keyboard_set_numlock (MetaWaylandKeyboard *keyboard,
-                                   gboolean     numlock_state)
+                                   gboolean             numlock_state)
 {
   MetaWaylandXkbInfo *xkb_info = &keyboard->xkb_info;
   xkb_mod_mask_t latched, locked, group, depressed;
@@ -493,16 +512,18 @@ meta_wayland_keyboard_set_numlock (MetaWaylandKeyboard *keyboard,
 
   latched = xkb_state_serialize_mods (xkb_info->state, XKB_STATE_MODS_LATCHED);
   locked = xkb_state_serialize_mods (xkb_info->state, XKB_STATE_MODS_LOCKED);
-  group = xkb_state_serialize_layout (xkb_info->state, XKB_STATE_LAYOUT_EFFECTIVE);
-  depressed = xkb_state_serialize_mods(xkb_info->state, XKB_STATE_DEPRESSED);
-  numlock = (1 <<  xkb_keymap_mod_get_index(xkb_info->keymap, "Mod2"));
+  group = xkb_state_serialize_layout (xkb_info->state,
+                                      XKB_STATE_LAYOUT_EFFECTIVE);
+  depressed = xkb_state_serialize_mods (xkb_info->state, XKB_STATE_DEPRESSED);
+  numlock = (1 << xkb_keymap_mod_get_index (xkb_info->keymap, "Mod2"));
 
   if (numlock_state == TRUE)
     locked |= numlock;
   else
     locked &= ~numlock;
 
-  xkb_state_update_mask (xkb_info->state, depressed, latched, locked, 0, 0, group);
+  xkb_state_update_mask (xkb_info->state, depressed, latched, locked, 0, 0,
+                         group);
   kbd_a11y_apply_mask (keyboard);
 
   notify_modifiers (keyboard);
@@ -519,8 +540,10 @@ meta_wayland_keyboard_update_xkb_state (MetaWaylandKeyboard *keyboard)
   /* Preserve latched/locked modifiers state */
   if (xkb_info->state)
     {
-      latched = xkb_state_serialize_mods (xkb_info->state, XKB_STATE_MODS_LATCHED);
-      locked = xkb_state_serialize_mods (xkb_info->state, XKB_STATE_MODS_LOCKED);
+      latched = xkb_state_serialize_mods (xkb_info->state,
+                                          XKB_STATE_MODS_LATCHED);
+      locked =
+        xkb_state_serialize_mods (xkb_info->state, XKB_STATE_MODS_LOCKED);
       xkb_state_unref (xkb_info->state);
     }
   else
@@ -537,25 +560,30 @@ meta_wayland_keyboard_update_xkb_state (MetaWaylandKeyboard *keyboard)
 }
 
 static void
-on_kbd_a11y_mask_changed (ClutterDeviceManager   *device_manager,
-                          xkb_mod_mask_t          new_latched_mods,
-                          xkb_mod_mask_t          new_locked_mods,
-                          MetaWaylandKeyboard    *keyboard)
+on_kbd_a11y_mask_changed (ClutterDeviceManager *device_manager,
+                          xkb_mod_mask_t        new_latched_mods,
+                          xkb_mod_mask_t        new_locked_mods,
+                          MetaWaylandKeyboard  *keyboard)
 {
   xkb_mod_mask_t latched, locked, depressed, group;
 
   if (keyboard->xkb_info.state == NULL)
     return;
 
-  depressed = xkb_state_serialize_mods(keyboard->xkb_info.state, XKB_STATE_DEPRESSED);
-  latched = xkb_state_serialize_mods (keyboard->xkb_info.state, XKB_STATE_MODS_LATCHED);
-  locked = xkb_state_serialize_mods (keyboard->xkb_info.state, XKB_STATE_MODS_LOCKED);
-  group = xkb_state_serialize_layout (keyboard->xkb_info.state, XKB_STATE_LAYOUT_EFFECTIVE);
+  depressed = xkb_state_serialize_mods (keyboard->xkb_info.state,
+                                        XKB_STATE_DEPRESSED);
+  latched = xkb_state_serialize_mods (keyboard->xkb_info.state,
+                                      XKB_STATE_MODS_LATCHED);
+  locked = xkb_state_serialize_mods (keyboard->xkb_info.state,
+                                     XKB_STATE_MODS_LOCKED);
+  group = xkb_state_serialize_layout (keyboard->xkb_info.state,
+                                      XKB_STATE_LAYOUT_EFFECTIVE);
 
   /* Clear previous masks */
   latched &= ~keyboard->kbd_a11y_latched_mods;
   locked &= ~keyboard->kbd_a11y_locked_mods;
-  xkb_state_update_mask (keyboard->xkb_info.state, depressed, latched, locked, 0, 0, group);
+  xkb_state_update_mask (keyboard->xkb_info.state, depressed, latched, locked,
+                         0, 0, group);
 
   /* Apply new masks */
   keyboard->kbd_a11y_latched_mods = new_latched_mods;
@@ -569,7 +597,8 @@ static void
 notify_key_repeat_for_resource (MetaWaylandKeyboard *keyboard,
                                 struct wl_resource  *keyboard_resource)
 {
-  if (wl_resource_get_version (keyboard_resource) >= WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION)
+  if (wl_resource_get_version (keyboard_resource) >=
+      WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION)
     {
       gboolean repeat;
       unsigned int delay, rate;
@@ -579,8 +608,10 @@ notify_key_repeat_for_resource (MetaWaylandKeyboard *keyboard,
       if (repeat)
         {
           unsigned int interval;
-          interval = g_settings_get_uint (keyboard->settings, "repeat-interval");
-          /* Our setting is in the milliseconds between keys. "rate" is the number
+          interval =
+            g_settings_get_uint (keyboard->settings, "repeat-interval");
+          /* Our setting is in the milliseconds between keys. "rate" is the
+           * number
            * of keys per second. */
           if (interval > 0)
             rate = (1000 / interval);
@@ -605,14 +636,14 @@ notify_key_repeat (MetaWaylandKeyboard *keyboard)
   struct wl_resource *keyboard_resource;
 
   wl_resource_for_each (keyboard_resource, &keyboard->resource_list)
-    {
-      notify_key_repeat_for_resource (keyboard, keyboard_resource);
-    }
+  {
+    notify_key_repeat_for_resource (keyboard, keyboard_resource);
+  }
 
   wl_resource_for_each (keyboard_resource, &keyboard->focus_resource_list)
-    {
-      notify_key_repeat_for_resource (keyboard, keyboard_resource);
-    }
+  {
+    notify_key_repeat_for_resource (keyboard, keyboard_resource);
+  }
 }
 
 static void
@@ -626,9 +657,9 @@ remember_numlock_state_changed (GSettings  *settings,
 }
 
 static void
-settings_changed (GSettings           *settings,
-                  const char          *key,
-                  gpointer             data)
+settings_changed (GSettings  *settings,
+                  const char *key,
+                  gpointer    data)
 {
   MetaWaylandKeyboard *keyboard = data;
 
@@ -656,7 +687,7 @@ default_grab_key (MetaWaylandKeyboardGrab *grab,
     code = clutter_evdev_event_get_event_code (event);
   if (code == 0)
 #endif
-    code = evdev_code (&event->key);
+  code = evdev_code (&event->key);
 
   return meta_wayland_keyboard_broadcast_key (keyboard, event->key.time,
                                               code, is_press);
@@ -669,7 +700,8 @@ default_grab_modifiers (MetaWaylandKeyboardGrab *grab,
   meta_wayland_keyboard_broadcast_modifiers (grab->keyboard);
 }
 
-static const MetaWaylandKeyboardGrabInterface default_keyboard_grab_interface = {
+static const MetaWaylandKeyboardGrabInterface default_keyboard_grab_interface =
+{
   default_grab_key,
   default_grab_modifiers
 };
@@ -680,19 +712,22 @@ meta_wayland_keyboard_enable (MetaWaylandKeyboard *keyboard)
   MetaBackend *backend = meta_get_backend ();
   GSettingsSchema *schema;
 
-  keyboard->settings = g_settings_new ("org.gnome.desktop.peripherals.keyboard");
+  keyboard->settings =
+    g_settings_new ("org.gnome.desktop.peripherals.keyboard");
   g_signal_connect (keyboard->settings, "changed",
                     G_CALLBACK (settings_changed), keyboard);
 
   /* We are cheating for now, we use g-s-d settings... Check if available */
-  schema = g_settings_schema_source_lookup (g_settings_schema_source_get_default (),
-                                            GSD_KEYBOARD_SCHEMA,
-                                            TRUE);
+  schema = g_settings_schema_source_lookup (
+    g_settings_schema_source_get_default (),
+    GSD_KEYBOARD_SCHEMA,
+    TRUE);
   if (schema)
     {
       keyboard->gsd_settings = g_settings_new_full (schema, NULL, NULL);
       g_settings_schema_unref (schema);
-      g_signal_connect (keyboard->gsd_settings, "changed::remember-numlock-state",
+      g_signal_connect (keyboard->gsd_settings,
+                        "changed::remember-numlock-state",
                         G_CALLBACK (remember_numlock_state_changed), keyboard);
     }
 
@@ -701,10 +736,12 @@ meta_wayland_keyboard_enable (MetaWaylandKeyboard *keyboard)
   g_signal_connect (backend, "keymap-layout-group-changed",
                     G_CALLBACK (on_keymap_layout_group_changed), keyboard);
 
-  g_signal_connect (clutter_device_manager_get_default (), "kbd-a11y-mods-state-changed",
-                    G_CALLBACK (on_kbd_a11y_mask_changed), keyboard);
+  g_signal_connect (
+    clutter_device_manager_get_default (), "kbd-a11y-mods-state-changed",
+    G_CALLBACK (on_kbd_a11y_mask_changed), keyboard);
 
-  meta_wayland_keyboard_take_keymap (keyboard, meta_backend_get_keymap (backend));
+  meta_wayland_keyboard_take_keymap (keyboard,
+                                     meta_backend_get_keymap (backend));
 
   maybe_restore_numlock_state (keyboard);
 }
@@ -723,7 +760,8 @@ meta_wayland_keyboard_disable (MetaWaylandKeyboard *keyboard)
   MetaBackend *backend = meta_get_backend ();
 
   g_signal_handlers_disconnect_by_func (backend, on_keymap_changed, keyboard);
-  g_signal_handlers_disconnect_by_func (backend, on_keymap_layout_group_changed, keyboard);
+  g_signal_handlers_disconnect_by_func (backend, on_keymap_layout_group_changed,
+                                        keyboard);
 
   meta_wayland_keyboard_end_grab (keyboard);
   meta_wayland_keyboard_set_focus (keyboard, NULL);
@@ -748,7 +786,7 @@ evdev_code (const ClutterKeyEvent *event)
 }
 
 void
-meta_wayland_keyboard_update (MetaWaylandKeyboard *keyboard,
+meta_wayland_keyboard_update (MetaWaylandKeyboard   *keyboard,
                               const ClutterKeyEvent *event)
 {
   gboolean is_press = event->type == CLUTTER_KEY_PRESS;
@@ -775,7 +813,7 @@ meta_wayland_keyboard_update (MetaWaylandKeyboard *keyboard,
 }
 
 gboolean
-meta_wayland_keyboard_handle_event (MetaWaylandKeyboard *keyboard,
+meta_wayland_keyboard_handle_event (MetaWaylandKeyboard   *keyboard,
                                     const ClutterKeyEvent *event)
 {
 #ifdef WITH_VERBOSE_MODE
@@ -790,8 +828,8 @@ meta_wayland_keyboard_handle_event (MetaWaylandKeyboard *keyboard,
     return FALSE;
 
   meta_verbose ("Handling key %s event code %d\n",
-               is_press ? "press" : "release",
-               event->hardware_keycode);
+                is_press ? "press" : "release",
+                event->hardware_keycode);
 
   handled = notify_key (keyboard, (const ClutterEvent *) event);
 
@@ -822,7 +860,7 @@ meta_wayland_keyboard_update_key_state (MetaWaylandKeyboard *keyboard,
   int i;
   for (i = offset; i < key_vector_len * 8; i++)
     {
-      gboolean set = (key_vector[i/8] & (1 << (i % 8))) != 0;
+      gboolean set = (key_vector[i / 8] & (1 << (i % 8))) != 0;
 
       /* The 'offset' parameter allows the caller to have the indices
        * into key_vector to either be X-style (base 8) or evdev (base 0), or
@@ -848,19 +886,19 @@ move_resources (struct wl_list *destination, struct wl_list *source)
 }
 
 static void
-move_resources_for_client (struct wl_list *destination,
-                          struct wl_list *source,
-                          struct wl_client *client)
+move_resources_for_client (struct wl_list   *destination,
+                           struct wl_list   *source,
+                           struct wl_client *client)
 {
   struct wl_resource *resource, *tmp;
   wl_resource_for_each_safe (resource, tmp, source)
-    {
-      if (wl_resource_get_client (resource) == client)
-        {
-          wl_list_remove (wl_resource_get_link (resource));
-          wl_list_insert (destination, wl_resource_get_link (resource));
-        }
-    }
+  {
+    if (wl_resource_get_client (resource) == client)
+      {
+        wl_list_remove (wl_resource_get_link (resource));
+        wl_list_insert (destination, wl_resource_get_link (resource));
+      }
+  }
 }
 
 static void
@@ -895,7 +933,7 @@ broadcast_focus (MetaWaylandKeyboard *keyboard,
 
 void
 meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
-                                 MetaWaylandSurface *surface)
+                                 MetaWaylandSurface  *surface)
 {
   MetaWaylandInputDevice *input_device = META_WAYLAND_INPUT_DEVICE (keyboard);
 
@@ -912,10 +950,10 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
           serial = meta_wayland_input_device_next_serial (input_device);
 
           wl_resource_for_each (resource, &keyboard->focus_resource_list)
-            {
-              wl_keyboard_send_leave (resource, serial,
-                                      keyboard->focus_surface->resource);
-            }
+          {
+            wl_keyboard_send_leave (resource, serial,
+                                    keyboard->focus_surface->resource);
+          }
 
           move_resources (&keyboard->resource_list,
                           &keyboard->focus_resource_list);
@@ -949,9 +987,9 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
             meta_wayland_input_device_next_serial (input_device);
 
           wl_resource_for_each (resource, &keyboard->focus_resource_list)
-            {
-              broadcast_focus (keyboard, resource);
-            }
+          {
+            broadcast_focus (keyboard, resource);
+          }
         }
     }
 }
@@ -966,13 +1004,14 @@ meta_wayland_keyboard_get_focus_client (MetaWaylandKeyboard *keyboard)
 }
 
 static void
-keyboard_release (struct wl_client *client,
+keyboard_release (struct wl_client   *client,
                   struct wl_resource *resource)
 {
   wl_resource_destroy (resource);
 }
 
-static const struct wl_keyboard_interface keyboard_interface = {
+static const struct wl_keyboard_interface keyboard_interface =
+{
   keyboard_release,
 };
 
@@ -980,7 +1019,7 @@ void
 meta_wayland_keyboard_create_new_resource (MetaWaylandKeyboard *keyboard,
                                            struct wl_client    *client,
                                            struct wl_resource  *seat_resource,
-                                           uint32_t id)
+                                           uint32_t             id)
 {
   struct wl_resource *resource;
 
diff --git a/src/wayland/meta-wayland-legacy-xdg-shell.c b/src/wayland/meta-wayland-legacy-xdg-shell.c
index 9c7dbf373..b7fa3603b 100644
--- a/src/wayland/meta-wayland-legacy-xdg-shell.c
+++ b/src/wayland/meta-wayland-legacy-xdg-shell.c
@@ -111,7 +111,8 @@ struct _MetaWaylandZxdgPopupV6
 
   MetaWaylandPopup *popup;
 
-  struct {
+  struct
+  {
     MetaWaylandSurface *parent_surface;
 
     /*
@@ -135,16 +136,20 @@ G_DEFINE_TYPE_WITH_CODE (MetaWaylandZxdgPopupV6,
                                                 popup_surface_iface_init));
 
 static MetaPlacementRule
-meta_wayland_zxdg_positioner_v6_to_placement (MetaWaylandZxdgPositionerV6 *xdg_positioner);
+meta_wayland_zxdg_positioner_v6_to_placement (
+  MetaWaylandZxdgPositionerV6 *xdg_positioner);
 
 static struct wl_resource *
-meta_wayland_zxdg_surface_v6_get_shell_resource (MetaWaylandZxdgSurfaceV6 *xdg_surface);
+meta_wayland_zxdg_surface_v6_get_shell_resource (
+  MetaWaylandZxdgSurfaceV6 *xdg_surface);
 
 static MetaRectangle
-meta_wayland_zxdg_surface_v6_get_window_geometry (MetaWaylandZxdgSurfaceV6 *xdg_surface);
+meta_wayland_zxdg_surface_v6_get_window_geometry (
+  MetaWaylandZxdgSurfaceV6 *xdg_surface);
 
 static uint32_t
-meta_wayland_zxdg_surface_v6_send_configure (MetaWaylandZxdgSurfaceV6 *xdg_surface);
+meta_wayland_zxdg_surface_v6_send_configure (
+  MetaWaylandZxdgSurfaceV6 *xdg_surface);
 
 static MetaWaylandSurface *
 surface_from_xdg_surface_resource (struct wl_resource *resource)
@@ -255,7 +260,8 @@ zxdg_toplevel_v6_show_window_menu (struct wl_client   *client,
   if (!window)
     return;
 
-  if (!meta_wayland_seat_get_grab_info (seat, surface, serial, FALSE, NULL, NULL))
+  if (!meta_wayland_seat_get_grab_info (seat, surface, serial, FALSE, NULL,
+                                        NULL))
     return;
 
   monitor_scale = window->monitor->scale;
@@ -465,7 +471,9 @@ zxdg_toplevel_v6_set_minimized (struct wl_client   *client,
   meta_window_minimize (window);
 }
 
-static const struct zxdg_toplevel_v6_interface meta_wayland_zxdg_toplevel_v6_interface = {
+static const struct zxdg_toplevel_v6_interface
+  meta_wayland_zxdg_toplevel_v6_interface =
+{
   zxdg_toplevel_v6_destroy,
   zxdg_toplevel_v6_set_parent,
   zxdg_toplevel_v6_set_title,
@@ -531,10 +539,12 @@ zxdg_popup_v6_grab (struct wl_client   *client,
   xdg_popup->setup.grab_serial = serial;
 }
 
-static const struct zxdg_popup_v6_interface meta_wayland_zxdg_popup_v6_interface = {
+static const struct zxdg_popup_v6_interface meta_wayland_zxdg_popup_v6_interface
+  =
+  {
   zxdg_popup_v6_destroy,
   zxdg_popup_v6_grab,
-};
+  };
 
 static void
 handle_popup_parent_destroyed (struct wl_listener *listener,
@@ -560,8 +570,8 @@ handle_popup_parent_destroyed (struct wl_listener *listener,
 }
 
 static void
-add_state_value (struct wl_array             *states,
-                 enum zxdg_toplevel_v6_state  state)
+add_state_value (struct wl_array            *states,
+                 enum zxdg_toplevel_v6_state state)
 {
   uint32_t *s;
 
@@ -584,10 +594,11 @@ fill_states (struct wl_array *states,
 }
 
 static void
-meta_wayland_zxdg_toplevel_v6_send_configure (MetaWaylandZxdgToplevelV6 *xdg_toplevel,
-                                              int                        new_width,
-                                              int                        new_height,
-                                              MetaWaylandSerial         *sent_serial)
+meta_wayland_zxdg_toplevel_v6_send_configure (
+  MetaWaylandZxdgToplevelV6 *xdg_toplevel,
+  int                        new_width,
+  int                        new_height,
+  MetaWaylandSerial         *sent_serial)
 {
   MetaWaylandZxdgSurfaceV6 *xdg_surface =
     META_WAYLAND_ZXDG_SURFACE_V6 (xdg_toplevel);
@@ -629,7 +640,8 @@ is_new_size_hints_valid (MetaWindow              *window,
     }
   else
     {
-      meta_window_wayland_get_min_size (window, &new_min_width, &new_min_height);
+      meta_window_wayland_get_min_size (window, &new_min_width,
+                                        &new_min_height);
     }
 
   if (pending->has_new_max_size)
@@ -639,7 +651,8 @@ is_new_size_hints_valid (MetaWindow              *window,
     }
   else
     {
-      meta_window_wayland_get_max_size (window, &new_max_width, &new_max_height);
+      meta_window_wayland_get_max_size (window, &new_max_width,
+                                        &new_max_height);
     }
   /* Zero means unlimited */
   return ((new_max_width == 0 || new_min_width <= new_max_width) &&
@@ -690,7 +703,8 @@ meta_wayland_zxdg_toplevel_v6_commit (MetaWaylandSurfaceRole  *surface_role,
   if (!window)
     return;
 
-  geometry_changed = !meta_rectangle_equal (&old_geometry, &xdg_surface_priv->geometry);
+  geometry_changed = !meta_rectangle_equal (&old_geometry,
+                                            &xdg_surface_priv->geometry);
 
   if (geometry_changed || meta_window_wayland_needs_move_resize (window))
     {
@@ -729,7 +743,6 @@ meta_wayland_zxdg_toplevel_v6_commit (MetaWaylandSurfaceRole  *surface_role,
           wl_resource_post_error (surface->resource,
                                   ZXDG_SHELL_V6_ERROR_INVALID_SURFACE_STATE,
                                   "Invalid min/max size");
-
         }
     }
 
@@ -784,14 +797,16 @@ meta_wayland_zxdg_toplevel_v6_close (MetaWaylandShellSurface *shell_surface)
 }
 
 static void
-meta_wayland_zxdg_toplevel_v6_shell_client_destroyed (MetaWaylandZxdgSurfaceV6 *xdg_surface)
+meta_wayland_zxdg_toplevel_v6_shell_client_destroyed (
+  MetaWaylandZxdgSurfaceV6 *xdg_surface)
 {
   MetaWaylandZxdgToplevelV6 *xdg_toplevel =
     META_WAYLAND_ZXDG_TOPLEVEL_V6 (xdg_surface);
   struct wl_resource *xdg_shell_resource =
     meta_wayland_zxdg_surface_v6_get_shell_resource (xdg_surface);
   MetaWaylandZxdgSurfaceV6Class *xdg_surface_class =
-    META_WAYLAND_ZXDG_SURFACE_V6_CLASS (meta_wayland_zxdg_toplevel_v6_parent_class);
+    META_WAYLAND_ZXDG_SURFACE_V6_CLASS (
+      meta_wayland_zxdg_toplevel_v6_parent_class);
 
   xdg_surface_class->shell_client_destroyed (xdg_surface);
 
@@ -1058,7 +1073,8 @@ meta_wayland_zxdg_popup_v6_managed (MetaWaylandShellSurface *shell_surface,
 }
 
 static void
-meta_wayland_zxdg_popup_v6_shell_client_destroyed (MetaWaylandZxdgSurfaceV6 *xdg_surface)
+meta_wayland_zxdg_popup_v6_shell_client_destroyed (
+  MetaWaylandZxdgSurfaceV6 *xdg_surface)
 {
   MetaWaylandZxdgPopupV6 *xdg_popup = META_WAYLAND_ZXDG_POPUP_V6 (xdg_surface);
   struct wl_resource *xdg_shell_resource =
@@ -1082,7 +1098,8 @@ meta_wayland_zxdg_popup_v6_shell_client_destroyed (MetaWaylandZxdgSurfaceV6 *xdg
 static void
 meta_wayland_zxdg_popup_v6_done (MetaWaylandPopupSurface *popup_surface)
 {
-  MetaWaylandZxdgPopupV6 *xdg_popup = META_WAYLAND_ZXDG_POPUP_V6 (popup_surface);
+  MetaWaylandZxdgPopupV6 *xdg_popup =
+    META_WAYLAND_ZXDG_POPUP_V6 (popup_surface);
 
   zxdg_popup_v6_send_popup_done (xdg_popup->resource);
 }
@@ -1171,7 +1188,8 @@ meta_wayland_zxdg_popup_v6_class_init (MetaWaylandZxdgPopupV6Class *klass)
 }
 
 static struct wl_resource *
-meta_wayland_zxdg_surface_v6_get_shell_resource (MetaWaylandZxdgSurfaceV6 *xdg_surface)
+meta_wayland_zxdg_surface_v6_get_shell_resource (
+  MetaWaylandZxdgSurfaceV6 *xdg_surface)
 {
   MetaWaylandZxdgSurfaceV6Private *priv =
     meta_wayland_zxdg_surface_v6_get_instance_private (xdg_surface);
@@ -1180,7 +1198,8 @@ meta_wayland_zxdg_surface_v6_get_shell_resource (MetaWaylandZxdgSurfaceV6 *xdg_s
 }
 
 static MetaRectangle
-meta_wayland_zxdg_surface_v6_get_window_geometry (MetaWaylandZxdgSurfaceV6 *xdg_surface)
+meta_wayland_zxdg_surface_v6_get_window_geometry (
+  MetaWaylandZxdgSurfaceV6 *xdg_surface)
 {
   MetaWaylandZxdgSurfaceV6Private *priv =
     meta_wayland_zxdg_surface_v6_get_instance_private (xdg_surface);
@@ -1198,7 +1217,8 @@ meta_wayland_zxdg_surface_v6_is_assigned (MetaWaylandZxdgSurfaceV6 *xdg_surface)
 }
 
 static uint32_t
-meta_wayland_zxdg_surface_v6_send_configure (MetaWaylandZxdgSurfaceV6 *xdg_surface)
+meta_wayland_zxdg_surface_v6_send_configure (
+  MetaWaylandZxdgSurfaceV6 *xdg_surface)
 {
   MetaWaylandZxdgSurfaceV6Private *priv =
     meta_wayland_zxdg_surface_v6_get_instance_private (xdg_surface);
@@ -1302,7 +1322,9 @@ zxdg_surface_v6_ack_configure (struct wl_client   *client,
   priv->acked_configure_serial.value = serial;
 }
 
-static const struct zxdg_surface_v6_interface meta_wayland_zxdg_surface_v6_interface = {
+static const struct zxdg_surface_v6_interface
+  meta_wayland_zxdg_surface_v6_interface =
+{
   zxdg_surface_v6_destroy,
   zxdg_surface_v6_get_toplevel,
   zxdg_surface_v6_get_popup,
@@ -1437,7 +1459,8 @@ meta_wayland_zxdg_surface_v6_ping (MetaWaylandShellSurface *shell_surface,
 }
 
 static void
-meta_wayland_zxdg_surface_v6_real_shell_client_destroyed (MetaWaylandZxdgSurfaceV6 *xdg_surface)
+meta_wayland_zxdg_surface_v6_real_shell_client_destroyed (
+  MetaWaylandZxdgSurfaceV6 *xdg_surface)
 {
   MetaWaylandZxdgSurfaceV6Private *priv =
     meta_wayland_zxdg_surface_v6_get_instance_private (xdg_surface);
@@ -1466,11 +1489,11 @@ meta_wayland_zxdg_surface_v6_set_property (GObject      *object,
   switch (prop_id)
     {
     case ZXDG_SURFACE_V6_PROP_SHELL_CLIENT:
-      priv->shell_client  = g_value_get_pointer (value);
+      priv->shell_client = g_value_get_pointer (value);
       break;
 
     case ZXDG_SURFACE_V6_PROP_RESOURCE:
-      priv->resource  = g_value_get_pointer (value);
+      priv->resource = g_value_get_pointer (value);
       break;
 
     default:
@@ -1479,7 +1502,7 @@ meta_wayland_zxdg_surface_v6_set_property (GObject      *object,
 }
 
 static void
-meta_wayland_zxdg_surface_v6_get_property (GObject      *object,
+meta_wayland_zxdg_surface_v6_get_property (GObject    *object,
                                            guint       prop_id,
                                            GValue     *value,
                                            GParamSpec *pspec)
@@ -1550,7 +1573,8 @@ meta_wayland_zxdg_surface_v6_class_init (MetaWaylandZxdgSurfaceV6Class *klass)
 }
 
 static void
-meta_wayland_zxdg_surface_v6_shell_client_destroyed (MetaWaylandZxdgSurfaceV6 *xdg_surface)
+meta_wayland_zxdg_surface_v6_shell_client_destroyed (
+  MetaWaylandZxdgSurfaceV6 *xdg_surface)
 {
   MetaWaylandZxdgSurfaceV6Class *xdg_surface_class =
     META_WAYLAND_ZXDG_SURFACE_V6_GET_CLASS (xdg_surface);
@@ -1559,8 +1583,9 @@ meta_wayland_zxdg_surface_v6_shell_client_destroyed (MetaWaylandZxdgSurfaceV6 *x
 }
 
 static void
-meta_wayland_zxdg_surface_v6_constructor_finalize (MetaWaylandZxdgSurfaceV6Constructor *constructor,
-                                                   MetaWaylandZxdgSurfaceV6            *xdg_surface)
+meta_wayland_zxdg_surface_v6_constructor_finalize (
+  MetaWaylandZxdgSurfaceV6Constructor *constructor,
+  MetaWaylandZxdgSurfaceV6            *xdg_surface)
 {
   MetaWaylandZxdgShellV6Client *shell_client = constructor->shell_client;
 
@@ -1604,7 +1629,8 @@ zxdg_surface_v6_constructor_get_toplevel (struct wl_client   *client,
   if (!meta_wayland_surface_assign_role (surface,
                                          META_TYPE_WAYLAND_ZXDG_TOPLEVEL_V6,
                                          "shell-client", shell_client,
-                                         "xdg-surface-resource", xdg_surface_resource,
+                                         "xdg-surface-resource",
+                                         xdg_surface_resource,
                                          NULL))
     {
       wl_resource_post_error (resource, ZXDG_SHELL_V6_ERROR_ROLE,
@@ -1616,7 +1642,8 @@ zxdg_surface_v6_constructor_get_toplevel (struct wl_client   *client,
   xdg_toplevel = META_WAYLAND_ZXDG_TOPLEVEL_V6 (surface->role);
   xdg_toplevel->resource = wl_resource_create (client,
                                                &zxdg_toplevel_v6_interface,
-                                               wl_resource_get_version (resource),
+                                               wl_resource_get_version (
+                                                 resource),
                                                id);
   wl_resource_set_implementation (xdg_toplevel->resource,
                                   &meta_wayland_zxdg_toplevel_v6_interface,
@@ -1653,7 +1680,8 @@ zxdg_surface_v6_constructor_get_popup (struct wl_client   *client,
   if (!meta_wayland_surface_assign_role (surface,
                                          META_TYPE_WAYLAND_ZXDG_POPUP_V6,
                                          "shell-client", shell_client,
-                                         "xdg-surface-resource", xdg_surface_resource,
+                                         "xdg-surface-resource",
+                                         xdg_surface_resource,
                                          NULL))
     {
       wl_resource_post_error (xdg_shell_resource, ZXDG_SHELL_V6_ERROR_ROLE,
@@ -1713,7 +1741,9 @@ zxdg_surface_v6_constructor_ack_configure (struct wl_client   *client,
                           "xdg_surface::ack_configure called before constructed");
 }
 
-static const struct zxdg_surface_v6_interface meta_wayland_zxdg_surface_v6_constructor_interface = {
+static const struct zxdg_surface_v6_interface
+  meta_wayland_zxdg_surface_v6_constructor_interface =
+{
   zxdg_surface_v6_constructor_destroy,
   zxdg_surface_v6_constructor_get_toplevel,
   zxdg_surface_v6_constructor_get_popup,
@@ -1735,17 +1765,18 @@ zxdg_surface_v6_constructor_destructor (struct wl_resource *resource)
 }
 
 static MetaPlacementRule
-meta_wayland_zxdg_positioner_v6_to_placement (MetaWaylandZxdgPositionerV6 *xdg_positioner)
+meta_wayland_zxdg_positioner_v6_to_placement (
+  MetaWaylandZxdgPositionerV6 *xdg_positioner)
 {
   return (MetaPlacementRule) {
-    .anchor_rect = xdg_positioner->anchor_rect,
-    .gravity = xdg_positioner->gravity,
-    .anchor = xdg_positioner->anchor,
-    .constraint_adjustment = xdg_positioner->constraint_adjustment,
-    .offset_x = xdg_positioner->offset_x,
-    .offset_y = xdg_positioner->offset_y,
-    .width = xdg_positioner->width,
-    .height = xdg_positioner->height,
+           .anchor_rect = xdg_positioner->anchor_rect,
+           .gravity = xdg_positioner->gravity,
+           .anchor = xdg_positioner->anchor,
+           .constraint_adjustment = xdg_positioner->constraint_adjustment,
+           .offset_x = xdg_positioner->offset_x,
+           .offset_y = xdg_positioner->offset_y,
+           .width = xdg_positioner->width,
+           .height = xdg_positioner->height,
   };
 }
 
@@ -1762,7 +1793,8 @@ zxdg_positioner_v6_set_size (struct wl_client   *client,
                              int32_t             width,
                              int32_t             height)
 {
-  MetaWaylandZxdgPositionerV6 *positioner = wl_resource_get_user_data (resource);
+  MetaWaylandZxdgPositionerV6 *positioner =
+    wl_resource_get_user_data (resource);
 
   if (width <= 0 || height <= 0)
     {
@@ -1783,7 +1815,8 @@ zxdg_positioner_v6_set_anchor_rect (struct wl_client   *client,
                                     int32_t             width,
                                     int32_t             height)
 {
-  MetaWaylandZxdgPositionerV6 *positioner = wl_resource_get_user_data (resource);
+  MetaWaylandZxdgPositionerV6 *positioner =
+    wl_resource_get_user_data (resource);
 
   if (width <= 0 || height <= 0)
     {
@@ -1805,7 +1838,8 @@ zxdg_positioner_v6_set_anchor (struct wl_client   *client,
                                struct wl_resource *resource,
                                uint32_t            anchor)
 {
-  MetaWaylandZxdgPositionerV6 *positioner = wl_resource_get_user_data (resource);
+  MetaWaylandZxdgPositionerV6 *positioner =
+    wl_resource_get_user_data (resource);
 
   if ((anchor & ZXDG_POSITIONER_V6_ANCHOR_LEFT &&
        anchor & ZXDG_POSITIONER_V6_ANCHOR_RIGHT) ||
@@ -1825,7 +1859,8 @@ zxdg_positioner_v6_set_gravity (struct wl_client   *client,
                                 struct wl_resource *resource,
                                 uint32_t            gravity)
 {
-  MetaWaylandZxdgPositionerV6 *positioner = wl_resource_get_user_data (resource);
+  MetaWaylandZxdgPositionerV6 *positioner =
+    wl_resource_get_user_data (resource);
 
   if ((gravity & ZXDG_POSITIONER_V6_GRAVITY_LEFT &&
        gravity & ZXDG_POSITIONER_V6_GRAVITY_RIGHT) ||
@@ -1845,12 +1880,14 @@ zxdg_positioner_v6_set_constraint_adjustment (struct wl_client   *client,
                                               struct wl_resource *resource,
                                               uint32_t            constraint_adjustment)
 {
-  MetaWaylandZxdgPositionerV6 *positioner = wl_resource_get_user_data (resource);
+  MetaWaylandZxdgPositionerV6 *positioner =
+    wl_resource_get_user_data (resource);
   uint32_t all_adjustments = (ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_X |
                               ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_X |
                               ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_Y |
                               ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_Y |
-                              ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_X |
+                              ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_X
+                              |
                               ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_Y);
 
   if ((constraint_adjustment & ~all_adjustments) != 0)
@@ -1869,13 +1906,16 @@ zxdg_positioner_v6_set_offset (struct wl_client   *client,
                                int32_t             x,
                                int32_t             y)
 {
-  MetaWaylandZxdgPositionerV6 *positioner = wl_resource_get_user_data (resource);
+  MetaWaylandZxdgPositionerV6 *positioner =
+    wl_resource_get_user_data (resource);
 
   positioner->offset_x = x;
   positioner->offset_y = y;
 }
 
-static const struct zxdg_positioner_v6_interface meta_wayland_zxdg_positioner_v6_interface = {
+static const struct zxdg_positioner_v6_interface
+  meta_wayland_zxdg_positioner_v6_interface =
+{
   zxdg_positioner_v6_destroy,
   zxdg_positioner_v6_set_size,
   zxdg_positioner_v6_set_anchor_rect,
@@ -1888,7 +1928,8 @@ static const struct zxdg_positioner_v6_interface meta_wayland_zxdg_positioner_v6
 static void
 zxdg_positioner_v6_destructor (struct wl_resource *resource)
 {
-  MetaWaylandZxdgPositionerV6 *positioner = wl_resource_get_user_data (resource);
+  MetaWaylandZxdgPositionerV6 *positioner =
+    wl_resource_get_user_data (resource);
 
   g_free (positioner);
 }
@@ -1897,7 +1938,8 @@ static void
 zxdg_shell_v6_destroy (struct wl_client   *client,
                        struct wl_resource *resource)
 {
-  MetaWaylandZxdgShellV6Client *shell_client = wl_resource_get_user_data (resource);
+  MetaWaylandZxdgShellV6Client *shell_client = wl_resource_get_user_data (
+    resource);
 
   if (shell_client->surfaces || shell_client->surface_constructors)
     wl_resource_post_error (resource, ZXDG_SHELL_V6_ERROR_DEFUNCT_SURFACES,
@@ -1931,7 +1973,8 @@ zxdg_shell_v6_get_xdg_surface (struct wl_client   *client,
                                uint32_t            id,
                                struct wl_resource *surface_resource)
 {
-  MetaWaylandZxdgShellV6Client *shell_client = wl_resource_get_user_data (resource);
+  MetaWaylandZxdgShellV6Client *shell_client = wl_resource_get_user_data (
+    resource);
   MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource);
   MetaWaylandZxdgSurfaceV6 *xdg_surface = NULL;
   MetaWaylandZxdgSurfaceV6Constructor *constructor;
@@ -1968,7 +2011,8 @@ zxdg_shell_v6_get_xdg_surface (struct wl_client   *client,
   constructor->shell_client = shell_client;
   constructor->resource = wl_resource_create (client,
                                               &zxdg_surface_v6_interface,
-                                              wl_resource_get_version (resource),
+                                              wl_resource_get_version (
+                                                resource),
                                               id);
   wl_resource_set_implementation (constructor->resource,
                                   &meta_wayland_zxdg_surface_v6_constructor_interface,
@@ -1989,15 +2033,18 @@ zxdg_shell_v6_pong (struct wl_client   *client,
   meta_display_pong_for_serial (display, serial);
 }
 
-static const struct zxdg_shell_v6_interface meta_wayland_zxdg_shell_v6_interface = {
+static const struct zxdg_shell_v6_interface meta_wayland_zxdg_shell_v6_interface
+  =
+  {
   zxdg_shell_v6_destroy,
   zxdg_shell_v6_create_positioner,
   zxdg_shell_v6_get_xdg_surface,
   zxdg_shell_v6_pong,
-};
+  };
 
 static void
-meta_wayland_zxdg_shell_v6_client_destroy (MetaWaylandZxdgShellV6Client *shell_client)
+meta_wayland_zxdg_shell_v6_client_destroy (
+  MetaWaylandZxdgShellV6Client *shell_client)
 {
   while (shell_client->surface_constructors)
     {
@@ -2023,7 +2070,8 @@ meta_wayland_zxdg_shell_v6_client_destroy (MetaWaylandZxdgShellV6Client *shell_c
 static void
 zxdg_shell_v6_destructor (struct wl_resource *resource)
 {
-  MetaWaylandZxdgShellV6Client *shell_client = wl_resource_get_user_data (resource);
+  MetaWaylandZxdgShellV6Client *shell_client = wl_resource_get_user_data (
+    resource);
 
   meta_wayland_zxdg_shell_v6_client_destroy (shell_client);
 }
diff --git a/src/wayland/meta-wayland-outputs.c b/src/wayland/meta-wayland-outputs.c
index cb393ddf5..96508758c 100644
--- a/src/wayland/meta-wayland-outputs.c
+++ b/src/wayland/meta-wayland-outputs.c
@@ -36,7 +36,8 @@
 #include "xdg-output-unstable-v1-server-protocol.h"
 
 
-enum {
+enum
+{
   OUTPUT_DESTROYED,
 
   LAST_SIGNAL
@@ -281,9 +282,9 @@ send_output_events (struct wl_resource *resource,
 
 static void
 bind_output (struct wl_client *client,
-             void *data,
-             guint32 version,
-             guint32 id)
+             void             *data,
+             guint32           version,
+             guint32           id)
 {
   MetaWaylandOutput *wayland_output = data;
   MetaLogicalMonitor *logical_monitor = wayland_output->logical_monitor;
@@ -293,7 +294,8 @@ bind_output (struct wl_client *client,
 #endif
 
   resource = wl_resource_create (client, &wl_output_interface, version, id);
-  wayland_output->resources = g_list_prepend (wayland_output->resources, resource);
+  wayland_output->resources = g_list_prepend (wayland_output->resources,
+                                              resource);
 
   wl_resource_set_user_data (resource, wayland_output);
   wl_resource_set_destructor (resource, output_resource_destroy);
@@ -342,7 +344,8 @@ meta_wayland_output_set_logical_monitor (MetaWaylandOutput  *wayland_output,
   if (current_mode == preferred_mode)
     wayland_output->mode_flags |= WL_OUTPUT_MODE_PREFERRED;
   wayland_output->scale = calculate_wayland_output_scale (logical_monitor);
-  wayland_output->refresh_rate = meta_monitor_mode_get_refresh_rate (current_mode);
+  wayland_output->refresh_rate = meta_monitor_mode_get_refresh_rate (
+    current_mode);
 }
 
 static void
@@ -356,13 +359,15 @@ wayland_output_update_for_output (MetaWaylandOutput  *wayland_output,
   for (iter = wayland_output->resources; iter; iter = iter->next)
     {
       struct wl_resource *resource = iter->data;
-      send_output_events (resource, wayland_output, logical_monitor, FALSE, &pending_done_event);
+      send_output_events (resource, wayland_output, logical_monitor, FALSE,
+                          &pending_done_event);
     }
 
   for (iter = wayland_output->xdg_output_resources; iter; iter = iter->next)
     {
       struct wl_resource *xdg_output = iter->data;
-      send_xdg_output_events (xdg_output, wayland_output, logical_monitor, FALSE, &pending_done_event);
+      send_xdg_output_events (xdg_output, wayland_output, logical_monitor,
+                              FALSE, &pending_done_event);
     }
 
   /* Send the "done" events if needed */
@@ -371,7 +376,8 @@ wayland_output_update_for_output (MetaWaylandOutput  *wayland_output,
       for (iter = wayland_output->resources; iter; iter = iter->next)
         {
           struct wl_resource *resource = iter->data;
-          if (wl_resource_get_version (resource) >= WL_OUTPUT_DONE_SINCE_VERSION)
+          if (wl_resource_get_version (resource) >=
+              WL_OUTPUT_DONE_SINCE_VERSION)
             wl_output_send_done (resource);
         }
 
@@ -382,7 +388,7 @@ wayland_output_update_for_output (MetaWaylandOutput  *wayland_output,
         }
     }
   /* It's very important that we change the output pointer here, as
-     the old structure is about to be freed by MetaMonitorManager */
+   *  the old structure is about to be freed by MetaMonitorManager */
   meta_wayland_output_set_logical_monitor (wayland_output, logical_monitor);
 }
 
@@ -478,7 +484,8 @@ meta_wayland_compositor_update_outputs (MetaWaylandCompositor *compositor,
         }
       else
         {
-          wayland_output = meta_wayland_output_new (compositor, logical_monitor);
+          wayland_output =
+            meta_wayland_output_new (compositor, logical_monitor);
         }
 
       wayland_output_update_for_output (wayland_output, logical_monitor);
@@ -497,7 +504,8 @@ static void
 on_monitors_changed (MetaMonitorManager    *monitors,
                      MetaWaylandCompositor *compositor)
 {
-  compositor->outputs = meta_wayland_compositor_update_outputs (compositor, monitors);
+  compositor->outputs = meta_wayland_compositor_update_outputs (compositor,
+                                                                monitors);
 }
 
 static void
@@ -556,9 +564,10 @@ meta_xdg_output_destroy (struct wl_client   *client,
 }
 
 static const struct zxdg_output_v1_interface
-  meta_xdg_output_interface = {
-    meta_xdg_output_destroy,
-  };
+  meta_xdg_output_interface =
+{
+  meta_xdg_output_destroy,
+};
 
 static void
 send_xdg_output_events (struct wl_resource *resource,
@@ -649,10 +658,11 @@ meta_xdg_output_manager_destroy (struct wl_client   *client,
 }
 
 static const struct zxdg_output_manager_v1_interface
-  meta_xdg_output_manager_interface = {
-    meta_xdg_output_manager_destroy,
-    meta_xdg_output_manager_get_xdg_output,
-  };
+  meta_xdg_output_manager_interface =
+{
+  meta_xdg_output_manager_destroy,
+  meta_xdg_output_manager_get_xdg_output,
+};
 
 static void
 bind_xdg_output_manager (struct wl_client *client,
@@ -680,8 +690,10 @@ meta_wayland_outputs_init (MetaWaylandCompositor *compositor)
   g_signal_connect (monitors, "monitors-changed-internal",
                     G_CALLBACK (on_monitors_changed), compositor);
 
-  compositor->outputs = g_hash_table_new_full (NULL, NULL, NULL, wayland_output_destroy_notify);
-  compositor->outputs = meta_wayland_compositor_update_outputs (compositor, monitors);
+  compositor->outputs = g_hash_table_new_full (NULL, NULL, NULL,
+                                               wayland_output_destroy_notify);
+  compositor->outputs = meta_wayland_compositor_update_outputs (compositor,
+                                                                monitors);
 
   wl_global_create (compositor->wayland_display,
                     &zxdg_output_manager_v1_interface,
diff --git a/src/wayland/meta-wayland-pointer-constraints.c b/src/wayland/meta-wayland-pointer-constraints.c
index a33b672f1..5ad8038e4 100644
--- a/src/wayland/meta-wayland-pointer-constraints.c
+++ b/src/wayland/meta-wayland-pointer-constraints.c
@@ -102,10 +102,12 @@ static const MetaWaylandPointerGrabInterface locked_pointer_grab_interface;
 static const MetaWaylandPointerGrabInterface confined_pointer_grab_interface;
 
 static void
-meta_wayland_pointer_constraint_destroy (MetaWaylandPointerConstraint *constraint);
+meta_wayland_pointer_constraint_destroy (
+  MetaWaylandPointerConstraint *constraint);
 
 static void
-meta_wayland_pointer_constraint_maybe_enable (MetaWaylandPointerConstraint *constraint);
+meta_wayland_pointer_constraint_maybe_enable (
+  MetaWaylandPointerConstraint *constraint);
 
 static void
 meta_wayland_pointer_constraint_maybe_enable_for_window (MetaWindow *window);
@@ -129,8 +131,9 @@ appears_focused_changed (MetaWindow *window,
   MetaWaylandCompositor *wayland_compositor;
 
   wayland_compositor = meta_wayland_compositor_get_default ();
-  meta_wayland_pointer_constraint_maybe_remove_for_seat (wayland_compositor->seat,
-                                                         window);
+  meta_wayland_pointer_constraint_maybe_remove_for_seat (
+    wayland_compositor->seat,
+    window);
 
   meta_wayland_pointer_constraint_maybe_enable_for_window (window);
 }
@@ -222,8 +225,9 @@ surface_constraint_data_free (MetaWaylandSurfacePointerConstraintsData *data)
 }
 
 static void
-constrained_surface_destroyed (MetaWaylandSurface                       *surface,
-                               MetaWaylandSurfacePointerConstraintsData *data)
+constrained_surface_destroyed (
+  MetaWaylandSurface                       *surface,
+  MetaWaylandSurfacePointerConstraintsData *data)
 {
   surface_constraint_data_free (data);
 }
@@ -293,12 +297,13 @@ pointer_focus_surface_changed (MetaWaylandPointer           *pointer,
 }
 
 static MetaWaylandPointerConstraint *
-meta_wayland_pointer_constraint_new (MetaWaylandSurface                      *surface,
-                                     MetaWaylandSeat                         *seat,
-                                     MetaWaylandRegion                       *region,
-                                     enum zwp_pointer_constraints_v1_lifetime lifetime,
-                                     struct wl_resource                      *resource,
-                                     const MetaWaylandPointerGrabInterface   *grab_interface)
+meta_wayland_pointer_constraint_new (
+  MetaWaylandSurface                      *surface,
+  MetaWaylandSeat                         *seat,
+  MetaWaylandRegion                       *region,
+  enum zwp_pointer_constraints_v1_lifetime lifetime,
+  struct wl_resource                      *resource,
+  const MetaWaylandPointerGrabInterface   *grab_interface)
 {
   MetaWaylandPointerConstraint *constraint;
 
@@ -331,13 +336,15 @@ meta_wayland_pointer_constraint_new (MetaWaylandSurface                      *su
 }
 
 static gboolean
-meta_wayland_pointer_constraint_is_enabled (MetaWaylandPointerConstraint *constraint)
+meta_wayland_pointer_constraint_is_enabled (
+  MetaWaylandPointerConstraint *constraint)
 {
   return constraint->is_enabled;
 }
 
 static void
-meta_wayland_pointer_constraint_notify_activated (MetaWaylandPointerConstraint *constraint)
+meta_wayland_pointer_constraint_notify_activated (
+  MetaWaylandPointerConstraint *constraint)
 {
   struct wl_resource *resource = constraint->resource;
 
@@ -356,7 +363,8 @@ meta_wayland_pointer_constraint_notify_activated (MetaWaylandPointerConstraint *
 }
 
 static void
-meta_wayland_pointer_constraint_notify_deactivated (MetaWaylandPointerConstraint *constraint)
+meta_wayland_pointer_constraint_notify_deactivated (
+  MetaWaylandPointerConstraint *constraint)
 {
   struct wl_resource *resource = constraint->resource;
 
@@ -371,7 +379,8 @@ meta_wayland_pointer_constraint_notify_deactivated (MetaWaylandPointerConstraint
 }
 
 static MetaPointerConstraint *
-meta_wayland_pointer_constraint_create_pointer_constraint (MetaWaylandPointerConstraint *constraint)
+meta_wayland_pointer_constraint_create_pointer_constraint (
+  MetaWaylandPointerConstraint *constraint)
 {
   struct wl_resource *resource = constraint->resource;
 
@@ -412,7 +421,8 @@ meta_wayland_pointer_constraint_enable (MetaWaylandPointerConstraint *constraint
 }
 
 static void
-meta_wayland_pointer_constraint_disable (MetaWaylandPointerConstraint *constraint)
+meta_wayland_pointer_constraint_disable (
+  MetaWaylandPointerConstraint *constraint)
 {
   constraint->is_enabled = FALSE;
   meta_wayland_pointer_constraint_notify_deactivated (constraint);
@@ -421,7 +431,8 @@ meta_wayland_pointer_constraint_disable (MetaWaylandPointerConstraint *constrain
 }
 
 void
-meta_wayland_pointer_constraint_destroy (MetaWaylandPointerConstraint *constraint)
+meta_wayland_pointer_constraint_destroy (
+  MetaWaylandPointerConstraint *constraint)
 {
   if (meta_wayland_pointer_constraint_is_enabled (constraint))
     meta_wayland_pointer_constraint_disable (constraint);
@@ -439,7 +450,8 @@ is_within_constraint_region (MetaWaylandPointerConstraint *constraint,
   cairo_region_t *region;
   gboolean is_within;
 
-  region = meta_wayland_pointer_constraint_calculate_effective_region (constraint);
+  region = meta_wayland_pointer_constraint_calculate_effective_region (
+    constraint);
   is_within = cairo_region_contains_point (region,
                                            wl_fixed_to_int (sx),
                                            wl_fixed_to_int (sy));
@@ -504,7 +516,8 @@ should_constraint_be_enabled (MetaWaylandPointerConstraint *constraint)
 }
 
 static void
-meta_wayland_pointer_constraint_maybe_enable (MetaWaylandPointerConstraint *constraint)
+meta_wayland_pointer_constraint_maybe_enable (
+  MetaWaylandPointerConstraint *constraint)
 {
   wl_fixed_t sx, sy;
 
@@ -533,7 +546,8 @@ meta_wayland_pointer_constraint_remove (MetaWaylandPointerConstraint *constraint
 }
 
 static void
-meta_wayland_pointer_constraint_deactivate (MetaWaylandPointerConstraint *constraint)
+meta_wayland_pointer_constraint_deactivate (
+  MetaWaylandPointerConstraint *constraint)
 {
   switch (constraint->lifetime)
     {
@@ -595,13 +609,15 @@ meta_wayland_pointer_constraint_maybe_enable_for_window (MetaWindow *window)
 }
 
 MetaWaylandSeat *
-meta_wayland_pointer_constraint_get_seat (MetaWaylandPointerConstraint *constraint)
+meta_wayland_pointer_constraint_get_seat (
+  MetaWaylandPointerConstraint *constraint)
 {
   return constraint->seat;
 }
 
 cairo_region_t *
-meta_wayland_pointer_constraint_calculate_effective_region (MetaWaylandPointerConstraint *constraint)
+meta_wayland_pointer_constraint_calculate_effective_region (
+  MetaWaylandPointerConstraint *constraint)
 {
   cairo_region_t *region;
   MetaWindow *window;
@@ -623,18 +639,19 @@ meta_wayland_pointer_constraint_calculate_effective_region (MetaWaylandPointerCo
       actual_height = window->buffer_rect.height - (frame->child_y +
                                                     frame->bottom_height);
       cairo_region_intersect_rectangle (region, &(cairo_rectangle_int_t) {
-                                          .x = frame->child_x,
-                                          .y = frame->child_y,
-                                          .width = actual_width,
-                                          .height = actual_height
-                                        });
+      .x = frame->child_x,
+      .y = frame->child_y,
+      .width = actual_width,
+      .height = actual_height
+    });
     }
 
   return region;
 }
 
 MetaWaylandSurface *
-meta_wayland_pointer_constraint_get_surface (MetaWaylandPointerConstraint *constraint)
+meta_wayland_pointer_constraint_get_surface (
+  MetaWaylandPointerConstraint *constraint)
 {
   return constraint->surface;
 }
@@ -652,7 +669,8 @@ pointer_constraint_resource_destroyed (struct wl_resource *resource)
 }
 
 static void
-pending_constraint_state_free (MetaWaylandPendingConstraintState *constraint_pending)
+pending_constraint_state_free (
+  MetaWaylandPendingConstraintState *constraint_pending)
 {
   g_clear_pointer (&constraint_pending->region, cairo_region_destroy);
   if (constraint_pending->constraint)
@@ -687,7 +705,8 @@ get_pending_constraint_state (MetaWaylandPointerConstraint *constraint)
 }
 
 static void
-pending_constraint_state_container_free (MetaWaylandPendingConstraintStateContainer *container)
+pending_constraint_state_container_free (
+  MetaWaylandPendingConstraintStateContainer *container)
 {
   g_list_free_full (container->pending_constraint_states,
                     (GDestroyNotify) pending_constraint_state_free);
@@ -703,11 +722,11 @@ ensure_pending_constraint_state_container (MetaWaylandPendingState *pending)
   if (!container)
     {
       container = g_new0 (MetaWaylandPendingConstraintStateContainer, 1);
-      g_object_set_qdata_full (G_OBJECT (pending),
+      g_object_set_qdata_full (G_OBJECT (
+                                 pending),
                                quark_pending_constraint_state,
                                container,
                                (GDestroyNotify) pending_constraint_state_container_free);
-
     }
 
   return container;
@@ -792,8 +811,9 @@ ensure_pending_constraint_state (MetaWaylandPointerConstraint *constraint)
 }
 
 static void
-meta_wayland_pointer_constraint_set_pending_region (MetaWaylandPointerConstraint *constraint,
-                                                    MetaWaylandRegion            *region)
+meta_wayland_pointer_constraint_set_pending_region (
+  MetaWaylandPointerConstraint *constraint,
+  MetaWaylandRegion            *region)
 {
   MetaWaylandPendingConstraintState *constraint_pending;
 
@@ -897,8 +917,8 @@ locked_pointer_destroy (struct wl_client   *client,
       float sx, sy;
       float x, y;
 
-      sx = (float)wl_fixed_to_double (constraint->x_hint);
-      sy = (float)wl_fixed_to_double (constraint->y_hint);
+      sx = (float) wl_fixed_to_double (constraint->x_hint);
+      sy = (float) wl_fixed_to_double (constraint->y_hint);
       meta_wayland_surface_get_absolute_coordinates (constraint->surface,
                                                      sx, sy,
                                                      &x, &y);
@@ -947,7 +967,8 @@ locked_pointer_set_region (struct wl_client   *client,
   meta_wayland_pointer_constraint_set_pending_region (constraint, region);
 }
 
-static const struct zwp_locked_pointer_v1_interface locked_pointer_interface = {
+static const struct zwp_locked_pointer_v1_interface locked_pointer_interface =
+{
   locked_pointer_destroy,
   locked_pointer_set_cursor_position_hint,
   locked_pointer_set_region,
@@ -983,7 +1004,8 @@ locked_pointer_grab_pointer_cancel (MetaWaylandPointerGrab *grab)
   meta_wayland_pointer_constraint_deactivate (constraint);
 }
 
-static const MetaWaylandPointerGrabInterface locked_pointer_grab_interface = {
+static const MetaWaylandPointerGrabInterface locked_pointer_grab_interface =
+{
   locked_pointer_grab_pointer_focus,
   locked_pointer_grab_pointer_motion,
   locked_pointer_grab_pointer_button,
@@ -1020,7 +1042,7 @@ pointer_constraints_lock_pointer (struct wl_client   *client,
 
 static void
 confined_pointer_grab_pointer_focus (MetaWaylandPointerGrab *grab,
-                                     MetaWaylandSurface *surface)
+                                     MetaWaylandSurface     *surface)
 {
 }
 
@@ -1054,7 +1076,8 @@ confined_pointer_grab_pointer_cancel (MetaWaylandPointerGrab *grab)
   meta_wayland_pointer_constraint_deactivate (constraint);
 }
 
-static const MetaWaylandPointerGrabInterface confined_pointer_grab_interface = {
+static const MetaWaylandPointerGrabInterface confined_pointer_grab_interface =
+{
   confined_pointer_grab_pointer_focus,
   confined_pointer_grab_pointer_motion,
   confined_pointer_grab_pointer_button,
@@ -1084,10 +1107,12 @@ confined_pointer_set_region (struct wl_client   *client,
   meta_wayland_pointer_constraint_set_pending_region (constraint, region);
 }
 
-static const struct zwp_confined_pointer_v1_interface confined_pointer_interface = {
+static const struct zwp_confined_pointer_v1_interface confined_pointer_interface
+  =
+  {
   confined_pointer_destroy,
   confined_pointer_set_region,
-};
+  };
 
 static void
 pointer_constraints_confine_pointer (struct wl_client   *client,
@@ -1108,10 +1133,10 @@ pointer_constraints_confine_pointer (struct wl_client   *client,
                            &zwp_confined_pointer_v1_interface,
                            &confined_pointer_interface,
                            &confined_pointer_grab_interface);
-
 }
 
-static const struct zwp_pointer_constraints_v1_interface pointer_constraints = {
+static const struct zwp_pointer_constraints_v1_interface pointer_constraints =
+{
   pointer_constraints_destroy,
   pointer_constraints_lock_pointer,
   pointer_constraints_confine_pointer,
@@ -1145,7 +1170,8 @@ meta_wayland_pointer_constraint_finalize (GObject *object)
   g_signal_handler_disconnect (constraint->seat->pointer,
                                constraint->pointer_focus_surface_handler_id);
 
-  G_OBJECT_CLASS (meta_wayland_pointer_constraint_parent_class)->finalize (object);
+  G_OBJECT_CLASS (meta_wayland_pointer_constraint_parent_class)->finalize (
+    object);
 }
 
 void
@@ -1163,7 +1189,8 @@ meta_wayland_pointer_constraint_init (MetaWaylandPointerConstraint *constraint)
 }
 
 static void
-meta_wayland_pointer_constraint_class_init (MetaWaylandPointerConstraintClass *klass)
+meta_wayland_pointer_constraint_class_init (
+  MetaWaylandPointerConstraintClass *klass)
 {
   GObjectClass *object_class;
 
diff --git a/src/wayland/meta-wayland-pointer-gesture-pinch.c 
b/src/wayland/meta-wayland-pointer-gesture-pinch.c
index f7b37ff27..87713e107 100644
--- a/src/wayland/meta-wayland-pointer-gesture-pinch.c
+++ b/src/wayland/meta-wayland-pointer-gesture-pinch.c
@@ -48,12 +48,12 @@ handle_pinch_begin (MetaWaylandPointer *pointer,
   fingers = clutter_event_get_touchpad_gesture_finger_count (event);
 
   wl_resource_for_each (resource, &pointer_client->pinch_gesture_resources)
-    {
-      zwp_pointer_gesture_pinch_v1_send_begin (resource, serial,
-                                               clutter_event_get_time (event),
-                                               pointer->focus_surface->resource,
-                                               fingers);
-    }
+  {
+    zwp_pointer_gesture_pinch_v1_send_begin (resource, serial,
+                                             clutter_event_get_time (event),
+                                             pointer->focus_surface->resource,
+                                             fingers);
+  }
 }
 
 static void
@@ -70,14 +70,14 @@ handle_pinch_update (MetaWaylandPointer *pointer,
   scale = clutter_event_get_gesture_pinch_scale (event);
 
   wl_resource_for_each (resource, &pointer_client->pinch_gesture_resources)
-    {
-      zwp_pointer_gesture_pinch_v1_send_update (resource,
-                                                clutter_event_get_time (event),
-                                                wl_fixed_from_double (dx),
-                                                wl_fixed_from_double (dy),
-                                                wl_fixed_from_double (scale),
-                                                wl_fixed_from_double (rotation));
-    }
+  {
+    zwp_pointer_gesture_pinch_v1_send_update (resource,
+                                              clutter_event_get_time (event),
+                                              wl_fixed_from_double (dx),
+                                              wl_fixed_from_double (dy),
+                                              wl_fixed_from_double (scale),
+                                              wl_fixed_from_double (rotation));
+  }
 }
 
 static void
@@ -98,11 +98,11 @@ handle_pinch_end (MetaWaylandPointer *pointer,
     cancelled = TRUE;
 
   wl_resource_for_each (resource, &pointer_client->pinch_gesture_resources)
-    {
-      zwp_pointer_gesture_pinch_v1_send_end (resource, serial,
-                                             clutter_event_get_time (event),
-                                             cancelled);
-    }
+  {
+    zwp_pointer_gesture_pinch_v1_send_end (resource, serial,
+                                           clutter_event_get_time (event),
+                                           cancelled);
+  }
 }
 
 gboolean
@@ -141,15 +141,18 @@ pointer_gesture_pinch_destroy (struct wl_client   *client,
   wl_resource_destroy (resource);
 }
 
-static const struct zwp_pointer_gesture_pinch_v1_interface pointer_gesture_pinch_interface = {
+static const struct zwp_pointer_gesture_pinch_v1_interface
+  pointer_gesture_pinch_interface =
+{
   pointer_gesture_pinch_destroy
 };
 
 void
-meta_wayland_pointer_gesture_pinch_create_new_resource (MetaWaylandPointer *pointer,
-                                                        struct wl_client   *client,
-                                                        struct wl_resource *gestures_resource,
-                                                        uint32_t            id)
+meta_wayland_pointer_gesture_pinch_create_new_resource (
+  MetaWaylandPointer *pointer,
+  struct wl_client   *client,
+  struct wl_resource *gestures_resource,
+  uint32_t            id)
 {
   MetaWaylandPointerClient *pointer_client;
   struct wl_resource *res;
@@ -159,7 +162,8 @@ meta_wayland_pointer_gesture_pinch_create_new_resource (MetaWaylandPointer *poin
 
   res = wl_resource_create (client, &zwp_pointer_gesture_pinch_v1_interface,
                             wl_resource_get_version (gestures_resource), id);
-  wl_resource_set_implementation (res, &pointer_gesture_pinch_interface, pointer,
+  wl_resource_set_implementation (res, &pointer_gesture_pinch_interface,
+                                  pointer,
                                   meta_wayland_pointer_unbind_pointer_client_resource);
   wl_list_insert (&pointer_client->pinch_gesture_resources,
                   wl_resource_get_link (res));
diff --git a/src/wayland/meta-wayland-pointer-gesture-swipe.c 
b/src/wayland/meta-wayland-pointer-gesture-swipe.c
index 043e3eb23..ebb5e9dde 100644
--- a/src/wayland/meta-wayland-pointer-gesture-swipe.c
+++ b/src/wayland/meta-wayland-pointer-gesture-swipe.c
@@ -48,12 +48,12 @@ handle_swipe_begin (MetaWaylandPointer *pointer,
   fingers = clutter_event_get_touchpad_gesture_finger_count (event);
 
   wl_resource_for_each (resource, &pointer_client->swipe_gesture_resources)
-    {
-      zwp_pointer_gesture_swipe_v1_send_begin (resource, serial,
-                                               clutter_event_get_time (event),
-                                               pointer->focus_surface->resource,
-                                               fingers);
-    }
+  {
+    zwp_pointer_gesture_swipe_v1_send_begin (resource, serial,
+                                             clutter_event_get_time (event),
+                                             pointer->focus_surface->resource,
+                                             fingers);
+  }
 }
 
 static void
@@ -68,12 +68,12 @@ handle_swipe_update (MetaWaylandPointer *pointer,
   clutter_event_get_gesture_motion_delta (event, &dx, &dy);
 
   wl_resource_for_each (resource, &pointer_client->swipe_gesture_resources)
-    {
-      zwp_pointer_gesture_swipe_v1_send_update (resource,
-                                                clutter_event_get_time (event),
-                                                wl_fixed_from_double (dx),
-                                                wl_fixed_from_double (dy));
-    }
+  {
+    zwp_pointer_gesture_swipe_v1_send_update (resource,
+                                              clutter_event_get_time (event),
+                                              wl_fixed_from_double (dx),
+                                              wl_fixed_from_double (dy));
+  }
 }
 
 static void
@@ -94,11 +94,11 @@ handle_swipe_end (MetaWaylandPointer *pointer,
     cancelled = TRUE;
 
   wl_resource_for_each (resource, &pointer_client->swipe_gesture_resources)
-    {
-      zwp_pointer_gesture_swipe_v1_send_end (resource, serial,
-                                             clutter_event_get_time (event),
-                                             cancelled);
-    }
+  {
+    zwp_pointer_gesture_swipe_v1_send_end (resource, serial,
+                                           clutter_event_get_time (event),
+                                           cancelled);
+  }
 }
 
 gboolean
@@ -136,15 +136,18 @@ pointer_gesture_swipe_release (struct wl_client   *client,
   wl_resource_destroy (resource);
 }
 
-static const struct zwp_pointer_gesture_swipe_v1_interface pointer_gesture_swipe_interface = {
+static const struct zwp_pointer_gesture_swipe_v1_interface
+  pointer_gesture_swipe_interface =
+{
   pointer_gesture_swipe_release
 };
 
 void
-meta_wayland_pointer_gesture_swipe_create_new_resource (MetaWaylandPointer *pointer,
-                                                        struct wl_client   *client,
-                                                        struct wl_resource *pointer_resource,
-                                                        uint32_t            id)
+meta_wayland_pointer_gesture_swipe_create_new_resource (
+  MetaWaylandPointer *pointer,
+  struct wl_client   *client,
+  struct wl_resource *pointer_resource,
+  uint32_t            id)
 {
   MetaWaylandPointerClient *pointer_client;
   struct wl_resource *res;
@@ -154,7 +157,8 @@ meta_wayland_pointer_gesture_swipe_create_new_resource (MetaWaylandPointer *poin
 
   res = wl_resource_create (client, &zwp_pointer_gesture_swipe_v1_interface,
                             wl_resource_get_version (pointer_resource), id);
-  wl_resource_set_implementation (res, &pointer_gesture_swipe_interface, pointer,
+  wl_resource_set_implementation (res, &pointer_gesture_swipe_interface,
+                                  pointer,
                                   meta_wayland_pointer_unbind_pointer_client_resource);
   wl_list_insert (&pointer_client->swipe_gesture_resources,
                   wl_resource_get_link (res));
diff --git a/src/wayland/meta-wayland-pointer-gestures.c b/src/wayland/meta-wayland-pointer-gestures.c
index 7222a8a8c..6de8fb954 100644
--- a/src/wayland/meta-wayland-pointer-gestures.c
+++ b/src/wayland/meta-wayland-pointer-gestures.c
@@ -40,7 +40,8 @@ gestures_get_swipe (struct wl_client   *client,
 {
   MetaWaylandPointer *pointer = wl_resource_get_user_data (pointer_resource);
 
-  meta_wayland_pointer_gesture_swipe_create_new_resource (pointer, client, resource, id);
+  meta_wayland_pointer_gesture_swipe_create_new_resource (pointer, client,
+                                                          resource, id);
 }
 
 static void
@@ -51,13 +52,16 @@ gestures_get_pinch (struct wl_client   *client,
 {
   MetaWaylandPointer *pointer = wl_resource_get_user_data (pointer_resource);
 
-  meta_wayland_pointer_gesture_pinch_create_new_resource (pointer, client, resource, id);
+  meta_wayland_pointer_gesture_pinch_create_new_resource (pointer, client,
+                                                          resource, id);
 }
 
-static const struct zwp_pointer_gestures_v1_interface pointer_gestures_interface = {
+static const struct zwp_pointer_gestures_v1_interface pointer_gestures_interface
+  =
+  {
   gestures_get_swipe,
   gestures_get_pinch
-};
+  };
 
 static void
 bind_pointer_gestures (struct wl_client *client,
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index 27b8f38cd..431e1aeab 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -74,7 +74,8 @@
 
 #define DEFAULT_AXIS_STEP_DISTANCE wl_fixed_from_int (10)
 
-enum {
+enum
+{
   FOCUS_SURFACE_CHANGED,
 
   LAST_SIGNAL
@@ -119,25 +120,28 @@ meta_wayland_pointer_client_free (MetaWaylandPointerClient *pointer_client)
    * resources in the pointer client instance gets removed.
    */
   wl_resource_for_each_safe (resource, next, &pointer_client->pointer_resources)
-    {
-      wl_list_remove (wl_resource_get_link (resource));
-      wl_list_init (wl_resource_get_link (resource));
-    }
-  wl_resource_for_each_safe (resource, next, &pointer_client->swipe_gesture_resources)
-    {
-      wl_list_remove (wl_resource_get_link (resource));
-      wl_list_init (wl_resource_get_link (resource));
-    }
-  wl_resource_for_each_safe (resource, next, &pointer_client->pinch_gesture_resources)
-    {
-      wl_list_remove (wl_resource_get_link (resource));
-      wl_list_init (wl_resource_get_link (resource));
-    }
-  wl_resource_for_each_safe (resource, next, &pointer_client->relative_pointer_resources)
-    {
-      wl_list_remove (wl_resource_get_link (resource));
-      wl_list_init (wl_resource_get_link (resource));
-    }
+  {
+    wl_list_remove (wl_resource_get_link (resource));
+    wl_list_init (wl_resource_get_link (resource));
+  }
+  wl_resource_for_each_safe (resource, next,
+                             &pointer_client->swipe_gesture_resources)
+  {
+    wl_list_remove (wl_resource_get_link (resource));
+    wl_list_init (wl_resource_get_link (resource));
+  }
+  wl_resource_for_each_safe (resource, next,
+                             &pointer_client->pinch_gesture_resources)
+  {
+    wl_list_remove (wl_resource_get_link (resource));
+    wl_list_init (wl_resource_get_link (resource));
+  }
+  wl_resource_for_each_safe (resource, next,
+                             &pointer_client->relative_pointer_resources)
+  {
+    wl_list_remove (wl_resource_get_link (resource));
+    wl_list_init (wl_resource_get_link (resource));
+  }
 
   g_slice_free (MetaWaylandPointerClient, pointer_client);
 }
@@ -195,7 +199,8 @@ meta_wayland_pointer_cleanup_pointer_client (MetaWaylandPointer       *pointer,
 }
 
 void
-meta_wayland_pointer_unbind_pointer_client_resource (struct wl_resource *resource)
+meta_wayland_pointer_unbind_pointer_client_resource (
+  struct wl_resource *resource)
 {
   MetaWaylandPointer *pointer = wl_resource_get_user_data (resource);
   MetaWaylandPointerClient *pointer_client;
@@ -237,23 +242,24 @@ sync_focus_surface (MetaWaylandPointer *pointer)
 
     case META_EVENT_ROUTE_NORMAL:
     case META_EVENT_ROUTE_WAYLAND_POPUP:
-      {
-        const MetaWaylandPointerGrabInterface *interface = pointer->grab->interface;
-        interface->focus (pointer->grab, pointer->current);
-      }
-      break;
+    {
+      const MetaWaylandPointerGrabInterface *interface =
+        pointer->grab->interface;
+      interface->focus (pointer->grab, pointer->current);
+    }
+    break;
 
     default:
       g_assert_not_reached ();
     }
-
 }
 
 static void
 meta_wayland_pointer_send_frame (MetaWaylandPointer *pointer,
-                                struct wl_resource *resource)
+                                 struct wl_resource *resource)
 {
-  if (wl_resource_get_version (resource) >= WL_POINTER_AXIS_SOURCE_SINCE_VERSION)
+  if (wl_resource_get_version (resource) >=
+      WL_POINTER_AXIS_SOURCE_SINCE_VERSION)
     wl_pointer_send_frame (resource);
 }
 
@@ -266,9 +272,9 @@ meta_wayland_pointer_broadcast_frame (MetaWaylandPointer *pointer)
     return;
 
   wl_resource_for_each (resource, &pointer->focus_client->pointer_resources)
-    {
-      meta_wayland_pointer_send_frame (pointer, resource);
-    }
+  {
+    meta_wayland_pointer_send_frame (pointer, resource);
+  }
 }
 
 void
@@ -297,7 +303,7 @@ meta_wayland_pointer_send_relative_motion (MetaWaylandPointer *pointer,
   time_us = clutter_evdev_event_get_time_usec (event);
   if (time_us == 0)
 #endif
-    time_us = clutter_event_get_time (event) * 1000ULL;
+  time_us = clutter_event_get_time (event) * 1000ULL;
   time_us_hi = (uint32_t) (time_us >> 32);
   time_us_lo = (uint32_t) time_us;
   dxf = wl_fixed_from_double (dx);
@@ -307,15 +313,15 @@ meta_wayland_pointer_send_relative_motion (MetaWaylandPointer *pointer,
 
   wl_resource_for_each (resource,
                         &pointer->focus_client->relative_pointer_resources)
-    {
-      zwp_relative_pointer_v1_send_relative_motion (resource,
-                                                    time_us_hi,
-                                                    time_us_lo,
-                                                    dxf,
-                                                    dyf,
-                                                    dx_unaccelf,
-                                                    dy_unaccelf);
-    }
+  {
+    zwp_relative_pointer_v1_send_relative_motion (resource,
+                                                  time_us_hi,
+                                                  time_us_lo,
+                                                  dxf,
+                                                  dyf,
+                                                  dx_unaccelf,
+                                                  dy_unaccelf);
+  }
 }
 
 void
@@ -336,11 +342,11 @@ meta_wayland_pointer_send_motion (MetaWaylandPointer *pointer,
                                                  &sx, &sy);
 
   wl_resource_for_each (resource, &pointer->focus_client->pointer_resources)
-    {
-      wl_pointer_send_motion (resource, time,
-                              wl_fixed_from_double (sx),
-                              wl_fixed_from_double (sy));
-    }
+  {
+    wl_pointer_send_motion (resource, time,
+                            wl_fixed_from_double (sx),
+                            wl_fixed_from_double (sy));
+  }
 
   meta_wayland_pointer_send_relative_motion (pointer, event);
 
@@ -371,39 +377,39 @@ meta_wayland_pointer_send_button (MetaWaylandPointer *pointer,
         button = clutter_evdev_event_get_event_code (event);
       else
 #endif
-        {
-          button = clutter_event_get_button (event);
-          switch (button)
-            {
-            case 1:
-              button = BTN_LEFT;
-              break;
-
-              /* The evdev input right and middle button numbers are swapped
-                 relative to how Clutter numbers them */
-            case 2:
-              button = BTN_MIDDLE;
-              break;
-
-            case 3:
-              button = BTN_RIGHT;
-              break;
-
-            default:
-              button = button + (BTN_LEFT - 1) + 4;
-              break;
-            }
-        }
+      {
+        button = clutter_event_get_button (event);
+        switch (button)
+          {
+          case 1:
+            button = BTN_LEFT;
+            break;
+
+          /* The evdev input right and middle button numbers are swapped
+           *  relative to how Clutter numbers them */
+          case 2:
+            button = BTN_MIDDLE;
+            break;
+
+          case 3:
+            button = BTN_RIGHT;
+            break;
+
+          default:
+            button = button + (BTN_LEFT - 1) + 4;
+            break;
+          }
+      }
 
       time = clutter_event_get_time (event);
       serial = meta_wayland_input_device_next_serial (input_device);
 
       wl_resource_for_each (resource, &pointer->focus_client->pointer_resources)
-        {
-          wl_pointer_send_button (resource, serial,
-                                  time, button,
-                                  event_type == CLUTTER_BUTTON_PRESS ? 1 : 0);
-        }
+      {
+        wl_pointer_send_button (resource, serial,
+                                time, button,
+                                event_type == CLUTTER_BUTTON_PRESS ? 1 : 0);
+      }
 
       meta_wayland_pointer_broadcast_frame (pointer);
     }
@@ -442,7 +448,7 @@ default_grab_focus (MetaWaylandPointerGrab *grab,
 
 static void
 default_grab_motion (MetaWaylandPointerGrab *grab,
-                    const ClutterEvent     *event)
+                     const ClutterEvent     *event)
 {
   MetaWaylandPointer *pointer = grab->pointer;
 
@@ -451,21 +457,22 @@ default_grab_motion (MetaWaylandPointerGrab *grab,
 
 static void
 default_grab_button (MetaWaylandPointerGrab *grab,
-                    const ClutterEvent     *event)
+                     const ClutterEvent     *event)
 {
   MetaWaylandPointer *pointer = grab->pointer;
 
   meta_wayland_pointer_send_button (pointer, event);
 }
 
-static const MetaWaylandPointerGrabInterface default_pointer_grab_interface = {
+static const MetaWaylandPointerGrabInterface default_pointer_grab_interface =
+{
   default_grab_focus,
   default_grab_motion,
   default_grab_button
 };
 
 static void
-meta_wayland_pointer_on_cursor_changed (MetaCursorTracker *cursor_tracker,
+meta_wayland_pointer_on_cursor_changed (MetaCursorTracker  *cursor_tracker,
                                         MetaWaylandPointer *pointer)
 {
   if (pointer->cursor_surface)
@@ -486,7 +493,8 @@ meta_wayland_pointer_enable (MetaWaylandPointer *pointer)
   pointer->cursor_surface = NULL;
 
   manager = clutter_device_manager_get_default ();
-  pointer->device = clutter_device_manager_get_core_device (manager, CLUTTER_POINTER_DEVICE);
+  pointer->device = clutter_device_manager_get_core_device (manager,
+                                                            CLUTTER_POINTER_DEVICE);
 
   g_signal_connect (cursor_tracker,
                     "cursor-changed",
@@ -523,10 +531,10 @@ static int
 count_buttons (const ClutterEvent *event)
 {
   static gint maskmap[5] =
-    {
-      CLUTTER_BUTTON1_MASK, CLUTTER_BUTTON2_MASK, CLUTTER_BUTTON3_MASK,
-      CLUTTER_BUTTON4_MASK, CLUTTER_BUTTON5_MASK
-    };
+  {
+    CLUTTER_BUTTON1_MASK, CLUTTER_BUTTON2_MASK, CLUTTER_BUTTON3_MASK,
+    CLUTTER_BUTTON4_MASK, CLUTTER_BUTTON5_MASK
+  };
   ClutterModifierType mod_mask;
   int i, count;
 
@@ -535,7 +543,7 @@ count_buttons (const ClutterEvent *event)
   for (i = 0; i < 5; i++)
     {
       if (mod_mask & maskmap[i])
-       count++;
+        count++;
     }
 
   return count;
@@ -633,7 +641,8 @@ handle_button_event (MetaWaylandPointer *pointer,
 {
   gboolean implicit_grab;
 
-  implicit_grab = (event->type == CLUTTER_BUTTON_PRESS) && (pointer->button_count == 1);
+  implicit_grab = (event->type == CLUTTER_BUTTON_PRESS) &&
+                  (pointer->button_count == 1);
   if (implicit_grab)
     {
       pointer->grab_button = clutter_event_get_button (event);
@@ -702,17 +711,17 @@ handle_scroll_event (MetaWaylandPointer *pointer,
       break;
 
     case CLUTTER_SCROLL_SMOOTH:
-      {
-        double dx, dy;
-        /* Clutter smooth scroll events are in discrete steps (1 step = 1.0 long
-         * vector along one axis). To convert to smooth scroll events that are
-         * in pointer motion event space, multiply the vector with the 10. */
-        const double factor = 10.0;
-        clutter_event_get_scroll_delta (event, &dx, &dy);
-        x_value = wl_fixed_from_double (dx) * factor;
-        y_value = wl_fixed_from_double (dy) * factor;
-      }
-      break;
+    {
+      double dx, dy;
+      /* Clutter smooth scroll events are in discrete steps (1 step = 1.0 long
+       * vector along one axis). To convert to smooth scroll events that are
+       * in pointer motion event space, multiply the vector with the 10. */
+      const double factor = 10.0;
+      clutter_event_get_scroll_delta (event, &dx, &dy);
+      x_value = wl_fixed_from_double (dx) * factor;
+      y_value = wl_fixed_from_double (dy) * factor;
+    }
+    break;
 
     default:
       return;
@@ -721,43 +730,48 @@ handle_scroll_event (MetaWaylandPointer *pointer,
   if (pointer->focus_client)
     {
       wl_resource_for_each (resource, &pointer->focus_client->pointer_resources)
-        {
-          if (wl_resource_get_version (resource) >= WL_POINTER_AXIS_SOURCE_SINCE_VERSION)
-            wl_pointer_send_axis_source (resource, source);
-
-          /* X axis */
-          if (x_discrete != 0 &&
-              wl_resource_get_version (resource) >= WL_POINTER_AXIS_DISCRETE_SINCE_VERSION)
-            wl_pointer_send_axis_discrete (resource,
-                                           WL_POINTER_AXIS_HORIZONTAL_SCROLL,
-                                           x_discrete);
-
-          if (x_value)
-            wl_pointer_send_axis (resource, clutter_event_get_time (event),
-                                  WL_POINTER_AXIS_HORIZONTAL_SCROLL, x_value);
-
-          if ((event->scroll.finish_flags & CLUTTER_SCROLL_FINISHED_HORIZONTAL) &&
-              wl_resource_get_version (resource) >= WL_POINTER_AXIS_STOP_SINCE_VERSION)
-            wl_pointer_send_axis_stop (resource,
-                                       clutter_event_get_time (event),
-                                       WL_POINTER_AXIS_HORIZONTAL_SCROLL);
-          /* Y axis */
-          if (y_discrete != 0 &&
-              wl_resource_get_version (resource) >= WL_POINTER_AXIS_DISCRETE_SINCE_VERSION)
-            wl_pointer_send_axis_discrete (resource,
-                                           WL_POINTER_AXIS_VERTICAL_SCROLL,
-                                           y_discrete);
-
-          if (y_value)
-            wl_pointer_send_axis (resource, clutter_event_get_time (event),
-                                  WL_POINTER_AXIS_VERTICAL_SCROLL, y_value);
-
-          if ((event->scroll.finish_flags & CLUTTER_SCROLL_FINISHED_VERTICAL) &&
-              wl_resource_get_version (resource) >= WL_POINTER_AXIS_STOP_SINCE_VERSION)
-            wl_pointer_send_axis_stop (resource,
-                                       clutter_event_get_time (event),
-                                       WL_POINTER_AXIS_VERTICAL_SCROLL);
-        }
+      {
+        if (wl_resource_get_version (resource) >=
+            WL_POINTER_AXIS_SOURCE_SINCE_VERSION)
+          wl_pointer_send_axis_source (resource, source);
+
+        /* X axis */
+        if (x_discrete != 0 &&
+            wl_resource_get_version (resource) >=
+            WL_POINTER_AXIS_DISCRETE_SINCE_VERSION)
+          wl_pointer_send_axis_discrete (resource,
+                                         WL_POINTER_AXIS_HORIZONTAL_SCROLL,
+                                         x_discrete);
+
+        if (x_value)
+          wl_pointer_send_axis (resource, clutter_event_get_time (event),
+                                WL_POINTER_AXIS_HORIZONTAL_SCROLL, x_value);
+
+        if ((event->scroll.finish_flags & CLUTTER_SCROLL_FINISHED_HORIZONTAL) &&
+            wl_resource_get_version (resource) >=
+            WL_POINTER_AXIS_STOP_SINCE_VERSION)
+          wl_pointer_send_axis_stop (resource,
+                                     clutter_event_get_time (event),
+                                     WL_POINTER_AXIS_HORIZONTAL_SCROLL);
+        /* Y axis */
+        if (y_discrete != 0 &&
+            wl_resource_get_version (resource) >=
+            WL_POINTER_AXIS_DISCRETE_SINCE_VERSION)
+          wl_pointer_send_axis_discrete (resource,
+                                         WL_POINTER_AXIS_VERTICAL_SCROLL,
+                                         y_discrete);
+
+        if (y_value)
+          wl_pointer_send_axis (resource, clutter_event_get_time (event),
+                                WL_POINTER_AXIS_VERTICAL_SCROLL, y_value);
+
+        if ((event->scroll.finish_flags & CLUTTER_SCROLL_FINISHED_VERTICAL) &&
+            wl_resource_get_version (resource) >=
+            WL_POINTER_AXIS_STOP_SINCE_VERSION)
+          wl_pointer_send_axis_stop (resource,
+                                     clutter_event_get_time (event),
+                                     WL_POINTER_AXIS_VERTICAL_SCROLL);
+      }
 
       meta_wayland_pointer_broadcast_frame (pointer);
     }
@@ -830,8 +844,8 @@ meta_wayland_pointer_broadcast_enter (MetaWaylandPointer *pointer,
 
   wl_resource_for_each (pointer_resource,
                         &pointer->focus_client->pointer_resources)
-    meta_wayland_pointer_send_enter (pointer, pointer_resource,
-                                     serial, surface);
+  meta_wayland_pointer_send_enter (pointer, pointer_resource,
+                                   serial, surface);
 
   meta_wayland_pointer_broadcast_frame (pointer);
 }
@@ -845,8 +859,8 @@ meta_wayland_pointer_broadcast_leave (MetaWaylandPointer *pointer,
 
   wl_resource_for_each (pointer_resource,
                         &pointer->focus_client->pointer_resources)
-    meta_wayland_pointer_send_leave (pointer, pointer_resource,
-                                     serial, surface);
+  meta_wayland_pointer_send_leave (pointer, pointer_resource,
+                                   serial, surface);
 
   meta_wayland_pointer_broadcast_frame (pointer);
 }
@@ -903,7 +917,8 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
 
       if (pointer->focus_surface->window)
         meta_window_handle_enter (pointer->focus_surface->window,
-                                  /* XXX -- can we reliably get a timestamp for setting focus? */
+                                  /* XXX -- can we reliably get a timestamp for
+                                   * setting focus? */
                                   clutter_get_current_event_time (),
                                   pos.x, pos.y);
 
@@ -925,7 +940,7 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
 }
 
 void
-meta_wayland_pointer_start_grab (MetaWaylandPointer *pointer,
+meta_wayland_pointer_start_grab (MetaWaylandPointer     *pointer,
                                  MetaWaylandPointerGrab *grab)
 {
   const MetaWaylandPointerGrabInterface *interface;
@@ -967,7 +982,7 @@ meta_wayland_pointer_cancel_grab (MetaWaylandPointer *pointer)
 void
 meta_wayland_pointer_end_popup_grab (MetaWaylandPointer *pointer)
 {
-  MetaWaylandPopupGrab *popup_grab = (MetaWaylandPopupGrab*)pointer->grab;
+  MetaWaylandPopupGrab *popup_grab = (MetaWaylandPopupGrab *) pointer->grab;
 
   meta_wayland_popup_grab_destroy (popup_grab);
 }
@@ -985,7 +1000,7 @@ meta_wayland_pointer_start_popup_grab (MetaWaylandPointer      *pointer,
   if (pointer->grab == &pointer->default_grab)
     grab = meta_wayland_popup_grab_create (pointer, popup_surface);
   else
-    grab = (MetaWaylandPopupGrab*)pointer->grab;
+    grab = (MetaWaylandPopupGrab *) pointer->grab;
 
   return meta_wayland_popup_create (popup_surface, grab);
 }
@@ -998,15 +1013,16 @@ meta_wayland_pointer_repick (MetaWaylandPointer *pointer)
 
 void
 meta_wayland_pointer_get_relative_coordinates (MetaWaylandPointer *pointer,
-                                              MetaWaylandSurface *surface,
-                                              wl_fixed_t         *sx,
-                                              wl_fixed_t         *sy)
+                                               MetaWaylandSurface *surface,
+                                               wl_fixed_t         *sx,
+                                               wl_fixed_t         *sy)
 {
   float xf = 0.0f, yf = 0.0f;
   ClutterPoint pos;
 
   clutter_input_device_get_coords (pointer->device, NULL, &pos);
-  meta_wayland_surface_get_relative_coordinates (surface, pos.x, pos.y, &xf, &yf);
+  meta_wayland_surface_get_relative_coordinates (surface, pos.x, pos.y, &xf,
+                                                 &yf);
 
   *sx = wl_fixed_from_double (xf);
   *sy = wl_fixed_from_double (yf);
@@ -1027,7 +1043,8 @@ meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer)
           MetaWaylandCursorSurface *cursor_surface =
             META_WAYLAND_CURSOR_SURFACE (pointer->cursor_surface->role);
 
-          cursor_sprite = meta_wayland_cursor_surface_get_sprite (cursor_surface);
+          cursor_sprite =
+            meta_wayland_cursor_surface_get_sprite (cursor_surface);
         }
 
       meta_cursor_tracker_set_window_cursor (cursor_tracker, cursor_sprite);
@@ -1090,7 +1107,8 @@ pointer_set_cursor (struct wl_client *client,
   MetaWaylandPointer *pointer = wl_resource_get_user_data (resource);
   MetaWaylandSurface *surface;
 
-  surface = (surface_resource ? wl_resource_get_user_data (surface_resource) : NULL);
+  surface =
+    (surface_resource ? wl_resource_get_user_data (surface_resource) : NULL);
 
   if (pointer->focus_surface == NULL)
     return;
@@ -1127,13 +1145,14 @@ pointer_set_cursor (struct wl_client *client,
 }
 
 static void
-pointer_release (struct wl_client *client,
+pointer_release (struct wl_client   *client,
                  struct wl_resource *resource)
 {
   wl_resource_destroy (resource);
 }
 
-static const struct wl_pointer_interface pointer_interface = {
+static const struct wl_pointer_interface pointer_interface =
+{
   pointer_set_cursor,
   pointer_release,
 };
@@ -1142,7 +1161,7 @@ void
 meta_wayland_pointer_create_new_resource (MetaWaylandPointer *pointer,
                                           struct wl_client   *client,
                                           struct wl_resource *seat_resource,
-                                          uint32_t id)
+                                          uint32_t            id)
 {
   struct wl_resource *resource;
   MetaWaylandPointerClient *pointer_client;
@@ -1209,23 +1228,25 @@ meta_wayland_pointer_get_top_popup (MetaWaylandPointer *pointer)
   if (!meta_wayland_pointer_grab_is_popup_grab (pointer->grab))
     return NULL;
 
-  grab = (MetaWaylandPopupGrab*)pointer->grab;
-  return meta_wayland_popup_grab_get_top_popup(grab);
+  grab = (MetaWaylandPopupGrab *) pointer->grab;
+  return meta_wayland_popup_grab_get_top_popup (grab);
 }
 
 static void
-relative_pointer_destroy (struct wl_client *client,
+relative_pointer_destroy (struct wl_client   *client,
                           struct wl_resource *resource)
 {
   wl_resource_destroy (resource);
 }
 
-static const struct zwp_relative_pointer_v1_interface relative_pointer_interface = {
+static const struct zwp_relative_pointer_v1_interface relative_pointer_interface
+  =
+  {
   relative_pointer_destroy
-};
+  };
 
 static void
-relative_pointer_manager_destroy (struct wl_client *client,
+relative_pointer_manager_destroy (struct wl_client   *client,
                                   struct wl_resource *resource)
 {
   wl_resource_destroy (resource);
@@ -1260,7 +1281,9 @@ relative_pointer_manager_get_relative_pointer (struct wl_client   *client,
                   wl_resource_get_link (resource));
 }
 
-static const struct zwp_relative_pointer_manager_v1_interface relative_pointer_manager = {
+static const struct zwp_relative_pointer_manager_v1_interface
+  relative_pointer_manager =
+{
   relative_pointer_manager_destroy,
   relative_pointer_manager_get_relative_pointer,
 };
diff --git a/src/wayland/meta-wayland-popup.c b/src/wayland/meta-wayland-popup.c
index ce9a8b81e..043eb1a84 100644
--- a/src/wayland/meta-wayland-popup.c
+++ b/src/wayland/meta-wayland-popup.c
@@ -53,10 +53,10 @@ G_DEFINE_INTERFACE (MetaWaylandPopupSurface, meta_wayland_popup_surface,
 
 struct _MetaWaylandPopupGrab
 {
-  MetaWaylandPointerGrab  generic;
+  MetaWaylandPointerGrab generic;
 
-  struct wl_client       *grab_client;
-  struct wl_list          all_popups;
+  struct wl_client *grab_client;
+  struct wl_list all_popups;
 };
 
 struct _MetaWaylandPopup
@@ -93,14 +93,15 @@ meta_wayland_popup_surface_dismiss (MetaWaylandPopupSurface *popup_surface)
 static MetaWaylandSurface *
 meta_wayland_popup_surface_get_surface (MetaWaylandPopupSurface *popup_surface)
 {
-  return META_WAYLAND_POPUP_SURFACE_GET_IFACE (popup_surface)->get_surface (popup_surface);
+  return META_WAYLAND_POPUP_SURFACE_GET_IFACE (popup_surface)->get_surface (
+    popup_surface);
 }
 
 static void
 popup_grab_focus (MetaWaylandPointerGrab *grab,
-                 MetaWaylandSurface     *surface)
+                  MetaWaylandSurface     *surface)
 {
-  MetaWaylandPopupGrab *popup_grab = (MetaWaylandPopupGrab*)grab;
+  MetaWaylandPopupGrab *popup_grab = (MetaWaylandPopupGrab *) grab;
   MetaWaylandSeat *seat = meta_wayland_pointer_get_seat (grab->pointer);
 
   /*
@@ -113,7 +114,7 @@ popup_grab_focus (MetaWaylandPointerGrab *grab,
     return;
 
   /* Popup grabs are in owner-events mode (ie, events for the same client
-     are reported as normal) */
+   *  are reported as normal) */
   if (surface &&
       wl_resource_get_client (surface->resource) == popup_grab->grab_client)
     meta_wayland_pointer_set_focus (grab->pointer, surface);
@@ -123,21 +124,21 @@ popup_grab_focus (MetaWaylandPointerGrab *grab,
 
 static void
 popup_grab_motion (MetaWaylandPointerGrab *grab,
-                  const ClutterEvent     *event)
+                   const ClutterEvent     *event)
 {
   meta_wayland_pointer_send_motion (grab->pointer, event);
 }
 
 static void
 popup_grab_button (MetaWaylandPointerGrab *grab,
-                  const ClutterEvent     *event)
+                   const ClutterEvent     *event)
 {
   MetaWaylandPointer *pointer = grab->pointer;
 
   if (pointer->focus_surface)
     meta_wayland_pointer_send_button (grab->pointer, event);
   else if (clutter_event_type (event) == CLUTTER_BUTTON_RELEASE &&
-          pointer->button_count == 0)
+           pointer->button_count == 0)
     meta_wayland_pointer_end_popup_grab (grab->pointer);
 }
 
@@ -147,7 +148,8 @@ popup_grab_cancel (MetaWaylandPointerGrab *grab)
   meta_wayland_pointer_end_popup_grab (grab->pointer);
 }
 
-static MetaWaylandPointerGrabInterface popup_grab_interface = {
+static MetaWaylandPointerGrabInterface popup_grab_interface =
+{
   popup_grab_focus,
   popup_grab_motion,
   popup_grab_button,
@@ -188,7 +190,7 @@ meta_wayland_popup_grab_begin (MetaWaylandPopupGrab *grab,
   MetaWaylandPointer *pointer = grab->generic.pointer;
   MetaWindow *window = surface->window;
 
-  meta_wayland_pointer_start_grab (pointer, (MetaWaylandPointerGrab*)grab);
+  meta_wayland_pointer_start_grab (pointer, (MetaWaylandPointerGrab *) grab);
   meta_display_begin_grab_op (window->display,
                               window,
                               META_GRAB_OP_WAYLAND_POPUP,
@@ -210,10 +212,10 @@ meta_wayland_popup_grab_end (MetaWaylandPopupGrab *grab)
   g_assert (grab->generic.interface == &popup_grab_interface);
 
   wl_list_for_each_safe (popup, tmp, &grab->all_popups, link)
-    {
-      meta_wayland_popup_surface_done (popup->popup_surface);
-      meta_wayland_popup_destroy (popup);
-    }
+  {
+    meta_wayland_popup_surface_done (popup->popup_surface);
+    meta_wayland_popup_destroy (popup);
+  }
 
   {
     MetaDisplay *display = meta_get_display ();
diff --git a/src/wayland/meta-wayland-region.c b/src/wayland/meta-wayland-region.c
index 761b97c13..9c6d09eb1 100644
--- a/src/wayland/meta-wayland-region.c
+++ b/src/wayland/meta-wayland-region.c
@@ -33,19 +33,19 @@ struct _MetaWaylandRegion
 };
 
 static void
-wl_region_destroy (struct wl_client *client,
+wl_region_destroy (struct wl_client   *client,
                    struct wl_resource *resource)
 {
   wl_resource_destroy (resource);
 }
 
 static void
-wl_region_add (struct wl_client *client,
+wl_region_add (struct wl_client   *client,
                struct wl_resource *resource,
-               gint32 x,
-               gint32 y,
-               gint32 width,
-               gint32 height)
+               gint32              x,
+               gint32              y,
+               gint32              width,
+               gint32              height)
 {
   MetaWaylandRegion *region = wl_resource_get_user_data (resource);
   cairo_rectangle_int_t rectangle = { x, y, width, height };
@@ -54,12 +54,12 @@ wl_region_add (struct wl_client *client,
 }
 
 static void
-wl_region_subtract (struct wl_client *client,
+wl_region_subtract (struct wl_client   *client,
                     struct wl_resource *resource,
-                    gint32 x,
-                    gint32 y,
-                    gint32 width,
-                    gint32 height)
+                    gint32              x,
+                    gint32              y,
+                    gint32              width,
+                    gint32              height)
 {
   MetaWaylandRegion *region = wl_resource_get_user_data (resource);
   cairo_rectangle_int_t rectangle = { x, y, width, height };
@@ -67,7 +67,8 @@ wl_region_subtract (struct wl_client *client,
   cairo_region_subtract_rectangle (region->region, &rectangle);
 }
 
-static const struct wl_region_interface meta_wayland_wl_region_interface = {
+static const struct wl_region_interface meta_wayland_wl_region_interface =
+{
   wl_region_destroy,
   wl_region_add,
   wl_region_subtract
@@ -90,8 +91,11 @@ meta_wayland_region_create (MetaWaylandCompositor *compositor,
 {
   MetaWaylandRegion *region = g_slice_new0 (MetaWaylandRegion);
 
-  region->resource = wl_resource_create (client, &wl_region_interface, wl_resource_get_version 
(compositor_resource), id);
-  wl_resource_set_implementation (region->resource, &meta_wayland_wl_region_interface, region, 
wl_region_destructor);
+  region->resource = wl_resource_create (client, &wl_region_interface, wl_resource_get_version (
+                                           compositor_resource), id);
+  wl_resource_set_implementation (region->resource,
+                                  &meta_wayland_wl_region_interface, region,
+                                  wl_region_destructor);
 
   region->region = cairo_region_create ();
 
diff --git a/src/wayland/meta-wayland-seat.c b/src/wayland/meta-wayland-seat.c
index 0de075275..fa07d4a5a 100644
--- a/src/wayland/meta-wayland-seat.c
+++ b/src/wayland/meta-wayland-seat.c
@@ -28,8 +28,12 @@
 #include "wayland/meta-wayland-tablet-seat.h"
 #include "wayland/meta-wayland-versions.h"
 
-#define CAPABILITY_ENABLED(prev, cur, capability) ((cur & (capability)) && !(prev & (capability)))
-#define CAPABILITY_DISABLED(prev, cur, capability) ((prev & (capability)) && !(cur & (capability)))
+#define CAPABILITY_ENABLED(prev, cur, \
+                           capability) ((cur & (capability)) && \
+                                        !(prev & (capability)))
+#define CAPABILITY_DISABLED(prev, cur, \
+                            capability) ((prev & (capability)) && \
+                                         !(cur & (capability)))
 
 static void
 unbind_resource (struct wl_resource *resource)
@@ -38,9 +42,9 @@ unbind_resource (struct wl_resource *resource)
 }
 
 static void
-seat_get_pointer (struct wl_client *client,
+seat_get_pointer (struct wl_client   *client,
                   struct wl_resource *resource,
-                  uint32_t id)
+                  uint32_t            id)
 {
   MetaWaylandSeat *seat = wl_resource_get_user_data (resource);
   MetaWaylandPointer *pointer = seat->pointer;
@@ -50,9 +54,9 @@ seat_get_pointer (struct wl_client *client,
 }
 
 static void
-seat_get_keyboard (struct wl_client *client,
+seat_get_keyboard (struct wl_client   *client,
                    struct wl_resource *resource,
-                   uint32_t id)
+                   uint32_t            id)
 {
   MetaWaylandSeat *seat = wl_resource_get_user_data (resource);
   MetaWaylandKeyboard *keyboard = seat->keyboard;
@@ -62,9 +66,9 @@ seat_get_keyboard (struct wl_client *client,
 }
 
 static void
-seat_get_touch (struct wl_client *client,
+seat_get_touch (struct wl_client   *client,
                 struct wl_resource *resource,
-                uint32_t id)
+                uint32_t            id)
 {
   MetaWaylandSeat *seat = wl_resource_get_user_data (resource);
   MetaWaylandTouch *touch = seat->touch;
@@ -73,7 +77,8 @@ seat_get_touch (struct wl_client *client,
     meta_wayland_touch_create_new_resource (touch, client, resource, id);
 }
 
-static const struct wl_seat_interface seat_interface = {
+static const struct wl_seat_interface seat_interface =
+{
   seat_get_pointer,
   seat_get_keyboard,
   seat_get_touch
@@ -81,15 +86,16 @@ static const struct wl_seat_interface seat_interface = {
 
 static void
 bind_seat (struct wl_client *client,
-           void *data,
-           guint32 version,
-           guint32 id)
+           void             *data,
+           guint32           version,
+           guint32           id)
 {
   MetaWaylandSeat *seat = data;
   struct wl_resource *resource;
 
   resource = wl_resource_create (client, &wl_seat_interface, version, id);
-  wl_resource_set_implementation (resource, &seat_interface, seat, unbind_resource);
+  wl_resource_set_implementation (resource, &seat_interface, seat,
+                                  unbind_resource);
   wl_list_insert (&seat->base_resource_list, wl_resource_get_link (resource));
 
   wl_seat_send_capabilities (resource, seat->capabilities);
@@ -114,7 +120,8 @@ lookup_device_capabilities (ClutterDeviceManager *device_manager)
        * keyboard/pointer device types, which is not truly representative of
        * the slave devices connected to them.
        */
-      if (clutter_input_device_get_device_mode (l->data) == CLUTTER_INPUT_MODE_MASTER)
+      if (clutter_input_device_get_device_mode (l->data) ==
+          CLUTTER_INPUT_MODE_MASTER)
         continue;
 
       device_type = clutter_input_device_get_device_type (l->data);
@@ -182,9 +189,9 @@ meta_wayland_seat_set_capabilities (MetaWaylandSeat *seat,
 
   /* Broadcast capability changes */
   wl_resource_for_each (resource, &seat->base_resource_list)
-    {
-      wl_seat_send_capabilities (resource, flags);
-    }
+  {
+    wl_seat_send_capabilities (resource, flags);
+  }
 }
 
 static void
@@ -237,7 +244,8 @@ meta_wayland_seat_new (MetaWaylandCompositor *compositor,
   g_signal_connect (device_manager, "device-removed",
                     G_CALLBACK (meta_wayland_seat_devices_updated), seat);
 
-  wl_global_create (display, &wl_seat_interface, META_WL_SEAT_VERSION, seat, bind_seat);
+  wl_global_create (display, &wl_seat_interface, META_WL_SEAT_VERSION, seat,
+                    bind_seat);
 
   meta_wayland_tablet_manager_ensure_seat (compositor->tablet_manager, seat);
 
@@ -278,18 +286,19 @@ event_is_synthesized_crossing (const ClutterEvent *event)
     return FALSE;
 
   device = clutter_event_get_source_device (event);
-  return clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER;
+  return clutter_input_device_get_device_mode (device) ==
+         CLUTTER_INPUT_MODE_MASTER;
 }
 
 static gboolean
 event_from_supported_hardware_device (MetaWaylandSeat    *seat,
                                       const ClutterEvent *event)
 {
-  ClutterInputDevice     *input_device;
-  ClutterInputMode        input_mode;
-  ClutterInputDeviceType  device_type;
-  gboolean                hardware_device = FALSE;
-  gboolean                supported_device = FALSE;
+  ClutterInputDevice *input_device;
+  ClutterInputMode input_mode;
+  ClutterInputDeviceType device_type;
+  gboolean hardware_device = FALSE;
+  gboolean supported_device = FALSE;
 
   input_device = clutter_event_get_source_device (event);
 
@@ -347,7 +356,8 @@ meta_wayland_seat_update (MetaWaylandSeat    *seat,
     case CLUTTER_KEY_PRESS:
     case CLUTTER_KEY_RELEASE:
       if (meta_wayland_seat_has_keyboard (seat))
-        meta_wayland_keyboard_update (seat->keyboard, (const ClutterKeyEvent *) event);
+        meta_wayland_keyboard_update (seat->keyboard,
+                                      (const ClutterKeyEvent *) event);
       break;
 
     case CLUTTER_TOUCH_BEGIN:
@@ -363,7 +373,7 @@ meta_wayland_seat_update (MetaWaylandSeat    *seat,
 }
 
 gboolean
-meta_wayland_seat_handle_event (MetaWaylandSeat *seat,
+meta_wayland_seat_handle_event (MetaWaylandSeat    *seat,
                                 const ClutterEvent *event)
 {
   if (!(clutter_event_get_flags (event) & CLUTTER_EVENT_FLAG_INPUT_METHOD) &&
@@ -431,7 +441,8 @@ meta_wayland_seat_set_input_focus (MetaWaylandSeat    *seat,
       meta_wayland_data_device_set_keyboard_focus (&seat->data_device);
     }
 
-  tablet_seat = meta_wayland_tablet_manager_ensure_seat (compositor->tablet_manager, seat);
+  tablet_seat = meta_wayland_tablet_manager_ensure_seat (
+    compositor->tablet_manager, seat);
   meta_wayland_tablet_seat_set_pad_focus (tablet_seat, surface);
 
   meta_wayland_text_input_set_focus (seat->text_input, surface);
@@ -451,7 +462,8 @@ meta_wayland_seat_get_grab_info (MetaWaylandSeat    *seat,
   GList *tools, *l;
 
   compositor = meta_wayland_compositor_get_default ();
-  tablet_seat = meta_wayland_tablet_manager_ensure_seat (compositor->tablet_manager, seat);
+  tablet_seat = meta_wayland_tablet_manager_ensure_seat (
+    compositor->tablet_manager, seat);
   tools = g_hash_table_get_values (tablet_seat->tools);
 
   if (meta_wayland_seat_has_touch (seat))
@@ -470,7 +482,8 @@ meta_wayland_seat_get_grab_info (MetaWaylandSeat    *seat,
   if (meta_wayland_seat_has_pointer (seat))
     {
       if ((!require_pressed || seat->pointer->button_count > 0) &&
-          meta_wayland_pointer_can_grab_surface (seat->pointer, surface, serial))
+          meta_wayland_pointer_can_grab_surface (seat->pointer, surface,
+                                                 serial))
         {
           if (x)
             *x = seat->pointer->grab_x;
diff --git a/src/wayland/meta-wayland-shell-surface.c b/src/wayland/meta-wayland-shell-surface.c
index 50dbb9bcd..464b4197d 100644
--- a/src/wayland/meta-wayland-shell-surface.c
+++ b/src/wayland/meta-wayland-shell-surface.c
@@ -35,8 +35,9 @@ G_DEFINE_ABSTRACT_TYPE (MetaWaylandShellSurface,
                         META_TYPE_WAYLAND_ACTOR_SURFACE)
 
 void
-meta_wayland_shell_surface_calculate_geometry (MetaWaylandShellSurface *shell_surface,
-                                               MetaRectangle           *out_geometry)
+meta_wayland_shell_surface_calculate_geometry (
+  MetaWaylandShellSurface *shell_surface,
+  MetaRectangle           *out_geometry)
 {
   MetaWaylandSurfaceRole *surface_role =
     META_WAYLAND_SURFACE_ROLE (shell_surface);
@@ -65,9 +66,10 @@ meta_wayland_shell_surface_calculate_geometry (MetaWaylandShellSurface *shell_su
 }
 
 void
-meta_wayland_shell_surface_determine_geometry (MetaWaylandShellSurface *shell_surface,
-                                               MetaRectangle           *set_geometry,
-                                               MetaRectangle           *out_geometry)
+meta_wayland_shell_surface_determine_geometry (
+  MetaWaylandShellSurface *shell_surface,
+  MetaRectangle           *set_geometry,
+  MetaRectangle           *out_geometry)
 {
   MetaRectangle bounding_geometry = { 0 };
   MetaRectangle intersected_geometry = { 0 };
@@ -143,8 +145,9 @@ meta_wayland_shell_surface_managed (MetaWaylandShellSurface *shell_surface,
 }
 
 static void
-meta_wayland_shell_surface_surface_commit (MetaWaylandSurfaceRole  *surface_role,
-                                           MetaWaylandPendingState *pending)
+meta_wayland_shell_surface_surface_commit (
+  MetaWaylandSurfaceRole  *surface_role,
+  MetaWaylandPendingState *pending)
 {
   MetaWaylandActorSurface *actor_surface =
     META_WAYLAND_ACTOR_SURFACE (surface_role);
diff --git a/src/wayland/meta-wayland-subsurface.c b/src/wayland/meta-wayland-subsurface.c
index e0fa0a48b..faa388a1b 100644
--- a/src/wayland/meta-wayland-subsurface.c
+++ b/src/wayland/meta-wayland-subsurface.c
@@ -54,7 +54,8 @@ G_DEFINE_TYPE (MetaWaylandSubsurface,
 static void
 sync_actor_subsurface_state (MetaWaylandSurface *surface)
 {
-  ClutterActor *actor = CLUTTER_ACTOR (meta_wayland_surface_get_actor (surface));
+  ClutterActor *actor =
+    CLUTTER_ACTOR (meta_wayland_surface_get_actor (surface));
   MetaWindow *toplevel_window;
   int geometry_scale;
   int x, y;
@@ -99,8 +100,10 @@ meta_wayland_subsurface_parent_state_applied (MetaWaylandSubsurface *subsurface)
       GSList *it;
       MetaWaylandSurface *parent = surface->sub.parent;
       ClutterActor *parent_actor =
-        clutter_actor_get_parent (CLUTTER_ACTOR (meta_wayland_surface_get_actor (parent)));
-      ClutterActor *surface_actor = CLUTTER_ACTOR (meta_wayland_surface_get_actor (surface));
+        clutter_actor_get_parent (CLUTTER_ACTOR (meta_wayland_surface_get_actor (
+                                                   parent)));
+      ClutterActor *surface_actor = CLUTTER_ACTOR (meta_wayland_surface_get_actor (
+                                                     surface));
 
       for (it = surface->sub.pending_placement_ops; it; it = it->next)
         {
@@ -113,7 +116,8 @@ meta_wayland_subsurface_parent_state_applied (MetaWaylandSubsurface *subsurface)
               continue;
             }
 
-          sibling_actor = CLUTTER_ACTOR (meta_wayland_surface_get_actor (op->sibling));
+          sibling_actor =
+            CLUTTER_ACTOR (meta_wayland_surface_get_actor (op->sibling));
 
           switch (op->placement)
             {
@@ -227,7 +231,8 @@ meta_wayland_subsurface_class_init (MetaWaylandSubsurfaceClass *klass)
 static void
 unparent_actor (MetaWaylandSurface *surface)
 {
-  ClutterActor *actor = CLUTTER_ACTOR (meta_wayland_surface_get_actor (surface));
+  ClutterActor *actor =
+    CLUTTER_ACTOR (meta_wayland_surface_get_actor (surface));
   ClutterActor *parent_actor;
 
   parent_actor = clutter_actor_get_parent (actor);
@@ -296,9 +301,9 @@ subsurface_handle_pending_sibling_destroyed (struct wl_listener *listener,
 }
 
 static void
-queue_subsurface_placement (MetaWaylandSurface             *surface,
-                            MetaWaylandSurface             *sibling,
-                            MetaWaylandSubsurfacePlacement  placement)
+queue_subsurface_placement (MetaWaylandSurface            *surface,
+                            MetaWaylandSurface            *sibling,
+                            MetaWaylandSubsurfacePlacement placement)
 {
   MetaWaylandSubsurfacePlacementOp *op =
     g_slice_new (MetaWaylandSubsurfacePlacementOp);
@@ -383,14 +388,16 @@ wl_subsurface_set_desync (struct wl_client   *client,
     meta_wayland_surface_apply_pending_state (surface, surface->sub.pending);
 }
 
-static const struct wl_subsurface_interface meta_wayland_wl_subsurface_interface = {
+static const struct wl_subsurface_interface meta_wayland_wl_subsurface_interface
+  =
+  {
   wl_subsurface_destroy,
   wl_subsurface_set_position,
   wl_subsurface_place_above,
   wl_subsurface_place_below,
   wl_subsurface_set_sync,
   wl_subsurface_set_desync,
-};
+  };
 
 static void
 wl_subcompositor_destroy (struct wl_client   *client,
@@ -466,14 +473,19 @@ wl_subcompositor_get_subsurface (struct wl_client   *client,
 
   if (meta_wayland_surface_get_actor (parent))
     {
-      clutter_actor_add_child (CLUTTER_ACTOR (meta_wayland_surface_get_actor (parent)),
-                               CLUTTER_ACTOR (meta_wayland_surface_get_actor (surface)));
+      clutter_actor_add_child (CLUTTER_ACTOR (meta_wayland_surface_get_actor (
+                                                parent)),
+                               CLUTTER_ACTOR (meta_wayland_surface_get_actor (
+                                                surface)));
     }
 
-  clutter_actor_set_reactive (CLUTTER_ACTOR (meta_wayland_surface_get_actor (surface)), TRUE);
+  clutter_actor_set_reactive (CLUTTER_ACTOR (meta_wayland_surface_get_actor (
+                                               surface)), TRUE);
 }
 
-static const struct wl_subcompositor_interface meta_wayland_subcompositor_interface = {
+static const struct wl_subcompositor_interface
+  meta_wayland_subcompositor_interface =
+{
   wl_subcompositor_destroy,
   wl_subcompositor_get_subsurface,
 };
@@ -488,7 +500,8 @@ bind_subcompositor (struct wl_client *client,
 
   resource = wl_resource_create (client, &wl_subcompositor_interface,
                                  version, id);
-  wl_resource_set_implementation (resource, &meta_wayland_subcompositor_interface,
+  wl_resource_set_implementation (resource,
+                                  &meta_wayland_subcompositor_interface,
                                   data, NULL);
 }
 
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index b918e296e..4bc7aec15 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -56,7 +56,8 @@
 #include "wayland/meta-xwayland-private.h"
 #include "wayland/meta-xwayland-private.h"
 
-enum {
+enum
+{
   PENDING_STATE_SIGNAL_APPLIED,
 
   PENDING_STATE_SIGNAL_LAST_SIGNAL
@@ -95,7 +96,8 @@ G_DEFINE_TYPE (MetaWaylandSurfaceRoleDND,
                meta_wayland_surface_role_dnd,
                META_TYPE_WAYLAND_SURFACE_ROLE);
 
-enum {
+enum
+{
   SURFACE_DESTROY,
   SURFACE_UNMAPPED,
   SURFACE_CONFIGURE,
@@ -119,8 +121,9 @@ meta_wayland_surface_role_commit (MetaWaylandSurfaceRole  *surface_role,
                                   MetaWaylandPendingState *pending);
 
 static gboolean
-meta_wayland_surface_role_is_on_logical_monitor (MetaWaylandSurfaceRole *surface_role,
-                                                 MetaLogicalMonitor     *logical_monitor);
+meta_wayland_surface_role_is_on_logical_monitor (
+  MetaWaylandSurfaceRole *surface_role,
+  MetaLogicalMonitor     *logical_monitor);
 
 static MetaWaylandSurface *
 meta_wayland_surface_role_get_toplevel (MetaWaylandSurfaceRole *surface_role);
@@ -293,7 +296,8 @@ surface_process_damage (MetaWaylandSurface *surface,
       cairo_rectangle_int_t rect;
       cairo_region_get_rectangle (scaled_region, i, &rect);
 
-      meta_surface_actor_process_damage (meta_wayland_surface_get_actor (surface),
+      meta_surface_actor_process_damage (meta_wayland_surface_get_actor (
+                                           surface),
                                          rect.x, rect.y,
                                          rect.width, rect.height);
     }
@@ -302,8 +306,9 @@ surface_process_damage (MetaWaylandSurface *surface,
 }
 
 void
-meta_wayland_surface_queue_pending_state_frame_callbacks (MetaWaylandSurface      *surface,
-                                                          MetaWaylandPendingState *pending)
+meta_wayland_surface_queue_pending_state_frame_callbacks (
+  MetaWaylandSurface      *surface,
+  MetaWaylandPendingState *pending)
 {
   wl_list_insert_list (&surface->compositor->frame_callbacks,
                        &pending->frame_callback_list);
@@ -413,7 +418,7 @@ pending_state_destroy (MetaWaylandPendingState *state)
       state->buffer_destroy_handler_id = 0;
     }
   wl_list_for_each_safe (cb, next, &state->frame_callback_list, link)
-    wl_resource_destroy (cb->resource);
+  wl_resource_destroy (cb->resource);
 }
 
 static void
@@ -584,8 +589,9 @@ parent_surface_state_applied (gpointer data,
 }
 
 void
-meta_wayland_surface_cache_pending_frame_callbacks (MetaWaylandSurface      *surface,
-                                                    MetaWaylandPendingState *pending)
+meta_wayland_surface_cache_pending_frame_callbacks (
+  MetaWaylandSurface      *surface,
+  MetaWaylandPendingState *pending)
 {
   wl_list_insert_list (&surface->pending_frame_callback_list,
                        &pending->frame_callback_list);
@@ -637,7 +643,8 @@ meta_wayland_surface_apply_pending_state (MetaWaylandSurface      *surface,
           if (!meta_wayland_buffer_attach (pending->buffer, &error))
             {
               g_warning ("Could not import pending buffer: %s", error->message);
-              wl_resource_post_error (surface->resource, WL_DISPLAY_ERROR_NO_MEMORY,
+              wl_resource_post_error (surface->resource,
+                                      WL_DISPLAY_ERROR_NO_MEMORY,
                                       "Failed to create a texture for surface %i: %s",
                                       wl_resource_get_id (surface->resource),
                                       error->message);
@@ -652,10 +659,12 @@ meta_wayland_surface_apply_pending_state (MetaWaylandSurface      *surface,
               CoglSnippet *snippet;
               gboolean is_y_inverted;
 
-              stex = meta_surface_actor_get_texture (meta_wayland_surface_get_actor (surface));
+              stex = meta_surface_actor_get_texture (meta_wayland_surface_get_actor (
+                                                       surface));
               texture = meta_wayland_buffer_get_texture (pending->buffer);
               snippet = meta_wayland_buffer_create_snippet (pending->buffer);
-              is_y_inverted = meta_wayland_buffer_is_y_inverted (pending->buffer);
+              is_y_inverted =
+                meta_wayland_buffer_is_y_inverted (pending->buffer);
 
               meta_shaped_texture_set_texture (stex, texture);
               meta_shaped_texture_set_snippet (stex, snippet);
@@ -691,7 +700,8 @@ meta_wayland_surface_apply_pending_state (MetaWaylandSurface      *surface,
       if (surface->opaque_region)
         cairo_region_destroy (surface->opaque_region);
       if (pending->opaque_region)
-        surface->opaque_region = cairo_region_reference (pending->opaque_region);
+        surface->opaque_region =
+          cairo_region_reference (pending->opaque_region);
       else
         surface->opaque_region = NULL;
     }
@@ -721,7 +731,8 @@ meta_wayland_surface_apply_pending_state (MetaWaylandSurface      *surface,
            * role the surface is given. That means we need to also keep a use
            * count for wl_buffer's that are used by unassigned wl_surface's.
            */
-          g_set_object (&surface->unassigned.buffer, surface->buffer_ref.buffer);
+          g_set_object (&surface->unassigned.buffer,
+                        surface->buffer_ref.buffer);
           if (surface->unassigned.buffer)
             meta_wayland_surface_ref_buffer_use_count (surface);
         }
@@ -766,7 +777,7 @@ meta_wayland_surface_commit (MetaWaylandSurface *surface)
 }
 
 static void
-wl_surface_destroy (struct wl_client *client,
+wl_surface_destroy (struct wl_client   *client,
                     struct wl_resource *resource)
 {
   wl_resource_destroy (resource);
@@ -846,9 +857,9 @@ destroy_frame_callback (struct wl_resource *callback_resource)
 }
 
 static void
-wl_surface_frame (struct wl_client *client,
+wl_surface_frame (struct wl_client   *client,
                   struct wl_resource *surface_resource,
-                  guint32 callback_id)
+                  guint32             callback_id)
 {
   MetaWaylandFrameCallback *callback;
   MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource);
@@ -859,14 +870,17 @@ wl_surface_frame (struct wl_client *client,
 
   callback = g_slice_new0 (MetaWaylandFrameCallback);
   callback->surface = surface;
-  callback->resource = wl_resource_create (client, &wl_callback_interface, META_WL_CALLBACK_VERSION, 
callback_id);
-  wl_resource_set_implementation (callback->resource, NULL, callback, destroy_frame_callback);
+  callback->resource = wl_resource_create (client, &wl_callback_interface,
+                                           META_WL_CALLBACK_VERSION,
+                                           callback_id);
+  wl_resource_set_implementation (callback->resource, NULL, callback,
+                                  destroy_frame_callback);
 
   wl_list_insert (surface->pending->frame_callback_list.prev, &callback->link);
 }
 
 static void
-wl_surface_set_opaque_region (struct wl_client *client,
+wl_surface_set_opaque_region (struct wl_client   *client,
                               struct wl_resource *surface_resource,
                               struct wl_resource *region_resource)
 {
@@ -880,14 +894,15 @@ wl_surface_set_opaque_region (struct wl_client *client,
   if (region_resource)
     {
       MetaWaylandRegion *region = wl_resource_get_user_data (region_resource);
-      cairo_region_t *cr_region = meta_wayland_region_peek_cairo_region (region);
+      cairo_region_t *cr_region =
+        meta_wayland_region_peek_cairo_region (region);
       surface->pending->opaque_region = cairo_region_copy (cr_region);
     }
   surface->pending->opaque_region_set = TRUE;
 }
 
 static void
-wl_surface_set_input_region (struct wl_client *client,
+wl_surface_set_input_region (struct wl_client   *client,
                              struct wl_resource *surface_resource,
                              struct wl_resource *region_resource)
 {
@@ -901,14 +916,15 @@ wl_surface_set_input_region (struct wl_client *client,
   if (region_resource)
     {
       MetaWaylandRegion *region = wl_resource_get_user_data (region_resource);
-      cairo_region_t *cr_region = meta_wayland_region_peek_cairo_region (region);
+      cairo_region_t *cr_region =
+        meta_wayland_region_peek_cairo_region (region);
       surface->pending->input_region = cairo_region_copy (cr_region);
     }
   surface->pending->input_region_set = TRUE;
 }
 
 static void
-wl_surface_commit (struct wl_client *client,
+wl_surface_commit (struct wl_client   *client,
                    struct wl_resource *resource)
 {
   MetaWaylandSurface *surface = wl_resource_get_user_data (resource);
@@ -921,17 +937,17 @@ wl_surface_commit (struct wl_client *client,
 }
 
 static void
-wl_surface_set_buffer_transform (struct wl_client *client,
+wl_surface_set_buffer_transform (struct wl_client   *client,
                                  struct wl_resource *resource,
-                                 int32_t transform)
+                                 int32_t             transform)
 {
   g_warning ("TODO: support set_buffer_transform request");
 }
 
 static void
-wl_surface_set_buffer_scale (struct wl_client *client,
+wl_surface_set_buffer_scale (struct wl_client   *client,
                              struct wl_resource *resource,
-                             int scale)
+                             int                 scale)
 {
   MetaWaylandSurface *surface = wl_resource_get_user_data (resource);
   if (scale > 0)
@@ -964,7 +980,8 @@ wl_surface_damage_buffer (struct wl_client   *client,
   cairo_region_union_rectangle (surface->pending->buffer_damage, &rectangle);
 }
 
-static const struct wl_surface_interface meta_wayland_wl_surface_interface = {
+static const struct wl_surface_interface meta_wayland_wl_surface_interface =
+{
   wl_surface_destroy,
   wl_surface_attach,
   wl_surface_damage,
@@ -989,7 +1006,7 @@ sync_drag_dest_funcs (MetaWaylandSurface *surface)
 
 static void
 surface_entered_output (MetaWaylandSurface *surface,
-                        MetaWaylandOutput *wayland_output)
+                        MetaWaylandOutput  *wayland_output)
 {
   GList *iter;
   struct wl_resource *resource;
@@ -1008,7 +1025,7 @@ surface_entered_output (MetaWaylandSurface *surface,
 
 static void
 surface_left_output (MetaWaylandSurface *surface,
-                     MetaWaylandOutput *wayland_output)
+                     MetaWaylandOutput  *wayland_output)
 {
   GList *iter;
   struct wl_resource *resource;
@@ -1027,11 +1044,11 @@ surface_left_output (MetaWaylandSurface *surface,
 
 static void
 set_surface_is_on_output (MetaWaylandSurface *surface,
-                          MetaWaylandOutput *wayland_output,
-                          gboolean is_on_output);
+                          MetaWaylandOutput  *wayland_output,
+                          gboolean            is_on_output);
 
 static void
-surface_handle_output_destroy (MetaWaylandOutput *wayland_output,
+surface_handle_output_destroy (MetaWaylandOutput  *wayland_output,
                                MetaWaylandSurface *surface)
 {
   set_surface_is_on_output (surface, wayland_output, FALSE);
@@ -1039,13 +1056,14 @@ surface_handle_output_destroy (MetaWaylandOutput *wayland_output,
 
 static void
 set_surface_is_on_output (MetaWaylandSurface *surface,
-                          MetaWaylandOutput *wayland_output,
-                          gboolean is_on_output)
+                          MetaWaylandOutput  *wayland_output,
+                          gboolean            is_on_output)
 {
   gpointer orig_id;
-  gboolean was_on_output = g_hash_table_lookup_extended (surface->outputs_to_destroy_notify_id,
-                                                         wayland_output,
-                                                         NULL, &orig_id);
+  gboolean was_on_output = g_hash_table_lookup_extended (
+    surface->outputs_to_destroy_notify_id,
+    wayland_output,
+    NULL, &orig_id);
 
   if (!was_on_output && is_on_output)
     {
@@ -1054,14 +1072,17 @@ set_surface_is_on_output (MetaWaylandSurface *surface,
       id = g_signal_connect (wayland_output, "output-destroyed",
                              G_CALLBACK (surface_handle_output_destroy),
                              surface);
-      g_hash_table_insert (surface->outputs_to_destroy_notify_id, wayland_output,
-                           GSIZE_TO_POINTER ((gsize)id));
+      g_hash_table_insert (surface->outputs_to_destroy_notify_id,
+                           wayland_output,
+                           GSIZE_TO_POINTER ((gsize) id));
       surface_entered_output (surface, wayland_output);
     }
   else if (was_on_output && !is_on_output)
     {
-      g_hash_table_remove (surface->outputs_to_destroy_notify_id, wayland_output);
-      g_signal_handler_disconnect (wayland_output, (gulong) GPOINTER_TO_SIZE (orig_id));
+      g_hash_table_remove (surface->outputs_to_destroy_notify_id,
+                           wayland_output);
+      g_signal_handler_disconnect (wayland_output,
+                                   (gulong) GPOINTER_TO_SIZE (orig_id));
       surface_left_output (surface, wayland_output);
     }
 }
@@ -1090,7 +1111,8 @@ update_surface_output_state (gpointer key, gpointer value, gpointer user_data)
 }
 
 static void
-surface_output_disconnect_signal (gpointer key, gpointer value, gpointer user_data)
+surface_output_disconnect_signal (gpointer key, gpointer value,
+                                  gpointer user_data)
 {
   g_signal_handler_disconnect (key, (gulong) GPOINTER_TO_SIZE (value));
 }
@@ -1131,14 +1153,16 @@ meta_wayland_surface_set_window (MetaWaylandSurface *surface,
       g_signal_handlers_disconnect_by_func (surface->window,
                                             window_position_changed,
                                             surface);
-      g_signal_handlers_disconnect_by_func (meta_window_actor_from_window (surface->window),
+      g_signal_handlers_disconnect_by_func (meta_window_actor_from_window (
+                                              surface->window),
                                             window_actor_effects_completed,
                                             surface);
     }
 
   surface->window = window;
 
-  clutter_actor_set_reactive (CLUTTER_ACTOR (meta_wayland_surface_get_actor (surface)), !!window);
+  clutter_actor_set_reactive (CLUTTER_ACTOR (meta_wayland_surface_get_actor (
+                                               surface)), !!window);
   sync_drag_dest_funcs (surface);
 
   if (was_unmapped)
@@ -1193,11 +1217,12 @@ wl_surface_destructor (struct wl_resource *resource)
 
   meta_wayland_compositor_destroy_frame_callbacks (compositor, surface);
 
-  g_hash_table_foreach (surface->outputs_to_destroy_notify_id, surface_output_disconnect_signal, surface);
+  g_hash_table_foreach (surface->outputs_to_destroy_notify_id,
+                        surface_output_disconnect_signal, surface);
   g_hash_table_unref (surface->outputs_to_destroy_notify_id);
 
   wl_list_for_each_safe (cb, next, &surface->pending_frame_callback_list, link)
-    wl_resource_destroy (cb->resource);
+  wl_resource_destroy (cb->resource);
 
   if (surface->resource)
     wl_resource_set_user_data (surface->resource, NULL);
@@ -1237,8 +1262,11 @@ meta_wayland_surface_create (MetaWaylandCompositor *compositor,
   surface->compositor = compositor;
   surface->scale = 1;
 
-  surface->resource = wl_resource_create (client, &wl_surface_interface, wl_resource_get_version 
(compositor_resource), id);
-  wl_resource_set_implementation (surface->resource, &meta_wayland_wl_surface_interface, surface, 
wl_surface_destructor);
+  surface->resource = wl_resource_create (client, &wl_surface_interface, wl_resource_get_version (
+                                            compositor_resource), id);
+  wl_resource_set_implementation (surface->resource,
+                                  &meta_wayland_wl_surface_interface, surface,
+                                  wl_surface_destructor);
 
   wl_list_init (&surface->pending_frame_callback_list);
 
@@ -1265,8 +1293,8 @@ meta_wayland_surface_begin_grab_op (MetaWaylandSurface *surface,
     return FALSE;
 
   /* This is an input driven operation so we set frame_action to
-     constrain it in the same way as it would be if the window was
-     being moved/resized via a SSD event. */
+   *  constrain it in the same way as it would be if the window was
+   *  being moved/resized via a SSD event. */
   return meta_display_begin_grab_op (window->display,
                                      window,
                                      grab_op,
@@ -1274,7 +1302,8 @@ meta_wayland_surface_begin_grab_op (MetaWaylandSurface *surface,
                                      TRUE, /* frame_action */
                                      1, /* button. XXX? */
                                      0, /* modmask */
-                                     meta_display_get_current_time_roundtrip (window->display),
+                                     meta_display_get_current_time_roundtrip (
+                                       window->display),
                                      x, y);
 }
 
@@ -1407,8 +1436,8 @@ void
 meta_wayland_surface_get_relative_coordinates (MetaWaylandSurface *surface,
                                                float               abs_x,
                                                float               abs_y,
-                                               float               *sx,
-                                               float               *sy)
+                                               float              *sx,
+                                               float              *sy)
 {
   /* Using clutter API to transform coordinates is only accurate right
    * after a clutter layout pass but this function is used e.g. to
@@ -1430,7 +1459,8 @@ meta_wayland_surface_get_relative_coordinates (MetaWaylandSurface *surface,
   else
     {
       ClutterActor *actor =
-        CLUTTER_ACTOR (meta_surface_actor_get_texture (meta_wayland_surface_get_actor (surface)));
+        CLUTTER_ACTOR (meta_surface_actor_get_texture (
+                         meta_wayland_surface_get_actor (surface)));
 
       clutter_actor_transform_stage_point (actor, abs_x, abs_y, sx, sy);
       *sx /= surface->scale;
@@ -1442,12 +1472,14 @@ void
 meta_wayland_surface_get_absolute_coordinates (MetaWaylandSurface *surface,
                                                float               sx,
                                                float               sy,
-                                               float               *x,
-                                               float               *y)
+                                               float              *x,
+                                               float              *y)
 {
   ClutterActor *actor =
-    CLUTTER_ACTOR (meta_surface_actor_get_texture (meta_wayland_surface_get_actor (surface)));
-  ClutterVertex sv = {
+    CLUTTER_ACTOR (meta_surface_actor_get_texture (
+                     meta_wayland_surface_get_actor (surface)));
+  ClutterVertex sv =
+  {
     .x = sx * surface->scale,
     .y = sy * surface->scale,
   };
@@ -1465,7 +1497,8 @@ meta_wayland_surface_init (MetaWaylandSurface *surface)
   surface->pending = g_object_new (META_TYPE_WAYLAND_PENDING_STATE, NULL);
 
   g_signal_connect (surface, "geometry-changed",
-                    G_CALLBACK (meta_wayland_surface_update_outputs_recursively),
+                    G_CALLBACK (
+                      meta_wayland_surface_update_outputs_recursively),
                     NULL);
 }
 
@@ -1614,8 +1647,9 @@ meta_wayland_surface_role_commit (MetaWaylandSurfaceRole  *surface_role,
 }
 
 static gboolean
-meta_wayland_surface_role_is_on_logical_monitor (MetaWaylandSurfaceRole *surface_role,
-                                                 MetaLogicalMonitor     *logical_monitor)
+meta_wayland_surface_role_is_on_logical_monitor (
+  MetaWaylandSurfaceRole *surface_role,
+  MetaLogicalMonitor     *logical_monitor)
 {
   MetaWaylandSurfaceRoleClass *klass;
 
@@ -1732,7 +1766,8 @@ meta_wayland_surface_get_actor (MetaWaylandSurface *surface)
   if (!surface->role || !META_IS_WAYLAND_ACTOR_SURFACE (surface->role))
     return NULL;
 
-  return meta_wayland_actor_surface_get_actor (META_WAYLAND_ACTOR_SURFACE (surface->role));
+  return meta_wayland_actor_surface_get_actor (META_WAYLAND_ACTOR_SURFACE (
+                                                 surface->role));
 }
 
 void
diff --git a/src/wayland/meta-wayland-tablet-cursor-surface.c 
b/src/wayland/meta-wayland-tablet-cursor-surface.c
index 421b7c20a..d5523cc3c 100644
--- a/src/wayland/meta-wayland-tablet-cursor-surface.c
+++ b/src/wayland/meta-wayland-tablet-cursor-surface.c
@@ -38,6 +38,7 @@ meta_wayland_tablet_cursor_surface_init (MetaWaylandTabletCursorSurface *role)
 }
 
 static void
-meta_wayland_tablet_cursor_surface_class_init (MetaWaylandTabletCursorSurfaceClass *klass)
+meta_wayland_tablet_cursor_surface_class_init (
+  MetaWaylandTabletCursorSurfaceClass *klass)
 {
 }
diff --git a/src/wayland/meta-wayland-tablet-manager.c b/src/wayland/meta-wayland-tablet-manager.c
index 018d81940..085e73bc4 100644
--- a/src/wayland/meta-wayland-tablet-manager.c
+++ b/src/wayland/meta-wayland-tablet-manager.c
@@ -45,7 +45,8 @@ is_tablet_device (ClutterInputDevice *device)
 {
   ClutterInputDeviceType device_type;
 
-  if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER)
+  if (clutter_input_device_get_device_mode (device) ==
+      CLUTTER_INPUT_MODE_MASTER)
     return FALSE;
 
   device_type = clutter_input_device_get_device_type (device);
@@ -63,7 +64,8 @@ tablet_manager_get_tablet_seat (struct wl_client   *client,
                                 guint32             id,
                                 struct wl_resource *seat_resource)
 {
-  MetaWaylandTabletManager *tablet_manager = wl_resource_get_user_data (resource);
+  MetaWaylandTabletManager *tablet_manager =
+    wl_resource_get_user_data (resource);
   MetaWaylandSeat *seat = wl_resource_get_user_data (seat_resource);
   MetaWaylandTabletSeat *tablet_seat;
 
@@ -79,7 +81,8 @@ tablet_manager_destroy (struct wl_client   *client,
   wl_resource_destroy (resource);
 }
 
-static const struct zwp_tablet_manager_v2_interface tablet_manager_interface = {
+static const struct zwp_tablet_manager_v2_interface tablet_manager_interface =
+{
   tablet_manager_get_tablet_seat,
   tablet_manager_destroy
 };
@@ -153,7 +156,8 @@ meta_wayland_tablet_manager_lookup_seat (MetaWaylandTabletManager *manager,
 
   g_hash_table_iter_init (&iter, manager->seats);
 
-  while (g_hash_table_iter_next (&iter, (gpointer*) &seat, (gpointer*) &tablet_seat))
+  while (g_hash_table_iter_next (&iter, (gpointer *) &seat,
+                                 (gpointer *) &tablet_seat))
     {
       if (meta_wayland_tablet_seat_lookup_tablet (tablet_seat, device) ||
           meta_wayland_tablet_seat_lookup_pad (tablet_seat, device))
@@ -249,8 +253,9 @@ meta_wayland_tablet_manager_ensure_seat (MetaWaylandTabletManager *manager,
 }
 
 void
-meta_wayland_tablet_manager_update_cursor_position (MetaWaylandTabletManager *manager,
-                                                    const ClutterEvent       *event)
+meta_wayland_tablet_manager_update_cursor_position (
+  MetaWaylandTabletManager *manager,
+  const ClutterEvent       *event)
 {
   MetaWaylandTabletSeat *tablet_seat = NULL;
   MetaWaylandTabletTool *tool = NULL;
diff --git a/src/wayland/meta-wayland-tablet-pad-group.c b/src/wayland/meta-wayland-tablet-pad-group.c
index 583fa0999..78b993592 100644
--- a/src/wayland/meta-wayland-tablet-pad-group.c
+++ b/src/wayland/meta-wayland-tablet-pad-group.c
@@ -64,10 +64,10 @@ meta_wayland_tablet_pad_group_free (MetaWaylandTabletPadGroup *group)
   struct wl_resource *resource, *next;
 
   wl_resource_for_each_safe (resource, next, &group->resource_list)
-    {
-      wl_list_remove (wl_resource_get_link (resource));
-      wl_list_init (wl_resource_get_link (resource));
-    }
+  {
+    wl_list_remove (wl_resource_get_link (resource));
+    wl_list_init (wl_resource_get_link (resource));
+  }
 
   g_list_free (group->rings);
   g_list_free (group->strips);
@@ -82,15 +82,17 @@ tablet_pad_group_destroy (struct wl_client   *client,
   wl_resource_destroy (resource);
 }
 
-static const struct zwp_tablet_pad_group_v2_interface group_interface = {
+static const struct zwp_tablet_pad_group_v2_interface group_interface =
+{
   tablet_pad_group_destroy
 };
 
 struct wl_resource *
-meta_wayland_tablet_pad_group_create_new_resource (MetaWaylandTabletPadGroup *group,
-                                                   struct wl_client          *client,
-                                                   struct wl_resource        *pad_resource,
-                                                   uint32_t                   id)
+meta_wayland_tablet_pad_group_create_new_resource (
+  MetaWaylandTabletPadGroup *group,
+  struct wl_client          *client,
+  struct wl_resource        *pad_resource,
+  uint32_t                   id)
 {
   struct wl_resource *resource;
 
@@ -113,7 +115,8 @@ meta_wayland_tablet_pad_group_lookup_resource (MetaWaylandTabletPadGroup *group,
   resource = wl_resource_find_for_client (&group->resource_list, client);
 
   if (!resource)
-    resource = wl_resource_find_for_client (&group->focus_resource_list, client);
+    resource =
+      wl_resource_find_for_client (&group->focus_resource_list, client);
 
   return resource;
 }
@@ -131,17 +134,19 @@ meta_wayland_tablet_pad_group_has_button (MetaWaylandTabletPadGroup *group,
       struct libinput_tablet_pad_mode_group *mode_group;
       guint n_group;
 
-      libinput_device = clutter_evdev_input_device_get_libinput_device (group->pad->device);
+      libinput_device = clutter_evdev_input_device_get_libinput_device (
+        group->pad->device);
       n_group = g_list_index (group->pad->groups, group);
-      mode_group = libinput_device_tablet_pad_get_mode_group (libinput_device, n_group);
+      mode_group = libinput_device_tablet_pad_get_mode_group (libinput_device,
+                                                              n_group);
 
       return libinput_tablet_pad_mode_group_has_button (mode_group, button);
     }
   else
 #endif
-    {
-      return g_list_length (group->pad->groups) == 1;
-    }
+  {
+    return g_list_length (group->pad->groups) == 1;
+  }
 }
 
 static void
@@ -224,7 +229,9 @@ meta_wayland_tablet_pad_group_update (MetaWaylandTabletPadGroup *group,
     {
     case CLUTTER_PAD_BUTTON_PRESS:
     case CLUTTER_PAD_BUTTON_RELEASE:
-      if (meta_wayland_tablet_pad_group_is_mode_switch_button (group, event->pad_button.button))
+      if (meta_wayland_tablet_pad_group_is_mode_switch_button (group,
+                                                               event->pad_button
+                                                               .button))
         group->current_mode = event->pad_button.mode;
       break;
     default:
@@ -276,11 +283,11 @@ broadcast_group_mode (MetaWaylandTabletPadGroup *group,
   group->mode_switch_serial = wl_display_next_serial (display);
 
   wl_resource_for_each (resource, &group->focus_resource_list)
-    {
-      zwp_tablet_pad_group_v2_send_mode_switch (resource, time,
-                                                group->mode_switch_serial,
-                                                group->current_mode);
-    }
+  {
+    zwp_tablet_pad_group_v2_send_mode_switch (resource, time,
+                                              group->mode_switch_serial,
+                                              group->current_mode);
+  }
 }
 
 static void
@@ -289,9 +296,9 @@ broadcast_group_buttons (MetaWaylandTabletPadGroup *group)
   struct wl_resource *resource;
 
   wl_resource_for_each (resource, &group->focus_resource_list)
-    {
-      meta_wayland_tablet_pad_group_send_buttons (group, resource);
-    }
+  {
+    meta_wayland_tablet_pad_group_send_buttons (group, resource);
+  }
 }
 
 gboolean
@@ -302,7 +309,9 @@ meta_wayland_tablet_pad_group_handle_event (MetaWaylandTabletPadGroup *group,
     {
     case CLUTTER_PAD_BUTTON_PRESS:
     case CLUTTER_PAD_BUTTON_RELEASE:
-      if (meta_wayland_tablet_pad_group_is_mode_switch_button (group, event->pad_button.button))
+      if (meta_wayland_tablet_pad_group_is_mode_switch_button (group,
+                                                               event->pad_button
+                                                               .button))
         {
           if (event->type == CLUTTER_PAD_BUTTON_PRESS)
             broadcast_group_mode (group, clutter_event_get_time (event));
@@ -323,7 +332,8 @@ meta_wayland_tablet_pad_group_handle_event (MetaWaylandTabletPadGroup *group,
 }
 
 static void
-meta_wayland_tablet_pad_group_update_rings_focus (MetaWaylandTabletPadGroup *group)
+meta_wayland_tablet_pad_group_update_rings_focus (
+  MetaWaylandTabletPadGroup *group)
 {
   GList *l;
 
@@ -332,7 +342,8 @@ meta_wayland_tablet_pad_group_update_rings_focus (MetaWaylandTabletPadGroup *gro
 }
 
 static void
-meta_wayland_tablet_pad_group_update_strips_focus (MetaWaylandTabletPadGroup *group)
+meta_wayland_tablet_pad_group_update_strips_focus (
+  MetaWaylandTabletPadGroup *group)
 {
   GList *l;
 
@@ -348,20 +359,20 @@ move_resources (struct wl_list *destination, struct wl_list *source)
 }
 
 static void
-move_resources_for_client (struct wl_list *destination,
-                          struct wl_list *source,
-                          struct wl_client *client)
+move_resources_for_client (struct wl_list   *destination,
+                           struct wl_list   *source,
+                           struct wl_client *client)
 {
   struct wl_resource *resource, *tmp;
 
   wl_resource_for_each_safe (resource, tmp, source)
-    {
-      if (wl_resource_get_client (resource) == client)
-        {
-          wl_list_remove (wl_resource_get_link (resource));
-          wl_list_insert (destination, wl_resource_get_link (resource));
-        }
-    }
+  {
+    if (wl_resource_get_client (resource) == client)
+      {
+        wl_list_remove (wl_resource_get_link (resource));
+        wl_list_insert (destination, wl_resource_get_link (resource));
+      }
+  }
 }
 
 void
@@ -376,7 +387,8 @@ meta_wayland_tablet_pad_group_sync_focus (MetaWaylandTabletPadGroup *group)
     {
       move_resources_for_client (&group->focus_resource_list,
                                  &group->resource_list,
-                                 wl_resource_get_client (group->pad->focus_surface->resource));
+                                 wl_resource_get_client (group->pad->
+                                                         focus_surface->resource));
     }
 
   meta_wayland_tablet_pad_group_update_rings_focus (group);
@@ -390,8 +402,9 @@ meta_wayland_tablet_pad_group_sync_focus (MetaWaylandTabletPadGroup *group)
 }
 
 gboolean
-meta_wayland_tablet_pad_group_is_mode_switch_button (MetaWaylandTabletPadGroup *group,
-                                                     guint                      button)
+meta_wayland_tablet_pad_group_is_mode_switch_button (
+  MetaWaylandTabletPadGroup *group,
+  guint                      button)
 {
   gint n_group = g_list_index (group->pad->groups, group);
 
diff --git a/src/wayland/meta-wayland-tablet-pad-ring.c b/src/wayland/meta-wayland-tablet-pad-ring.c
index a89f5dd94..aea6ed55e 100644
--- a/src/wayland/meta-wayland-tablet-pad-ring.c
+++ b/src/wayland/meta-wayland-tablet-pad-ring.c
@@ -60,10 +60,10 @@ meta_wayland_tablet_pad_ring_free (MetaWaylandTabletPadRing *ring)
   struct wl_resource *resource, *next;
 
   wl_resource_for_each_safe (resource, next, &ring->resource_list)
-    {
-      wl_list_remove (wl_resource_get_link (resource));
-      wl_list_init (wl_resource_get_link (resource));
-    }
+  {
+    wl_list_remove (wl_resource_get_link (resource));
+    wl_list_init (wl_resource_get_link (resource));
+  }
 
   g_free (ring->feedback);
   g_slice_free (MetaWaylandTabletPadRing, ring);
@@ -90,16 +90,18 @@ tablet_pad_ring_destroy (struct wl_client   *client,
   wl_resource_destroy (resource);
 }
 
-static const struct zwp_tablet_pad_ring_v2_interface ring_interface = {
+static const struct zwp_tablet_pad_ring_v2_interface ring_interface =
+{
   tablet_pad_ring_set_feedback,
   tablet_pad_ring_destroy,
 };
 
 struct wl_resource *
-meta_wayland_tablet_pad_ring_create_new_resource (MetaWaylandTabletPadRing *ring,
-                                                  struct wl_client         *client,
-                                                  struct wl_resource       *group_resource,
-                                                  uint32_t                  id)
+meta_wayland_tablet_pad_ring_create_new_resource (
+  MetaWaylandTabletPadRing *ring,
+  struct wl_client         *client,
+  struct wl_resource       *group_resource,
+  uint32_t                  id)
 {
   struct wl_resource *resource;
 
@@ -134,21 +136,21 @@ meta_wayland_tablet_pad_ring_handle_event (MetaWaylandTabletPadRing *ring,
     }
 
   wl_resource_for_each (resource, focus_resources)
-    {
-      gdouble angle = event->pad_ring.angle;
+  {
+    gdouble angle = event->pad_ring.angle;
 
-      if (source_known)
-        zwp_tablet_pad_ring_v2_send_source (resource, source);
+    if (source_known)
+      zwp_tablet_pad_ring_v2_send_source (resource, source);
 
-      if (angle >= 0)
-        zwp_tablet_pad_ring_v2_send_angle (resource,
-                                           wl_fixed_from_double (angle));
-      else
-        zwp_tablet_pad_ring_v2_send_stop (resource);
+    if (angle >= 0)
+      zwp_tablet_pad_ring_v2_send_angle (resource,
+                                         wl_fixed_from_double (angle));
+    else
+      zwp_tablet_pad_ring_v2_send_stop (resource);
 
-      zwp_tablet_pad_ring_v2_send_frame (resource,
-                                         clutter_event_get_time (event));
-    }
+    zwp_tablet_pad_ring_v2_send_frame (resource,
+                                       clutter_event_get_time (event));
+  }
 
   return TRUE;
 }
@@ -161,19 +163,19 @@ move_resources (struct wl_list *destination, struct wl_list *source)
 }
 
 static void
-move_resources_for_client (struct wl_list *destination,
-                          struct wl_list *source,
-                          struct wl_client *client)
+move_resources_for_client (struct wl_list   *destination,
+                           struct wl_list   *source,
+                           struct wl_client *client)
 {
   struct wl_resource *resource, *tmp;
   wl_resource_for_each_safe (resource, tmp, source)
-    {
-      if (wl_resource_get_client (resource) == client)
-        {
-          wl_list_remove (wl_resource_get_link (resource));
-          wl_list_insert (destination, wl_resource_get_link (resource));
-        }
-    }
+  {
+    if (wl_resource_get_client (resource) == client)
+      {
+        wl_list_remove (wl_resource_get_link (resource));
+        wl_list_insert (destination, wl_resource_get_link (resource));
+      }
+  }
 }
 
 void
@@ -190,13 +192,14 @@ meta_wayland_tablet_pad_ring_sync_focus (MetaWaylandTabletPadRing *ring)
     {
       move_resources_for_client (&ring->focus_resource_list,
                                  &ring->resource_list,
-                                 wl_resource_get_client (ring->pad->focus_surface->resource));
+                                 wl_resource_get_client (ring->pad->
+                                                         focus_surface->resource));
     }
 }
 
 void
 meta_wayland_tablet_pad_ring_set_group (MetaWaylandTabletPadRing  *ring,
-                                       MetaWaylandTabletPadGroup *group)
+                                        MetaWaylandTabletPadGroup *group)
 {
   /* Group is static, can only be set once */
   g_assert (ring->group == NULL);
diff --git a/src/wayland/meta-wayland-tablet-pad-strip.c b/src/wayland/meta-wayland-tablet-pad-strip.c
index 6f6c20d8d..20537475c 100644
--- a/src/wayland/meta-wayland-tablet-pad-strip.c
+++ b/src/wayland/meta-wayland-tablet-pad-strip.c
@@ -60,10 +60,10 @@ meta_wayland_tablet_pad_strip_free (MetaWaylandTabletPadStrip *strip)
   struct wl_resource *resource, *next;
 
   wl_resource_for_each_safe (resource, next, &strip->resource_list)
-    {
-      wl_list_remove (wl_resource_get_link (resource));
-      wl_list_init (wl_resource_get_link (resource));
-    }
+  {
+    wl_list_remove (wl_resource_get_link (resource));
+    wl_list_init (wl_resource_get_link (resource));
+  }
 
   g_free (strip->feedback);
   g_slice_free (MetaWaylandTabletPadStrip, strip);
@@ -90,16 +90,18 @@ tablet_pad_strip_destroy (struct wl_client   *client,
   wl_resource_destroy (resource);
 }
 
-static const struct zwp_tablet_pad_strip_v2_interface strip_interface = {
+static const struct zwp_tablet_pad_strip_v2_interface strip_interface =
+{
   tablet_pad_strip_set_feedback,
   tablet_pad_strip_destroy,
 };
 
 struct wl_resource *
-meta_wayland_tablet_pad_strip_create_new_resource (MetaWaylandTabletPadStrip *strip,
-                                                   struct wl_client          *client,
-                                                   struct wl_resource        *group_resource,
-                                                   uint32_t                   id)
+meta_wayland_tablet_pad_strip_create_new_resource (
+  MetaWaylandTabletPadStrip *strip,
+  struct wl_client          *client,
+  struct wl_resource        *group_resource,
+  uint32_t                   id)
 {
   struct wl_resource *resource;
 
@@ -134,20 +136,21 @@ meta_wayland_tablet_pad_strip_handle_event (MetaWaylandTabletPadStrip *strip,
     }
 
   wl_resource_for_each (resource, focus_resources)
-    {
-      gdouble value = event->pad_strip.value;
+  {
+    gdouble value = event->pad_strip.value;
 
-      if (source_known)
-        zwp_tablet_pad_strip_v2_send_source (resource, source);
+    if (source_known)
+      zwp_tablet_pad_strip_v2_send_source (resource, source);
 
-      if (value >= 0)
-        zwp_tablet_pad_strip_v2_send_position (resource, (uint32_t) (value * 65535));
-      else
-        zwp_tablet_pad_strip_v2_send_stop (resource);
+    if (value >= 0)
+      zwp_tablet_pad_strip_v2_send_position (resource,
+                                             (uint32_t) (value * 65535));
+    else
+      zwp_tablet_pad_strip_v2_send_stop (resource);
 
-      zwp_tablet_pad_strip_v2_send_frame (resource,
-                                          clutter_event_get_time (event));
-    }
+    zwp_tablet_pad_strip_v2_send_frame (resource,
+                                        clutter_event_get_time (event));
+  }
 
   return TRUE;
 }
@@ -160,19 +163,19 @@ move_resources (struct wl_list *destination, struct wl_list *source)
 }
 
 static void
-move_resources_for_client (struct wl_list *destination,
-                          struct wl_list *source,
-                          struct wl_client *client)
+move_resources_for_client (struct wl_list   *destination,
+                           struct wl_list   *source,
+                           struct wl_client *client)
 {
   struct wl_resource *resource, *tmp;
   wl_resource_for_each_safe (resource, tmp, source)
-    {
-      if (wl_resource_get_client (resource) == client)
-        {
-          wl_list_remove (wl_resource_get_link (resource));
-          wl_list_insert (destination, wl_resource_get_link (resource));
-        }
-    }
+  {
+    if (wl_resource_get_client (resource) == client)
+      {
+        wl_list_remove (wl_resource_get_link (resource));
+        wl_list_insert (destination, wl_resource_get_link (resource));
+      }
+  }
 }
 
 void
@@ -189,7 +192,8 @@ meta_wayland_tablet_pad_strip_sync_focus (MetaWaylandTabletPadStrip *strip)
     {
       move_resources_for_client (&strip->focus_resource_list,
                                  &strip->resource_list,
-                                 wl_resource_get_client (strip->pad->focus_surface->resource));
+                                 wl_resource_get_client (strip->pad->
+                                                         focus_surface->resource));
     }
 }
 
diff --git a/src/wayland/meta-wayland-tablet-pad.c b/src/wayland/meta-wayland-tablet-pad.c
index ed31e236f..dc7b669ed 100644
--- a/src/wayland/meta-wayland-tablet-pad.c
+++ b/src/wayland/meta-wayland-tablet-pad.c
@@ -54,7 +54,8 @@ static void
 pad_handle_focus_surface_destroy (struct wl_listener *listener,
                                   void               *data)
 {
-  MetaWaylandTabletPad *pad = wl_container_of (listener, pad, focus_surface_listener);
+  MetaWaylandTabletPad *pad = wl_container_of (listener, pad,
+                                               focus_surface_listener);
 
   meta_wayland_tablet_pad_set_focus (pad, NULL);
 }
@@ -69,7 +70,8 @@ group_rings_strips (MetaWaylandTabletPad *pad)
   struct libinput_device *libinput_device = NULL;
 
   if (META_IS_BACKEND_NATIVE (backend))
-    libinput_device = clutter_evdev_input_device_get_libinput_device (pad->device);
+    libinput_device = clutter_evdev_input_device_get_libinput_device (
+      pad->device);
 #endif
 
   for (n_group = 0, g = pad->groups; g; g = g->next)
@@ -79,7 +81,8 @@ group_rings_strips (MetaWaylandTabletPad *pad)
       struct libinput_tablet_pad_mode_group *mode_group = NULL;
 
       if (libinput_device)
-        mode_group = libinput_device_tablet_pad_get_mode_group (libinput_device, n_group);
+        mode_group = libinput_device_tablet_pad_get_mode_group (libinput_device,
+                                                                n_group);
 #endif
 
       for (n_elem = 0, l = pad->rings; l; l = l->next)
@@ -94,11 +97,11 @@ group_rings_strips (MetaWaylandTabletPad *pad)
             }
           else
 #endif
-            {
-              /* Assign everything to the first group */
-              if (n_group == 0)
-                meta_wayland_tablet_pad_ring_set_group (ring, group);
-            }
+          {
+            /* Assign everything to the first group */
+            if (n_group == 0)
+              meta_wayland_tablet_pad_ring_set_group (ring, group);
+          }
           n_elem++;
         }
 
@@ -114,11 +117,11 @@ group_rings_strips (MetaWaylandTabletPad *pad)
             }
           else
 #endif
-            {
-              /* Assign everything to the first group */
-              if (n_group == 0)
-                meta_wayland_tablet_pad_strip_set_group (strip, group);
-            }
+          {
+            /* Assign everything to the first group */
+            if (n_group == 0)
+              meta_wayland_tablet_pad_strip_set_group (strip, group);
+          }
 
           n_elem++;
         }
@@ -154,7 +157,8 @@ meta_wayland_tablet_pad_new (ClutterInputDevice    *device,
       struct libinput_device *libinput_device;
 
       libinput_device = clutter_evdev_input_device_get_libinput_device (device);
-      pad->n_buttons = libinput_device_tablet_pad_get_num_buttons (libinput_device);
+      pad->n_buttons = libinput_device_tablet_pad_get_num_buttons (
+        libinput_device);
     }
 #endif
 
@@ -199,11 +203,11 @@ meta_wayland_tablet_pad_free (MetaWaylandTabletPad *pad)
   meta_wayland_tablet_pad_set_focus (pad, NULL);
 
   wl_resource_for_each_safe (resource, next, &pad->resource_list)
-    {
-      zwp_tablet_pad_v2_send_removed (resource);
-      wl_list_remove (wl_resource_get_link (resource));
-      wl_list_init (wl_resource_get_link (resource));
-    }
+  {
+    zwp_tablet_pad_v2_send_removed (resource);
+    wl_list_remove (wl_resource_get_link (resource));
+    wl_list_init (wl_resource_get_link (resource));
+  }
 
   g_list_free_full (pad->groups,
                     (GDestroyNotify) meta_wayland_tablet_pad_group_free);
@@ -242,7 +246,8 @@ tablet_pad_set_feedback (struct wl_client   *client,
                          uint32_t            serial)
 {
   MetaWaylandTabletPad *pad = wl_resource_get_user_data (resource);
-  MetaWaylandTabletPadGroup *group = tablet_pad_lookup_button_group (pad, button);
+  MetaWaylandTabletPadGroup *group =
+    tablet_pad_lookup_button_group (pad, button);
   MetaInputSettings *input_settings;
 
   if (!group || group->mode_switch_serial != serial)
@@ -251,13 +256,15 @@ tablet_pad_set_feedback (struct wl_client   *client,
   input_settings = meta_backend_get_input_settings (meta_get_backend ());
 
   if (input_settings &&
-      meta_input_settings_is_pad_button_grabbed (input_settings, pad->device, button))
+      meta_input_settings_is_pad_button_grabbed (input_settings, pad->device,
+                                                 button))
     return;
 
   if (meta_wayland_tablet_pad_group_is_mode_switch_button (group, button))
     return;
 
-  g_hash_table_insert (pad->feedback, GUINT_TO_POINTER (button), g_strdup (str));
+  g_hash_table_insert (pad->feedback, GUINT_TO_POINTER (button),
+                       g_strdup (str));
 }
 
 static void
@@ -267,14 +274,15 @@ tablet_pad_destroy (struct wl_client   *client,
   wl_resource_destroy (resource);
 }
 
-static const struct zwp_tablet_pad_v2_interface pad_interface = {
+static const struct zwp_tablet_pad_v2_interface pad_interface =
+{
   tablet_pad_set_feedback,
   tablet_pad_destroy,
 };
 
 void
-meta_wayland_tablet_pad_notify (MetaWaylandTabletPad  *pad,
-                                struct wl_resource    *resource)
+meta_wayland_tablet_pad_notify (MetaWaylandTabletPad *pad,
+                                struct wl_resource   *resource)
 {
   struct wl_client *client = wl_resource_get_client (resource);
   const gchar *node_path;
@@ -353,11 +361,11 @@ handle_pad_button_event (MetaWaylandTabletPad *pad,
     return FALSE;
 
   wl_resource_for_each (resource, focus_resources)
-    {
-      zwp_tablet_pad_v2_send_button (resource,
-                                     clutter_event_get_time (event),
-                                     event->pad_button.button, button_state);
-    }
+  {
+    zwp_tablet_pad_v2_send_button (resource,
+                                   clutter_event_get_time (event),
+                                   event->pad_button.button, button_state);
+  }
 
   return TRUE;
 }
@@ -421,20 +429,20 @@ move_resources (struct wl_list *destination, struct wl_list *source)
 }
 
 static void
-move_resources_for_client (struct wl_list *destination,
-                          struct wl_list *source,
-                          struct wl_client *client)
+move_resources_for_client (struct wl_list   *destination,
+                           struct wl_list   *source,
+                           struct wl_client *client)
 {
   struct wl_resource *resource, *tmp;
 
   wl_resource_for_each_safe (resource, tmp, source)
-    {
-      if (wl_resource_get_client (resource) == client)
-        {
-          wl_list_remove (wl_resource_get_link (resource));
-          wl_list_insert (destination, wl_resource_get_link (resource));
-        }
-    }
+  {
+    if (wl_resource_get_client (resource) == client)
+      {
+        wl_list_remove (wl_resource_get_link (resource));
+        wl_list_insert (destination, wl_resource_get_link (resource));
+      }
+  }
 }
 
 static void
@@ -459,11 +467,11 @@ meta_wayland_tablet_pad_broadcast_enter (MetaWaylandTabletPad *pad,
   tablet_resource = meta_wayland_tablet_lookup_resource (tablet, client);
 
   wl_resource_for_each (resource, &pad->focus_resource_list)
-    {
-      zwp_tablet_pad_v2_send_enter (resource, serial,
-                                    tablet_resource,
-                                    surface->resource);
-    }
+  {
+    zwp_tablet_pad_v2_send_enter (resource, serial,
+                                  tablet_resource,
+                                  surface->resource);
+  }
 }
 
 static void
@@ -474,10 +482,10 @@ meta_wayland_tablet_pad_broadcast_leave (MetaWaylandTabletPad *pad,
   struct wl_resource *resource;
 
   wl_resource_for_each (resource, &pad->focus_resource_list)
-    {
-      zwp_tablet_pad_v2_send_leave (resource, serial,
-                                    surface->resource);
-    }
+  {
+    zwp_tablet_pad_v2_send_leave (resource, serial,
+                                  surface->resource);
+  }
 }
 
 void
@@ -493,7 +501,8 @@ meta_wayland_tablet_pad_set_focus (MetaWaylandTabletPad *pad,
 
   if (pad->focus_surface != NULL)
     {
-      struct wl_client *client = wl_resource_get_client (pad->focus_surface->resource);
+      struct wl_client *client = wl_resource_get_client (
+        pad->focus_surface->resource);
       struct wl_list *focus_resources = &pad->focus_resource_list;
 
       if (!wl_list_empty (focus_resources))
@@ -564,7 +573,9 @@ meta_wayland_tablet_pad_label_mode_switch_button (MetaWaylandTabletPad *pad,
       group = l->data;
 
       if (meta_wayland_tablet_pad_group_is_mode_switch_button (group, button))
-        return g_strdup_printf (_("Mode Switch: Mode %d"), group->current_mode + 1);
+        return g_strdup_printf (_(
+                                  "Mode Switch: Mode %d"),
+                                group->current_mode + 1);
     }
 
   return NULL;
@@ -572,8 +583,8 @@ meta_wayland_tablet_pad_label_mode_switch_button (MetaWaylandTabletPad *pad,
 
 gchar *
 meta_wayland_tablet_pad_get_label (MetaWaylandTabletPad *pad,
-                                  MetaPadActionType     type,
-                                  guint                 action)
+                                   MetaPadActionType     type,
+                                   guint                 action)
 {
   const gchar *label = NULL;
   gchar *mode_label;
@@ -581,30 +592,31 @@ meta_wayland_tablet_pad_get_label (MetaWaylandTabletPad *pad,
   switch (type)
     {
     case META_PAD_ACTION_BUTTON:
-      mode_label = meta_wayland_tablet_pad_label_mode_switch_button (pad, action);
+      mode_label =
+        meta_wayland_tablet_pad_label_mode_switch_button (pad, action);
       if (mode_label)
         return mode_label;
 
       label = g_hash_table_lookup (pad->feedback, GUINT_TO_POINTER (action));
       break;
     case META_PAD_ACTION_RING:
-      {
-        MetaWaylandTabletPadRing *ring;
+    {
+      MetaWaylandTabletPadRing *ring;
 
-        ring = g_list_nth_data (pad->rings, action);
-        if (ring)
-          label = ring->feedback;
-        break;
-      }
+      ring = g_list_nth_data (pad->rings, action);
+      if (ring)
+        label = ring->feedback;
+      break;
+    }
     case META_PAD_ACTION_STRIP:
-      {
-        MetaWaylandTabletPadStrip *strip;
+    {
+      MetaWaylandTabletPadStrip *strip;
 
-        strip = g_list_nth_data (pad->strips, action);
-        if (strip)
-          label = strip->feedback;
-        break;
-      }
+      strip = g_list_nth_data (pad->strips, action);
+      if (strip)
+        label = strip->feedback;
+      break;
+    }
     }
 
   return g_strdup (label);
diff --git a/src/wayland/meta-wayland-tablet-seat.c b/src/wayland/meta-wayland-tablet-seat.c
index dd35724c4..76369e5b0 100644
--- a/src/wayland/meta-wayland-tablet-seat.c
+++ b/src/wayland/meta-wayland-tablet-seat.c
@@ -97,9 +97,9 @@ broadcast_tablet_added (MetaWaylandTabletSeat *tablet_seat,
   struct wl_resource *resource;
 
   wl_resource_for_each (resource, &tablet_seat->resource_list)
-    {
-      notify_tablet_added (tablet_seat, resource, device);
-    }
+  {
+    notify_tablet_added (tablet_seat, resource, device);
+  }
 }
 
 static void
@@ -151,9 +151,9 @@ broadcast_pad_added (MetaWaylandTabletSeat *tablet_seat,
   struct wl_resource *resource;
 
   wl_resource_for_each (resource, &tablet_seat->resource_list)
-    {
-      notify_pad_added (tablet_seat, resource, device);
-    }
+  {
+    notify_pad_added (tablet_seat, resource, device);
+  }
 }
 
 static void
@@ -174,7 +174,8 @@ is_tablet_device (ClutterInputDevice *device)
 {
   ClutterInputDeviceType device_type;
 
-  if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER)
+  if (clutter_input_device_get_device_mode (device) ==
+      CLUTTER_INPUT_MODE_MASTER)
     return FALSE;
 
   device_type = clutter_input_device_get_device_type (device);
@@ -190,7 +191,8 @@ is_pad_device (ClutterInputDevice *device)
 {
   ClutterInputDeviceType device_type;
 
-  if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER)
+  if (clutter_input_device_get_device_mode (device) ==
+      CLUTTER_INPUT_MODE_MASTER)
     return FALSE;
 
   device_type = clutter_input_device_get_device_type (device);
@@ -252,7 +254,8 @@ tablet_seat_destroy (struct wl_client   *client,
   wl_resource_destroy (resource);
 }
 
-static const struct zwp_tablet_seat_v2_interface tablet_seat_interface = {
+static const struct zwp_tablet_seat_v2_interface tablet_seat_interface =
+{
   tablet_seat_destroy
 };
 
@@ -279,7 +282,8 @@ meta_wayland_tablet_seat_new (MetaWaylandTabletManager *manager,
                             G_CALLBACK (meta_wayland_tablet_seat_device_added),
                             tablet_seat);
   g_signal_connect_swapped (tablet_seat->device_manager, "device-removed",
-                            G_CALLBACK (meta_wayland_tablet_seat_device_removed),
+                            G_CALLBACK (
+                              meta_wayland_tablet_seat_device_removed),
                             tablet_seat);
 
   devices = clutter_device_manager_peek_devices (tablet_seat->device_manager);
@@ -296,10 +300,10 @@ meta_wayland_tablet_seat_free (MetaWaylandTabletSeat *tablet_seat)
   struct wl_resource *resource, *next;
 
   wl_resource_for_each_safe (resource, next, &tablet_seat->resource_list)
-    {
-      wl_list_remove (wl_resource_get_link (resource));
-      wl_list_init (wl_resource_get_link (resource));
-    }
+  {
+    wl_list_remove (wl_resource_get_link (resource));
+    wl_list_init (wl_resource_get_link (resource));
+  }
 
   g_signal_handlers_disconnect_by_data (tablet_seat->device_manager,
                                         tablet_seat);
@@ -310,10 +314,11 @@ meta_wayland_tablet_seat_free (MetaWaylandTabletSeat *tablet_seat)
 }
 
 struct wl_resource *
-meta_wayland_tablet_seat_create_new_resource (MetaWaylandTabletSeat *tablet_seat,
-                                              struct wl_client      *client,
-                                              struct wl_resource    *manager_resource,
-                                              uint32_t               id)
+meta_wayland_tablet_seat_create_new_resource (
+  MetaWaylandTabletSeat *tablet_seat,
+  struct wl_client      *client,
+  struct wl_resource    *manager_resource,
+  uint32_t               id)
 {
   struct wl_resource *resource;
 
@@ -399,7 +404,8 @@ meta_wayland_tablet_seat_update (MetaWaylandTabletSeat *tablet_seat,
       device_tool = clutter_event_get_device_tool (event);
 
       if (device && device_tool)
-        tool = meta_wayland_tablet_seat_ensure_tool (tablet_seat, device, device_tool);
+        tool = meta_wayland_tablet_seat_ensure_tool (tablet_seat, device,
+                                                     device_tool);
 
       if (!tool)
         return;
@@ -474,8 +480,8 @@ meta_wayland_tablet_seat_notify_tool (MetaWaylandTabletSeat *tablet_seat,
 }
 
 static GList *
-lookup_grouped_devices (ClutterInputDevice     *device,
-                        ClutterInputDeviceType  type)
+lookup_grouped_devices (ClutterInputDevice    *device,
+                        ClutterInputDeviceType type)
 {
   ClutterDeviceManager *device_manager;
   const GSList *devices, *l;
@@ -501,8 +507,9 @@ lookup_grouped_devices (ClutterInputDevice     *device,
 }
 
 MetaWaylandTablet *
-meta_wayland_tablet_seat_lookup_paired_tablet (MetaWaylandTabletSeat *tablet_seat,
-                                               MetaWaylandTabletPad  *pad)
+meta_wayland_tablet_seat_lookup_paired_tablet (
+  MetaWaylandTabletSeat *tablet_seat,
+  MetaWaylandTabletPad  *pad)
 {
   MetaWaylandTablet *tablet;
   GList *devices;
diff --git a/src/wayland/meta-wayland-tablet-tool.c b/src/wayland/meta-wayland-tablet-tool.c
index 222b46633..65fbc780e 100644
--- a/src/wayland/meta-wayland-tablet-tool.c
+++ b/src/wayland/meta-wayland-tablet-tool.c
@@ -69,13 +69,13 @@ move_resources_for_client (struct wl_list   *destination,
   struct wl_resource *resource, *tmp;
 
   wl_resource_for_each_safe (resource, tmp, source)
-    {
-      if (wl_resource_get_client (resource) == client)
-        {
-          wl_list_remove (wl_resource_get_link (resource));
-          wl_list_insert (destination, wl_resource_get_link (resource));
-        }
-    }
+  {
+    if (wl_resource_get_client (resource) == client)
+      {
+        wl_list_remove (wl_resource_get_link (resource));
+        wl_list_insert (destination, wl_resource_get_link (resource));
+      }
+  }
 }
 
 static void
@@ -256,7 +256,8 @@ meta_wayland_tablet_tool_ensure_resource (MetaWaylandTabletTool *tool,
   if (seat_resource &&
       !meta_wayland_tablet_tool_lookup_resource (tool, client))
     {
-      tool_resource = meta_wayland_tablet_tool_create_new_resource (tool, client,
+      tool_resource = meta_wayland_tablet_tool_create_new_resource (tool,
+                                                                    client,
                                                                     seat_resource,
                                                                     0);
 
@@ -276,11 +277,11 @@ broadcast_proximity_in (MetaWaylandTabletTool *tool)
                                                          client);
 
   wl_resource_for_each (resource, &tool->focus_resource_list)
-    {
-      zwp_tablet_tool_v2_send_proximity_in (resource, tool->proximity_serial,
-                                            tablet_resource,
-                                            tool->focus_surface->resource);
-    }
+  {
+    zwp_tablet_tool_v2_send_proximity_in (resource, tool->proximity_serial,
+                                          tablet_resource,
+                                          tool->focus_surface->resource);
+  }
 }
 
 static void
@@ -289,9 +290,9 @@ broadcast_proximity_out (MetaWaylandTabletTool *tool)
   struct wl_resource *resource;
 
   wl_resource_for_each (resource, &tool->focus_resource_list)
-    {
-      zwp_tablet_tool_v2_send_proximity_out (resource);
-    }
+  {
+    zwp_tablet_tool_v2_send_proximity_out (resource);
+  }
 }
 
 static void
@@ -302,9 +303,9 @@ broadcast_frame (MetaWaylandTabletTool *tool,
   guint32 _time = event ? clutter_event_get_time (event) : CLUTTER_CURRENT_TIME;
 
   wl_resource_for_each (resource, &tool->focus_resource_list)
-    {
-      zwp_tablet_tool_v2_send_frame (resource, _time);
-    }
+  {
+    zwp_tablet_tool_v2_send_frame (resource, _time);
+  }
 }
 
 static void
@@ -349,7 +350,8 @@ meta_wayland_tablet_tool_set_focus (MetaWaylandTabletTool *tool,
 
       if (!wl_list_empty (l))
         {
-          struct wl_client *client = wl_resource_get_client (tool->focus_surface->resource);
+          struct wl_client *client = wl_resource_get_client (
+            tool->focus_surface->resource);
           struct wl_display *display = wl_client_get_display (client);
 
           tool->proximity_serial = wl_display_next_serial (display);
@@ -416,8 +418,10 @@ meta_wayland_tablet_tool_new (MetaWaylandTabletSeat  *seat,
   wl_list_init (&tool->resource_list);
   wl_list_init (&tool->focus_resource_list);
 
-  tool->focus_surface_destroy_listener.notify = tablet_tool_handle_focus_surface_destroy;
-  tool->cursor_surface_destroy_listener.notify = tablet_tool_handle_cursor_surface_destroy;
+  tool->focus_surface_destroy_listener.notify =
+    tablet_tool_handle_focus_surface_destroy;
+  tool->cursor_surface_destroy_listener.notify =
+    tablet_tool_handle_cursor_surface_destroy;
 
   tool->default_sprite = meta_cursor_sprite_xcursor_new (META_CURSOR_CROSSHAIR);
   tool->prepare_at_signal_id =
@@ -437,13 +441,14 @@ meta_wayland_tablet_tool_free (MetaWaylandTabletTool *tool)
   g_clear_object (&tool->cursor_renderer);
 
   wl_resource_for_each_safe (resource, next, &tool->resource_list)
-    {
-      zwp_tablet_tool_v2_send_removed (resource);
-      wl_list_remove (wl_resource_get_link (resource));
-      wl_list_init (wl_resource_get_link (resource));
-    }
-
-  g_signal_handler_disconnect (tool->default_sprite, tool->prepare_at_signal_id);
+  {
+    zwp_tablet_tool_v2_send_removed (resource);
+    wl_list_remove (wl_resource_get_link (resource));
+    wl_list_init (wl_resource_get_link (resource));
+  }
+
+  g_signal_handler_disconnect (tool->default_sprite,
+                               tool->prepare_at_signal_id);
   g_object_unref (tool->default_sprite);
 
   g_slice_free (MetaWaylandTabletTool, tool);
@@ -460,7 +465,8 @@ tool_set_cursor (struct wl_client   *client,
   MetaWaylandTabletTool *tool = wl_resource_get_user_data (resource);
   MetaWaylandSurface *surface;
 
-  surface = (surface_resource ? wl_resource_get_user_data (surface_resource) : NULL);
+  surface =
+    (surface_resource ? wl_resource_get_user_data (surface_resource) : NULL);
 
   if (tool->focus_surface == NULL)
     return;
@@ -503,7 +509,8 @@ tool_destroy (struct wl_client   *client,
   wl_resource_destroy (resource);
 }
 
-static const struct zwp_tablet_tool_v2_interface tool_interface = {
+static const struct zwp_tablet_tool_v2_interface tool_interface =
+{
   tool_set_cursor,
   tool_destroy
 };
@@ -523,7 +530,8 @@ emit_proximity_in (MetaWaylandTabletTool *tool,
                                                          client);
 
   zwp_tablet_tool_v2_send_proximity_in (resource, tool->proximity_serial,
-                                        tablet_resource, tool->focus_surface->resource);
+                                        tablet_resource,
+                                        tool->focus_surface->resource);
 }
 
 struct wl_resource *
@@ -543,7 +551,8 @@ meta_wayland_tablet_tool_create_new_resource (MetaWaylandTabletTool *tool,
   if (tool->focus_surface &&
       wl_resource_get_client (tool->focus_surface->resource) == client)
     {
-      wl_list_insert (&tool->focus_resource_list, wl_resource_get_link (resource));
+      wl_list_insert (&tool->focus_resource_list, wl_resource_get_link (
+                        resource));
       emit_proximity_in (tool, resource);
     }
   else
@@ -619,7 +628,8 @@ repick_for_event (MetaWaylandTabletTool *tool,
   actor = clutter_event_get_source (for_event);
 
   if (META_IS_SURFACE_ACTOR_WAYLAND (actor))
-    tool->current = meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (actor));
+    tool->current = meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (
+                                                              actor));
   else
     tool->current = NULL;
 
@@ -640,7 +650,9 @@ meta_wayland_tablet_tool_get_relative_coordinates (MetaWaylandTabletTool *tool,
   surface_actor = meta_wayland_surface_get_actor (surface);
 
   clutter_event_get_coords (event, &xf, &yf);
-  clutter_actor_transform_stage_point (CLUTTER_ACTOR (meta_surface_actor_get_texture (surface_actor)),
+  clutter_actor_transform_stage_point (CLUTTER_ACTOR (
+                                         meta_surface_actor_get_texture (
+                                           surface_actor)),
                                        xf, yf, &xf, &yf);
 
   *sx = wl_fixed_from_double (xf) / surface->scale;
@@ -659,9 +671,9 @@ broadcast_motion (MetaWaylandTabletTool *tool,
                                                      &sx, &sy);
 
   wl_resource_for_each (resource, &tool->focus_resource_list)
-    {
-      zwp_tablet_tool_v2_send_motion (resource, sx, sy);
-    }
+  {
+    zwp_tablet_tool_v2_send_motion (resource, sx, sy);
+  }
 }
 
 static void
@@ -673,9 +685,9 @@ broadcast_down (MetaWaylandTabletTool *tool,
   tool->down_serial = wl_display_next_serial (tool->seat->manager->wl_display);
 
   wl_resource_for_each (resource, &tool->focus_resource_list)
-    {
-      zwp_tablet_tool_v2_send_down (resource, tool->down_serial);
-    }
+  {
+    zwp_tablet_tool_v2_send_down (resource, tool->down_serial);
+  }
 }
 
 static void
@@ -685,9 +697,9 @@ broadcast_up (MetaWaylandTabletTool *tool,
   struct wl_resource *resource;
 
   wl_resource_for_each (resource, &tool->focus_resource_list)
-    {
-      zwp_tablet_tool_v2_send_up (resource);
-    }
+  {
+    zwp_tablet_tool_v2_send_up (resource);
+  }
 }
 
 static void
@@ -705,22 +717,23 @@ broadcast_button (MetaWaylandTabletTool *tool,
     }
   else
 #endif
-    {
-      /* We can't do much better here, there's several
-       * different BTN_ ranges to cover.
-       */
-      button = event->button.button;
-    }
+  {
+    /* We can't do much better here, there's several
+     * different BTN_ ranges to cover.
+     */
+    button = event->button.button;
+  }
 
-  tool->button_serial = wl_display_next_serial (tool->seat->manager->wl_display);
+  tool->button_serial =
+    wl_display_next_serial (tool->seat->manager->wl_display);
 
   wl_resource_for_each (resource, &tool->focus_resource_list)
-    {
-      zwp_tablet_tool_v2_send_button (resource, tool->button_serial, button,
-                                      event->type == CLUTTER_BUTTON_PRESS ?
-                                      ZWP_TABLET_TOOL_V2_BUTTON_STATE_PRESSED :
-                                      ZWP_TABLET_TOOL_V2_BUTTON_STATE_RELEASED);
-    }
+  {
+    zwp_tablet_tool_v2_send_button (resource, tool->button_serial, button,
+                                    event->type == CLUTTER_BUTTON_PRESS ?
+                                    ZWP_TABLET_TOOL_V2_BUTTON_STATE_PRESSED :
+                                    ZWP_TABLET_TOOL_V2_BUTTON_STATE_RELEASED);
+  }
 }
 
 static void
@@ -735,28 +748,29 @@ broadcast_axis (MetaWaylandTabletTool *tool,
 
   source = clutter_event_get_source_device (event);
 
-  if (!clutter_input_device_get_axis_value (source, event->motion.axes, axis, &val))
+  if (!clutter_input_device_get_axis_value (source, event->motion.axes, axis,
+                                            &val))
     return;
 
   value = val * TABLET_AXIS_MAX;
 
   wl_resource_for_each (resource, &tool->focus_resource_list)
-    {
-      switch (axis)
-        {
-        case CLUTTER_INPUT_AXIS_PRESSURE:
-          zwp_tablet_tool_v2_send_pressure (resource, value);
-          break;
-        case CLUTTER_INPUT_AXIS_DISTANCE:
-          zwp_tablet_tool_v2_send_distance (resource, value);
-          break;
-        case CLUTTER_INPUT_AXIS_SLIDER:
-          zwp_tablet_tool_v2_send_slider (resource, value);
-          break;
-        default:
-          break;
-        }
-    }
+  {
+    switch (axis)
+      {
+      case CLUTTER_INPUT_AXIS_PRESSURE:
+        zwp_tablet_tool_v2_send_pressure (resource, value);
+        break;
+      case CLUTTER_INPUT_AXIS_DISTANCE:
+        zwp_tablet_tool_v2_send_distance (resource, value);
+        break;
+      case CLUTTER_INPUT_AXIS_SLIDER:
+        zwp_tablet_tool_v2_send_slider (resource, value);
+        break;
+      default:
+        break;
+      }
+  }
 }
 
 static void
@@ -776,11 +790,11 @@ broadcast_tilt (MetaWaylandTabletTool *tool,
     return;
 
   wl_resource_for_each (resource, &tool->focus_resource_list)
-    {
-      zwp_tablet_tool_v2_send_tilt (resource,
-                                    wl_fixed_from_double (xtilt),
-                                    wl_fixed_from_double (ytilt));
-    }
+  {
+    zwp_tablet_tool_v2_send_tilt (resource,
+                                  wl_fixed_from_double (xtilt),
+                                  wl_fixed_from_double (ytilt));
+  }
 }
 
 static void
@@ -799,10 +813,10 @@ broadcast_rotation (MetaWaylandTabletTool *tool,
     return;
 
   wl_resource_for_each (resource, &tool->focus_resource_list)
-    {
-      zwp_tablet_tool_v2_send_rotation (resource,
-                                        wl_fixed_from_double (rotation));
-    }
+  {
+    zwp_tablet_tool_v2_send_rotation (resource,
+                                      wl_fixed_from_double (rotation));
+  }
 }
 
 static void
@@ -830,11 +844,11 @@ broadcast_wheel (MetaWaylandTabletTool *tool,
     return;
 
   wl_resource_for_each (resource, &tool->focus_resource_list)
-    {
-      zwp_tablet_tool_v2_send_wheel (resource,
-                                     wl_fixed_from_double (angle),
-                                     clicks);
-    }
+  {
+    zwp_tablet_tool_v2_send_wheel (resource,
+                                   wl_fixed_from_double (angle),
+                                   clicks);
+  }
 }
 
 static void
@@ -915,7 +929,8 @@ meta_wayland_tablet_tool_update (MetaWaylandTabletTool *tool,
         tool->cursor_renderer = meta_cursor_renderer_new ();
       tool->current_tablet =
         meta_wayland_tablet_seat_lookup_tablet (tool->seat,
-                                                clutter_event_get_source_device (event));
+                                                clutter_event_get_source_device (
+                                                  event));
       break;
     case CLUTTER_PROXIMITY_OUT:
       tool->current_tablet = NULL;
diff --git a/src/wayland/meta-wayland-tablet.c b/src/wayland/meta-wayland-tablet.c
index 763f804b2..adf70ed56 100644
--- a/src/wayland/meta-wayland-tablet.c
+++ b/src/wayland/meta-wayland-tablet.c
@@ -59,11 +59,11 @@ meta_wayland_tablet_free (MetaWaylandTablet *tablet)
   struct wl_resource *resource, *next;
 
   wl_resource_for_each_safe (resource, next, &tablet->resource_list)
-    {
-      zwp_tablet_v2_send_removed (resource);
-      wl_list_remove (wl_resource_get_link (resource));
-      wl_list_init (wl_resource_get_link (resource));
-    }
+  {
+    zwp_tablet_v2_send_removed (resource);
+    wl_list_remove (wl_resource_get_link (resource));
+    wl_list_init (wl_resource_get_link (resource));
+  }
 
   g_slice_free (MetaWaylandTablet, tablet);
 }
@@ -75,7 +75,8 @@ tablet_destroy (struct wl_client   *client,
   wl_resource_destroy (resource);
 }
 
-static const struct zwp_tablet_v2_interface tablet_interface = {
+static const struct zwp_tablet_v2_interface tablet_interface =
+{
   tablet_destroy
 };
 
@@ -87,7 +88,8 @@ meta_wayland_tablet_notify (MetaWaylandTablet  *tablet,
   const gchar *node_path, *vendor, *product;
   guint vid, pid;
 
-  zwp_tablet_v2_send_name (resource, clutter_input_device_get_device_name (device));
+  zwp_tablet_v2_send_name (resource,
+                           clutter_input_device_get_device_name (device));
 
   node_path = clutter_input_device_get_device_node (device);
   if (node_path)
diff --git a/src/wayland/meta-wayland-text-input-legacy.c b/src/wayland/meta-wayland-text-input-legacy.c
index ddd2cce80..056bf0092 100644
--- a/src/wayland/meta-wayland-text-input-legacy.c
+++ b/src/wayland/meta-wayland-text-input-legacy.c
@@ -30,13 +30,14 @@
 
 #include "gtk-text-input-server-protocol.h"
 
-#define META_TYPE_WAYLAND_GTK_TEXT_INPUT_FOCUS (meta_wayland_gtk_text_input_focus_get_type ())
+#define META_TYPE_WAYLAND_GTK_TEXT_INPUT_FOCUS ( \
+    meta_wayland_gtk_text_input_focus_get_type ())
 
 typedef enum
 {
-  META_WAYLAND_PENDING_STATE_NONE             = 0,
-  META_WAYLAND_PENDING_STATE_INPUT_RECT       = 1 << 0,
-  META_WAYLAND_PENDING_STATE_CONTENT_TYPE     = 1 << 1,
+  META_WAYLAND_PENDING_STATE_NONE = 0,
+  META_WAYLAND_PENDING_STATE_INPUT_RECT = 1 << 0,
+  META_WAYLAND_PENDING_STATE_CONTENT_TYPE = 1 << 1,
   META_WAYLAND_PENDING_STATE_SURROUNDING_TEXT = 1 << 2,
 } MetaWaylandTextInputPendingState;
 
@@ -87,8 +88,8 @@ meta_wayland_text_input_focus_request_surrounding (ClutterInputFocus *focus)
 
   text_input = META_WAYLAND_GTK_TEXT_INPUT_FOCUS (focus)->text_input;
   clutter_input_focus_set_surrounding (focus,
-                                      text_input->surrounding.text,
-                                      text_input->surrounding.cursor,
+                                       text_input->surrounding.text,
+                                       text_input->surrounding.cursor,
                                        text_input->surrounding.anchor);
 }
 
@@ -103,9 +104,9 @@ meta_wayland_text_input_focus_delete_surrounding (ClutterInputFocus *focus,
   text_input = META_WAYLAND_GTK_TEXT_INPUT_FOCUS (focus)->text_input;
 
   wl_resource_for_each (resource, &text_input->focus_resource_list)
-    {
-      gtk_text_input_send_delete_surrounding_text (resource, cursor, len);
-    }
+  {
+    gtk_text_input_send_delete_surrounding_text (resource, cursor, len);
+  }
 }
 
 static void
@@ -118,10 +119,10 @@ meta_wayland_text_input_focus_commit_text (ClutterInputFocus *focus,
   text_input = META_WAYLAND_GTK_TEXT_INPUT_FOCUS (focus)->text_input;
 
   wl_resource_for_each (resource, &text_input->focus_resource_list)
-    {
-      gtk_text_input_send_preedit_string (resource, NULL, 0);
-      gtk_text_input_send_commit_string (resource, text);
-    }
+  {
+    gtk_text_input_send_preedit_string (resource, NULL, 0);
+    gtk_text_input_send_commit_string (resource, text);
+  }
 }
 
 static void
@@ -135,20 +136,24 @@ meta_wayland_text_input_focus_set_preedit_text (ClutterInputFocus *focus,
   text_input = META_WAYLAND_GTK_TEXT_INPUT_FOCUS (focus)->text_input;
 
   wl_resource_for_each (resource, &text_input->focus_resource_list)
-    {
-      gtk_text_input_send_preedit_string (resource, text, cursor);
-    }
+  {
+    gtk_text_input_send_preedit_string (resource, text, cursor);
+  }
 }
 
 static void
-meta_wayland_gtk_text_input_focus_class_init (MetaWaylandGtkTextInputFocusClass *klass)
+meta_wayland_gtk_text_input_focus_class_init (
+  MetaWaylandGtkTextInputFocusClass *klass)
 {
   ClutterInputFocusClass *focus_class = CLUTTER_INPUT_FOCUS_CLASS (klass);
 
-  focus_class->request_surrounding = meta_wayland_text_input_focus_request_surrounding;
-  focus_class->delete_surrounding = meta_wayland_text_input_focus_delete_surrounding;
+  focus_class->request_surrounding =
+    meta_wayland_text_input_focus_request_surrounding;
+  focus_class->delete_surrounding =
+    meta_wayland_text_input_focus_delete_surrounding;
   focus_class->commit_text = meta_wayland_text_input_focus_commit_text;
-  focus_class->set_preedit_text = meta_wayland_text_input_focus_set_preedit_text;
+  focus_class->set_preedit_text =
+    meta_wayland_text_input_focus_set_preedit_text;
 }
 
 static void
@@ -169,7 +174,7 @@ meta_wayland_text_input_focus_new (MetaWaylandGtkTextInput *text_input)
 
 static void
 text_input_handle_focus_surface_destroy (struct wl_listener *listener,
-                                        void               *data)
+                                         void               *data)
 {
   MetaWaylandGtkTextInput *text_input = wl_container_of (listener, text_input,
                                                          surface_listener);
@@ -185,19 +190,19 @@ move_resources (struct wl_list *destination, struct wl_list *source)
 }
 
 static void
-move_resources_for_client (struct wl_list *destination,
-                          struct wl_list *source,
-                          struct wl_client *client)
+move_resources_for_client (struct wl_list   *destination,
+                           struct wl_list   *source,
+                           struct wl_client *client)
 {
   struct wl_resource *resource, *tmp;
   wl_resource_for_each_safe (resource, tmp, source)
-    {
-      if (wl_resource_get_client (resource) == client)
-        {
-          wl_list_remove (wl_resource_get_link (resource));
-          wl_list_insert (destination, wl_resource_get_link (resource));
-        }
-    }
+  {
+    if (wl_resource_get_client (resource) == client)
+      {
+        wl_list_remove (wl_resource_get_link (resource));
+        wl_list_insert (destination, wl_resource_get_link (resource));
+      }
+  }
 }
 
 void
@@ -220,17 +225,18 @@ meta_wayland_gtk_text_input_set_focus (MetaWaylandGtkTextInput *text_input,
 
           if (clutter_input_focus_is_focused (focus))
             {
-              input_method = clutter_backend_get_input_method (clutter_get_default_backend ());
+              input_method = clutter_backend_get_input_method (
+                clutter_get_default_backend ());
               clutter_input_method_focus_out (input_method);
             }
 
           serial = wl_display_next_serial (text_input->seat->wl_display);
 
           wl_resource_for_each (resource, &text_input->focus_resource_list)
-            {
-              gtk_text_input_send_leave (resource, serial,
-                                         text_input->surface->resource);
-            }
+          {
+            gtk_text_input_send_leave (resource, serial,
+                                       text_input->surface->resource);
+          }
 
           move_resources (&text_input->resource_list,
                           &text_input->focus_resource_list);
@@ -261,10 +267,10 @@ meta_wayland_gtk_text_input_set_focus (MetaWaylandGtkTextInput *text_input,
             wl_display_next_serial (text_input->seat->wl_display);
 
           wl_resource_for_each (resource, &text_input->focus_resource_list)
-            {
-              gtk_text_input_send_enter (resource, text_input->focus_serial,
-                                         surface->resource);
-            }
+          {
+            gtk_text_input_send_enter (resource, text_input->focus_serial,
+                                       surface->resource);
+          }
         }
     }
 }
@@ -298,7 +304,8 @@ text_input_enable (struct wl_client   *client,
 
   if (!clutter_input_focus_is_focused (focus))
     {
-      input_method = clutter_backend_get_input_method (clutter_get_default_backend ());
+      input_method = clutter_backend_get_input_method (
+        clutter_get_default_backend ());
       if (input_method)
         clutter_input_method_focus_in (input_method, focus);
       else
@@ -326,7 +333,8 @@ text_input_disable (struct wl_client   *client,
   clutter_input_focus_reset (text_input->input_focus);
   text_input->pending_state = META_WAYLAND_PENDING_STATE_NONE;
 
-  input_method = clutter_backend_get_input_method (clutter_get_default_backend ());
+  input_method = clutter_backend_get_input_method (
+    clutter_get_default_backend ());
   clutter_input_method_focus_out (input_method);
 }
 
@@ -441,7 +449,9 @@ text_input_set_cursor_rectangle (struct wl_client   *client,
   if (!text_input->surface)
     return;
 
-  text_input->cursor_rect = (cairo_rectangle_int_t) { x, y, width, height };
+  text_input->cursor_rect = (cairo_rectangle_int_t) {
+    x, y, width, height
+  };
   text_input->pending_state |= META_WAYLAND_PENDING_STATE_INPUT_RECT;
 }
 
@@ -460,9 +470,11 @@ text_input_commit_state (struct wl_client   *client,
   if (text_input->pending_state & META_WAYLAND_PENDING_STATE_CONTENT_TYPE)
     {
       clutter_input_focus_set_content_hints (text_input->input_focus,
-                                             translate_hints (text_input->content_type_hint));
+                                             translate_hints (text_input->
+                                                              content_type_hint));
       clutter_input_focus_set_content_purpose (text_input->input_focus,
-                                               translate_purpose (text_input->content_type_purpose));
+                                               translate_purpose (text_input->
+                                                                  content_type_purpose));
     }
 
   if (text_input->pending_state & META_WAYLAND_PENDING_STATE_SURROUNDING_TEXT)
@@ -495,7 +507,8 @@ text_input_commit_state (struct wl_client   *client,
   text_input->pending_state = META_WAYLAND_PENDING_STATE_NONE;
 }
 
-static struct gtk_text_input_interface meta_text_input_interface = {
+static struct gtk_text_input_interface meta_text_input_interface =
+{
   text_input_destroy,
   text_input_enable,
   text_input_disable,
@@ -530,10 +543,11 @@ meta_wayland_gtk_text_input_destroy (MetaWaylandGtkTextInput *text_input)
 }
 
 static void
-meta_wayland_text_input_create_new_resource (MetaWaylandGtkTextInput *text_input,
-                                             struct wl_client        *client,
-                                             struct wl_resource      *seat_resource,
-                                             uint32_t                 id)
+meta_wayland_text_input_create_new_resource (
+  MetaWaylandGtkTextInput *text_input,
+  struct wl_client        *client,
+  struct wl_resource      *seat_resource,
+  uint32_t                 id)
 {
   struct wl_resource *text_input_resource;
 
@@ -582,22 +596,24 @@ text_input_manager_get_text_input (struct wl_client   *client,
                                                seat_resource, id);
 }
 
-static struct gtk_text_input_manager_interface meta_text_input_manager_interface = {
+static struct gtk_text_input_manager_interface meta_text_input_manager_interface
+  =
+  {
   text_input_manager_destroy,
   text_input_manager_get_text_input,
-};
+  };
 
 static void
 bind_text_input (struct wl_client *client,
-                void             *data,
-                uint32_t          version,
-                uint32_t          id)
+                 void             *data,
+                 uint32_t          version,
+                 uint32_t          id)
 {
   struct wl_resource *resource;
 
   resource = wl_resource_create (client,
                                  &gtk_text_input_manager_interface,
-                                META_GTK_TEXT_INPUT_VERSION,
+                                 META_GTK_TEXT_INPUT_VERSION,
                                  id);
   wl_resource_set_implementation (resource,
                                   &meta_text_input_manager_interface,
diff --git a/src/wayland/meta-wayland-text-input.c b/src/wayland/meta-wayland-text-input.c
index 7de9b91e2..167204204 100644
--- a/src/wayland/meta-wayland-text-input.c
+++ b/src/wayland/meta-wayland-text-input.c
@@ -31,16 +31,17 @@
 
 #include "text-input-unstable-v3-server-protocol.h"
 
-#define META_TYPE_WAYLAND_TEXT_INPUT_FOCUS (meta_wayland_text_input_focus_get_type ())
+#define META_TYPE_WAYLAND_TEXT_INPUT_FOCUS ( \
+    meta_wayland_text_input_focus_get_type ())
 
 typedef enum
 {
-  META_WAYLAND_PENDING_STATE_NONE             = 0,
-  META_WAYLAND_PENDING_STATE_INPUT_RECT       = 1 << 0,
-  META_WAYLAND_PENDING_STATE_CONTENT_TYPE     = 1 << 1,
+  META_WAYLAND_PENDING_STATE_NONE = 0,
+  META_WAYLAND_PENDING_STATE_INPUT_RECT = 1 << 0,
+  META_WAYLAND_PENDING_STATE_CONTENT_TYPE = 1 << 1,
   META_WAYLAND_PENDING_STATE_SURROUNDING_TEXT = 1 << 2,
-  META_WAYLAND_PENDING_STATE_CHANGE_CAUSE     = 1 << 3,
-  META_WAYLAND_PENDING_STATE_ENABLED          = 1 << 4,
+  META_WAYLAND_PENDING_STATE_CHANGE_CAUSE = 1 << 3,
+  META_WAYLAND_PENDING_STATE_ENABLED = 1 << 4,
 } MetaWaylandTextInputPendingState;
 
 typedef struct _MetaWaylandTextInput MetaWaylandTextInput;
@@ -92,8 +93,8 @@ meta_wayland_text_input_focus_request_surrounding (ClutterInputFocus *focus)
 
   text_input = META_WAYLAND_TEXT_INPUT_FOCUS (focus)->text_input;
   clutter_input_focus_set_surrounding (focus,
-                                      text_input->surrounding.text,
-                                      text_input->surrounding.cursor,
+                                       text_input->surrounding.text,
+                                       text_input->surrounding.cursor,
                                        text_input->surrounding.anchor);
 }
 
@@ -127,11 +128,11 @@ meta_wayland_text_input_focus_delete_surrounding (ClutterInputFocus *focus,
   text_input = META_WAYLAND_TEXT_INPUT_FOCUS (focus)->text_input;
 
   wl_resource_for_each (resource, &text_input->focus_resource_list)
-    {
-      zwp_text_input_v3_send_delete_surrounding_text (resource, cursor, len);
-      zwp_text_input_v3_send_done (resource,
-                                   lookup_serial (text_input, resource));
-    }
+  {
+    zwp_text_input_v3_send_delete_surrounding_text (resource, cursor, len);
+    zwp_text_input_v3_send_done (resource,
+                                 lookup_serial (text_input, resource));
+  }
 }
 
 static void
@@ -144,12 +145,12 @@ meta_wayland_text_input_focus_commit_text (ClutterInputFocus *focus,
   text_input = META_WAYLAND_TEXT_INPUT_FOCUS (focus)->text_input;
 
   wl_resource_for_each (resource, &text_input->focus_resource_list)
-    {
-      zwp_text_input_v3_send_preedit_string (resource, NULL, 0, 0);
-      zwp_text_input_v3_send_commit_string (resource, text);
-      zwp_text_input_v3_send_done (resource,
-                                   lookup_serial (text_input, resource));
-    }
+  {
+    zwp_text_input_v3_send_preedit_string (resource, NULL, 0, 0);
+    zwp_text_input_v3_send_commit_string (resource, text);
+    zwp_text_input_v3_send_done (resource,
+                                 lookup_serial (text_input, resource));
+  }
 }
 
 static void
@@ -163,11 +164,11 @@ meta_wayland_text_input_focus_set_preedit_text (ClutterInputFocus *focus,
   text_input = META_WAYLAND_TEXT_INPUT_FOCUS (focus)->text_input;
 
   wl_resource_for_each (resource, &text_input->focus_resource_list)
-    {
-      zwp_text_input_v3_send_preedit_string (resource, text, cursor, cursor);
-      zwp_text_input_v3_send_done (resource,
-                                   lookup_serial (text_input, resource));
-    }
+  {
+    zwp_text_input_v3_send_preedit_string (resource, text, cursor, cursor);
+    zwp_text_input_v3_send_done (resource,
+                                 lookup_serial (text_input, resource));
+  }
 }
 
 static void
@@ -175,10 +176,13 @@ meta_wayland_text_input_focus_class_init (MetaWaylandTextInputFocusClass *klass)
 {
   ClutterInputFocusClass *focus_class = CLUTTER_INPUT_FOCUS_CLASS (klass);
 
-  focus_class->request_surrounding = meta_wayland_text_input_focus_request_surrounding;
-  focus_class->delete_surrounding = meta_wayland_text_input_focus_delete_surrounding;
+  focus_class->request_surrounding =
+    meta_wayland_text_input_focus_request_surrounding;
+  focus_class->delete_surrounding =
+    meta_wayland_text_input_focus_delete_surrounding;
   focus_class->commit_text = meta_wayland_text_input_focus_commit_text;
-  focus_class->set_preedit_text = meta_wayland_text_input_focus_set_preedit_text;
+  focus_class->set_preedit_text =
+    meta_wayland_text_input_focus_set_preedit_text;
 }
 
 static void
@@ -199,10 +203,10 @@ meta_wayland_text_input_focus_new (MetaWaylandTextInput *text_input)
 
 static void
 text_input_handle_focus_surface_destroy (struct wl_listener *listener,
-                                        void               *data)
+                                         void               *data)
 {
   MetaWaylandTextInput *text_input = wl_container_of (listener, text_input,
-                                                     surface_listener);
+                                                      surface_listener);
 
   meta_wayland_text_input_set_focus (text_input, NULL);
 }
@@ -215,24 +219,24 @@ move_resources (struct wl_list *destination, struct wl_list *source)
 }
 
 static void
-move_resources_for_client (struct wl_list *destination,
-                          struct wl_list *source,
-                          struct wl_client *client)
+move_resources_for_client (struct wl_list   *destination,
+                           struct wl_list   *source,
+                           struct wl_client *client)
 {
   struct wl_resource *resource, *tmp;
   wl_resource_for_each_safe (resource, tmp, source)
-    {
-      if (wl_resource_get_client (resource) == client)
-        {
-          wl_list_remove (wl_resource_get_link (resource));
-          wl_list_insert (destination, wl_resource_get_link (resource));
-        }
-    }
+  {
+    if (wl_resource_get_client (resource) == client)
+      {
+        wl_list_remove (wl_resource_get_link (resource));
+        wl_list_insert (destination, wl_resource_get_link (resource));
+      }
+  }
 }
 
 void
 meta_wayland_text_input_set_focus (MetaWaylandTextInput *text_input,
-                                  MetaWaylandSurface   *surface)
+                                   MetaWaylandSurface   *surface)
 {
   if (text_input->surface == surface)
     return;
@@ -249,15 +253,16 @@ meta_wayland_text_input_set_focus (MetaWaylandTextInput *text_input,
 
           if (clutter_input_focus_is_focused (focus))
             {
-              input_method = clutter_backend_get_input_method (clutter_get_default_backend ());
+              input_method = clutter_backend_get_input_method (
+                clutter_get_default_backend ());
               clutter_input_method_focus_out (input_method);
             }
 
           wl_resource_for_each (resource, &text_input->focus_resource_list)
-            {
-              zwp_text_input_v3_send_leave (resource,
-                                            text_input->surface->resource);
-            }
+          {
+            zwp_text_input_v3_send_leave (resource,
+                                          text_input->surface->resource);
+          }
 
           move_resources (&text_input->resource_list,
                           &text_input->focus_resource_list);
@@ -285,9 +290,9 @@ meta_wayland_text_input_set_focus (MetaWaylandTextInput *text_input,
           struct wl_resource *resource;
 
           wl_resource_for_each (resource, &text_input->focus_resource_list)
-            {
-              zwp_text_input_v3_send_enter (resource, surface->resource);
-            }
+          {
+            zwp_text_input_v3_send_enter (resource, surface->resource);
+          }
         }
     }
 }
@@ -346,8 +351,8 @@ text_input_set_surrounding_text (struct wl_client   *client,
 
 static void
 text_input_set_text_change_cause (struct wl_client   *client,
-                                 struct wl_resource *resource,
-                                 uint32_t            cause)
+                                  struct wl_resource *resource,
+                                  uint32_t            cause)
 {
   MetaWaylandTextInput *text_input = wl_resource_get_user_data (resource);
 
@@ -450,7 +455,9 @@ text_input_set_cursor_rectangle (struct wl_client   *client,
   if (!text_input->surface)
     return;
 
-  text_input->cursor_rect = (cairo_rectangle_int_t) { x, y, width, height };
+  text_input->cursor_rect = (cairo_rectangle_int_t) {
+    x, y, width, height
+  };
   text_input->pending_state |= META_WAYLAND_PENDING_STATE_INPUT_RECT;
 }
 
@@ -461,7 +468,9 @@ meta_wayland_text_input_reset (MetaWaylandTextInput *text_input)
   text_input->content_type_hint = ZWP_TEXT_INPUT_V3_CONTENT_HINT_NONE;
   text_input->content_type_purpose = ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NORMAL;
   text_input->text_change_cause = ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_INPUT_METHOD;
-  text_input->cursor_rect = (cairo_rectangle_int_t) { 0, 0, 0, 0 };
+  text_input->cursor_rect = (cairo_rectangle_int_t) {
+    0, 0, 0, 0
+  };
 }
 
 static void
@@ -481,7 +490,8 @@ text_input_commit_state (struct wl_client   *client,
     {
       ClutterInputMethod *input_method;
 
-      input_method = clutter_backend_get_input_method (clutter_get_default_backend ());
+      input_method = clutter_backend_get_input_method (
+        clutter_get_default_backend ());
 
       if (text_input->enabled)
         {
@@ -512,9 +522,11 @@ text_input_commit_state (struct wl_client   *client,
   if (text_input->pending_state & META_WAYLAND_PENDING_STATE_CONTENT_TYPE)
     {
       clutter_input_focus_set_content_hints (text_input->input_focus,
-                                             translate_hints (text_input->content_type_hint));
+                                             translate_hints (text_input->
+                                                              content_type_hint));
       clutter_input_focus_set_content_purpose (text_input->input_focus,
-                                               translate_purpose (text_input->content_type_purpose));
+                                               translate_purpose (text_input->
+                                                                  content_type_purpose));
     }
 
   if (text_input->pending_state & META_WAYLAND_PENDING_STATE_SURROUNDING_TEXT)
@@ -550,7 +562,8 @@ text_input_commit_state (struct wl_client   *client,
     clutter_input_focus_request_toggle_input_panel (focus);
 }
 
-static struct zwp_text_input_v3_interface meta_text_input_interface = {
+static struct zwp_text_input_v3_interface meta_text_input_interface =
+{
   text_input_destroy,
   text_input_enable,
   text_input_disable,
@@ -640,16 +653,18 @@ text_input_manager_get_text_input (struct wl_client   *client,
                                                seat_resource, id);
 }
 
-static struct zwp_text_input_manager_v3_interface meta_text_input_manager_interface = {
+static struct zwp_text_input_manager_v3_interface
+  meta_text_input_manager_interface =
+{
   text_input_manager_destroy,
   text_input_manager_get_text_input,
 };
 
 static void
 bind_text_input (struct wl_client *client,
-                void             *data,
-                uint32_t          version,
-                uint32_t          id)
+                 void             *data,
+                 uint32_t          version,
+                 uint32_t          id)
 {
   struct wl_resource *resource;
 
diff --git a/src/wayland/meta-wayland-touch.c b/src/wayland/meta-wayland-touch.c
index 01ed9b015..82f785f05 100644
--- a/src/wayland/meta-wayland-touch.c
+++ b/src/wayland/meta-wayland-touch.c
@@ -69,18 +69,18 @@ move_resources (struct wl_list *destination, struct wl_list *source)
 
 static void
 move_resources_for_client (struct wl_list   *destination,
-                          struct wl_list   *source,
-                          struct wl_client *client)
+                           struct wl_list   *source,
+                           struct wl_client *client)
 {
   struct wl_resource *resource, *tmp;
   wl_resource_for_each_safe (resource, tmp, source)
-    {
-      if (wl_resource_get_client (resource) == client)
-        {
-          wl_list_remove (wl_resource_get_link (resource));
-          wl_list_insert (destination, wl_resource_get_link (resource));
-        }
-    }
+  {
+    if (wl_resource_get_client (resource) == client)
+      {
+        wl_list_remove (wl_resource_get_link (resource));
+        wl_list_insert (destination, wl_resource_get_link (resource));
+      }
+  }
 }
 
 static void
@@ -122,7 +122,9 @@ touch_surface_decrement_touch (MetaWaylandTouchSurface *touch_surface)
 static void
 touch_handle_surface_destroy (struct wl_listener *listener, void *data)
 {
-  MetaWaylandTouchSurface *touch_surface = wl_container_of (listener, touch_surface, 
surface_destroy_listener);
+  MetaWaylandTouchSurface *touch_surface = wl_container_of (listener,
+                                                            touch_surface,
+                                                            surface_destroy_listener);
   MetaWaylandSurface *surface = touch_surface->surface;
   MetaWaylandTouch *touch = touch_surface->touch;
   MetaWaylandTouchInfo *touch_info;
@@ -134,7 +136,7 @@ touch_handle_surface_destroy (struct wl_listener *listener, void *data)
    * on the touch_surface to 0, also freeing touch_surface and removing
    * from the touch_surfaces hashtable.
    */
-  while (g_hash_table_iter_next (&iter, NULL, (gpointer*) &touch_info))
+  while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &touch_info))
     {
       if (touch_info->touch_surface == touch_surface)
         g_hash_table_iter_remove (&iter);
@@ -167,7 +169,8 @@ touch_surface_get (MetaWaylandTouch   *touch,
   wl_list_init (&touch_surface->resource_list);
   move_resources_for_client (&touch_surface->resource_list,
                              &touch->resource_list,
-                             wl_resource_get_client (touch_surface->surface->resource));
+                             wl_resource_get_client (touch_surface->surface->
+                                                     resource));
 
   g_hash_table_insert (touch->touch_surfaces, surface, touch_surface);
 
@@ -228,14 +231,16 @@ meta_wayland_touch_update (MetaWaylandTouch   *touch,
       actor = clutter_event_get_source (event);
 
       if (META_IS_SURFACE_ACTOR_WAYLAND (actor))
-        surface = meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (actor));
+        surface = meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (
+                                                            actor));
 
       if (!surface)
         return;
 
       touch_info = touch_get_info (touch, sequence, TRUE);
       touch_info->touch_surface = touch_surface_get (touch, surface);
-      clutter_event_get_coords (event, &touch_info->start_x, &touch_info->start_y);
+      clutter_event_get_coords (event, &touch_info->start_x,
+                                &touch_info->start_y);
     }
   else
     touch_info = touch_get_info (touch, sequence, FALSE);
@@ -275,15 +280,15 @@ handle_touch_begin (MetaWaylandTouch   *touch,
     return;
 
   l = &touch_info->touch_surface->resource_list;
-  wl_resource_for_each(resource, l)
-    {
-      wl_touch_send_down (resource, touch_info->slot_serial,
-                          clutter_event_get_time (event),
-                          touch_info->touch_surface->surface->resource,
-                          touch_info->slot,
-                          wl_fixed_from_double (touch_info->x),
-                          wl_fixed_from_double (touch_info->y));
-    }
+  wl_resource_for_each (resource, l)
+  {
+    wl_touch_send_down (resource, touch_info->slot_serial,
+                        clutter_event_get_time (event),
+                        touch_info->touch_surface->surface->resource,
+                        touch_info->slot,
+                        wl_fixed_from_double (touch_info->x),
+                        wl_fixed_from_double (touch_info->y));
+  }
 
   touch_info->begin_delivered = TRUE;
 #endif /* HAVE_NATIVE_BACKEND */
@@ -306,14 +311,14 @@ handle_touch_update (MetaWaylandTouch   *touch,
     return;
 
   l = &touch_info->touch_surface->resource_list;
-  wl_resource_for_each(resource, l)
-    {
-      wl_touch_send_motion (resource,
-                            clutter_event_get_time (event),
-                            touch_info->slot,
-                            wl_fixed_from_double (touch_info->x),
-                            wl_fixed_from_double (touch_info->y));
-    }
+  wl_resource_for_each (resource, l)
+  {
+    wl_touch_send_motion (resource,
+                          clutter_event_get_time (event),
+                          touch_info->slot,
+                          wl_fixed_from_double (touch_info->x),
+                          wl_fixed_from_double (touch_info->y));
+  }
 #endif /* HAVE_NATIVE_BACKEND */
 }
 
@@ -336,12 +341,12 @@ handle_touch_end (MetaWaylandTouch   *touch,
   if (touch_info->begin_delivered)
     {
       l = &touch_info->touch_surface->resource_list;
-      wl_resource_for_each(resource, l)
-        {
-          wl_touch_send_up (resource, touch_info->slot_serial,
-                            clutter_event_get_time (event),
-                            touch_info->slot);
-        }
+      wl_resource_for_each (resource, l)
+      {
+        wl_touch_send_up (resource, touch_info->slot_serial,
+                          clutter_event_get_time (event),
+                          touch_info->slot);
+      }
     }
 
   g_hash_table_remove (touch->touches, sequence);
@@ -358,7 +363,7 @@ touch_get_surfaces (MetaWaylandTouch *touch,
 
   g_hash_table_iter_init (&iter, touch->touches);
 
-  while (g_hash_table_iter_next (&iter, NULL, (gpointer*) &touch_info))
+  while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &touch_info))
     {
       if (only_updated && !touch_info->updated)
         continue;
@@ -386,10 +391,10 @@ touch_send_frame_event (MetaWaylandTouch *touch)
       struct wl_list *l;
 
       l = &touch_surface->resource_list;
-      wl_resource_for_each(resource, l)
-        {
-          wl_touch_send_frame (resource);
-        }
+      wl_resource_for_each (resource, l)
+      {
+        wl_touch_send_frame (resource);
+      }
     }
 
   g_list_free (surfaces);
@@ -418,9 +423,9 @@ check_send_frame_event (MetaWaylandTouch   *touch,
     }
   else
 #endif /* HAVE_NATIVE_BACKEND */
-    {
-      send_frame_event = TRUE;
-    }
+  {
+    send_frame_event = TRUE;
+  }
 
   if (send_frame_event)
     touch_send_frame_event (touch);
@@ -465,7 +470,8 @@ touch_release (struct wl_client   *client,
   wl_resource_destroy (resource);
 }
 
-static const struct wl_touch_interface touch_interface = {
+static const struct wl_touch_interface touch_interface =
+{
   touch_release,
 };
 
@@ -497,8 +503,8 @@ meta_wayland_touch_cancel (MetaWaylandTouch *touch)
       struct wl_list *l;
 
       l = &touch_surface->resource_list;
-      wl_resource_for_each(resource, l)
-        wl_touch_send_cancel (resource);
+      wl_resource_for_each (resource, l)
+      wl_touch_send_cancel (resource);
     }
 
   g_hash_table_remove_all (touch->touches);
@@ -516,7 +522,8 @@ evdev_filter_func (struct libinput_event *event,
     {
     case LIBINPUT_EVENT_TOUCH_DOWN:
     case LIBINPUT_EVENT_TOUCH_UP:
-    case LIBINPUT_EVENT_TOUCH_MOTION: {
+    case LIBINPUT_EVENT_TOUCH_MOTION:
+    {
       struct libinput_event_touch *touch_event;
       int32_t slot;
 
@@ -559,7 +566,8 @@ meta_wayland_touch_enable (MetaWaylandTouch *touch)
   wl_list_init (&touch->resource_list);
 
   manager = clutter_device_manager_get_default ();
-  touch->device = clutter_device_manager_get_core_device (manager, CLUTTER_TOUCHSCREEN_DEVICE);
+  touch->device = clutter_device_manager_get_core_device (manager,
+                                                          CLUTTER_TOUCHSCREEN_DEVICE);
 
 #ifdef HAVE_NATIVE_BACKEND
   MetaBackend *backend = meta_get_backend ();
@@ -599,7 +607,8 @@ meta_wayland_touch_create_new_resource (MetaWaylandTouch   *touch,
       return;
     }
 
-  cr = wl_resource_create (client, &wl_touch_interface, wl_resource_get_version (seat_resource), id);
+  cr = wl_resource_create (client, &wl_touch_interface, wl_resource_get_version (
+                             seat_resource), id);
   wl_resource_set_implementation (cr, &touch_interface, touch, unbind_resource);
   wl_list_insert (&touch->resource_list, wl_resource_get_link (cr));
 }
@@ -616,7 +625,7 @@ meta_wayland_touch_can_popup (MetaWaylandTouch *touch,
 
   g_hash_table_iter_init (&iter, touch->touches);
 
-  while (g_hash_table_iter_next (&iter, NULL, (gpointer*) &touch_info))
+  while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &touch_info))
     {
       if (touch_info->slot_serial == serial)
         return TRUE;
@@ -638,11 +647,11 @@ meta_wayland_touch_find_grab_sequence (MetaWaylandTouch   *touch,
 
   g_hash_table_iter_init (&iter, touch->touches);
 
-  while (g_hash_table_iter_next (&iter, (gpointer*) &sequence,
-                                 (gpointer*) &touch_info))
+  while (g_hash_table_iter_next (&iter, (gpointer *) &sequence,
+                                 (gpointer *) &touch_info))
     {
       if (touch_info->slot_serial == serial &&
-         touch_info->touch_surface->surface == surface)
+          touch_info->touch_surface->surface == surface)
         return sequence;
     }
 
diff --git a/src/wayland/meta-wayland-wl-shell.c b/src/wayland/meta-wayland-wl-shell.c
index 539fb9858..c8188eca5 100644
--- a/src/wayland/meta-wayland-wl-shell.c
+++ b/src/wayland/meta-wayland-wl-shell.c
@@ -147,7 +147,7 @@ wl_shell_surface_destructor (struct wl_resource *resource)
 static void
 wl_shell_surface_pong (struct wl_client   *client,
                        struct wl_resource *resource,
-                       uint32_t serial)
+                       uint32_t            serial)
 {
   MetaDisplay *display = meta_get_display ();
 
@@ -158,7 +158,7 @@ static void
 wl_shell_surface_move (struct wl_client   *client,
                        struct wl_resource *resource,
                        struct wl_resource *seat_resource,
-                       uint32_t serial)
+                       uint32_t            serial)
 {
   MetaWaylandSeat *seat = wl_resource_get_user_data (seat_resource);
   MetaWaylandSurface *surface =
@@ -246,7 +246,7 @@ wl_shell_surface_set_state (MetaWaylandSurface     *surface,
 }
 
 static void
-wl_shell_surface_set_toplevel (struct wl_client *client,
+wl_shell_surface_set_toplevel (struct wl_client   *client,
                                struct wl_resource *resource)
 {
   MetaWaylandSurface *surface =
@@ -318,7 +318,8 @@ wl_shell_surface_set_fullscreen (struct wl_client   *client,
 }
 
 static void
-meta_wayland_wl_shell_surface_create_popup (MetaWaylandWlShellSurface *wl_shell_surface)
+meta_wayland_wl_shell_surface_create_popup (
+  MetaWaylandWlShellSurface *wl_shell_surface)
 {
   MetaWaylandPopupSurface *popup_surface =
     META_WAYLAND_POPUP_SURFACE (wl_shell_surface);
@@ -412,9 +413,9 @@ wl_shell_surface_set_title (struct wl_client   *client,
 }
 
 static void
-wl_shell_surface_set_class (struct wl_client *client,
+wl_shell_surface_set_class (struct wl_client   *client,
                             struct wl_resource *resource,
-                            const char *class_)
+                            const char         *class_)
 {
   MetaWaylandWlShellSurface *wl_shell_surface =
     META_WAYLAND_WL_SHELL_SURFACE (wl_resource_get_user_data (resource));
@@ -432,7 +433,9 @@ wl_shell_surface_set_class (struct wl_client *client,
     meta_window_set_wm_class (surface->window, class_, class_);
 }
 
-static const struct wl_shell_surface_interface meta_wayland_wl_shell_surface_interface = {
+static const struct wl_shell_surface_interface
+  meta_wayland_wl_shell_surface_interface =
+{
   wl_shell_surface_pong,
   wl_shell_surface_move,
   wl_shell_surface_resize,
@@ -545,7 +548,8 @@ wl_shell_get_shell_surface (struct wl_client   *client,
   create_wl_shell_surface_window (surface);
 }
 
-static const struct wl_shell_interface meta_wayland_wl_shell_interface = {
+static const struct wl_shell_interface meta_wayland_wl_shell_interface =
+{
   wl_shell_get_shell_surface,
 };
 
@@ -558,7 +562,8 @@ bind_wl_shell (struct wl_client *client,
   struct wl_resource *resource;
 
   resource = wl_resource_create (client, &wl_shell_interface, version, id);
-  wl_resource_set_implementation (resource, &meta_wayland_wl_shell_interface, data, NULL);
+  wl_resource_set_implementation (resource, &meta_wayland_wl_shell_interface,
+                                  data, NULL);
 }
 
 static void
@@ -676,7 +681,8 @@ meta_wayland_wl_shell_surface_popup_done (MetaWaylandPopupSurface *popup_surface
 }
 
 static void
-meta_wayland_wl_shell_surface_popup_dismiss (MetaWaylandPopupSurface *popup_surface)
+meta_wayland_wl_shell_surface_popup_dismiss (
+  MetaWaylandPopupSurface *popup_surface)
 {
   MetaWaylandWlShellSurface *wl_shell_surface =
     META_WAYLAND_WL_SHELL_SURFACE (popup_surface);
@@ -691,7 +697,8 @@ meta_wayland_wl_shell_surface_popup_dismiss (MetaWaylandPopupSurface *popup_surf
 }
 
 static MetaWaylandSurface *
-meta_wayland_wl_shell_surface_popup_get_surface (MetaWaylandPopupSurface *popup_surface)
+meta_wayland_wl_shell_surface_popup_get_surface (
+  MetaWaylandPopupSurface *popup_surface)
 {
   MetaWaylandSurfaceRole *surface_role =
     META_WAYLAND_SURFACE_ROLE (popup_surface);
diff --git a/src/wayland/meta-wayland-xdg-foreign.c b/src/wayland/meta-wayland-xdg-foreign.c
index 49ada7ada..7cf772515 100644
--- a/src/wayland/meta-wayland-xdg-foreign.c
+++ b/src/wayland/meta-wayland-xdg-foreign.c
@@ -89,7 +89,8 @@ xdg_exported_destroy (struct wl_client   *client,
   wl_resource_destroy (resource);
 }
 
-static const struct zxdg_exported_v1_interface meta_xdg_exported_interface = {
+static const struct zxdg_exported_v1_interface meta_xdg_exported_interface =
+{
   xdg_exported_destroy,
 };
 
@@ -199,7 +200,8 @@ xdg_exporter_export (struct wl_client   *client,
   zxdg_exported_v1_send_handle (xdg_exported_resource, handle);
 }
 
-static const struct zxdg_exporter_v1_interface meta_xdg_exporter_interface = {
+static const struct zxdg_exporter_v1_interface meta_xdg_exporter_interface =
+{
   xdg_exporter_destroy,
   xdg_exporter_export,
 };
@@ -303,7 +305,8 @@ xdg_imported_set_parent_of (struct wl_client   *client,
     }
 }
 
-static const struct zxdg_imported_v1_interface meta_xdg_imported_interface = {
+static const struct zxdg_imported_v1_interface meta_xdg_imported_interface =
+{
   xdg_imported_destroy,
   xdg_imported_set_parent_of,
 };
@@ -396,7 +399,8 @@ xdg_importer_import (struct wl_client   *client,
   exported->imported = g_list_prepend (exported->imported, imported);
 }
 
-static const struct zxdg_importer_v1_interface meta_xdg_importer_interface = {
+static const struct zxdg_importer_v1_interface meta_xdg_importer_interface =
+{
   xdg_importer_destroy,
   xdg_importer_import,
 };
diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c
index 9e1d86bd5..055869e44 100644
--- a/src/wayland/meta-wayland-xdg-shell.c
+++ b/src/wayland/meta-wayland-xdg-shell.c
@@ -113,7 +113,8 @@ struct _MetaWaylandXdgPopup
 
   gboolean dismissed_by_client;
 
-  struct {
+  struct
+  {
     MetaWaylandSurface *parent_surface;
 
     /*
@@ -137,13 +138,16 @@ G_DEFINE_TYPE_WITH_CODE (MetaWaylandXdgPopup,
                                                 popup_surface_iface_init));
 
 static MetaPlacementRule
-meta_wayland_xdg_positioner_to_placement (MetaWaylandXdgPositioner *xdg_positioner);
+meta_wayland_xdg_positioner_to_placement (
+  MetaWaylandXdgPositioner *xdg_positioner);
 
 static struct wl_resource *
-meta_wayland_xdg_surface_get_wm_base_resource (MetaWaylandXdgSurface *xdg_surface);
+meta_wayland_xdg_surface_get_wm_base_resource (
+  MetaWaylandXdgSurface *xdg_surface);
 
 static MetaRectangle
-meta_wayland_xdg_surface_get_window_geometry (MetaWaylandXdgSurface *xdg_surface);
+meta_wayland_xdg_surface_get_window_geometry (
+  MetaWaylandXdgSurface *xdg_surface);
 
 static uint32_t
 meta_wayland_xdg_surface_send_configure (MetaWaylandXdgSurface *xdg_surface);
@@ -261,7 +265,8 @@ xdg_toplevel_show_window_menu (struct wl_client   *client,
   if (!window)
     return;
 
-  if (!meta_wayland_seat_get_grab_info (seat, surface, serial, FALSE, NULL, NULL))
+  if (!meta_wayland_seat_get_grab_info (seat, surface, serial, FALSE, NULL,
+                                        NULL))
     return;
 
   monitor_scale = window->monitor->scale;
@@ -465,7 +470,8 @@ xdg_toplevel_set_minimized (struct wl_client   *client,
   meta_window_minimize (window);
 }
 
-static const struct xdg_toplevel_interface meta_wayland_xdg_toplevel_interface = {
+static const struct xdg_toplevel_interface meta_wayland_xdg_toplevel_interface =
+{
   xdg_toplevel_destroy,
   xdg_toplevel_set_parent,
   xdg_toplevel_set_title,
@@ -547,7 +553,8 @@ xdg_popup_grab (struct wl_client   *client,
   xdg_popup->setup.grab_serial = serial;
 }
 
-static const struct xdg_popup_interface meta_wayland_xdg_popup_interface = {
+static const struct xdg_popup_interface meta_wayland_xdg_popup_interface =
+{
   xdg_popup_destroy,
   xdg_popup_grab,
 };
@@ -573,8 +580,8 @@ on_parent_surface_unmapped (MetaWaylandSurface  *parent_surface,
 }
 
 static void
-add_state_value (struct wl_array         *states,
-                 enum xdg_toplevel_state  state)
+add_state_value (struct wl_array        *states,
+                 enum xdg_toplevel_state state)
 {
   uint32_t *s;
 
@@ -656,7 +663,8 @@ is_new_size_hints_valid (MetaWindow              *window,
     }
   else
     {
-      meta_window_wayland_get_min_size (window, &new_min_width, &new_min_height);
+      meta_window_wayland_get_min_size (window, &new_min_width,
+                                        &new_min_height);
     }
 
   if (pending->has_new_max_size)
@@ -666,7 +674,8 @@ is_new_size_hints_valid (MetaWindow              *window,
     }
   else
     {
-      meta_window_wayland_get_max_size (window, &new_max_width, &new_max_height);
+      meta_window_wayland_get_max_size (window, &new_max_width,
+                                        &new_max_height);
     }
   /* Zero means unlimited */
   return ((new_max_width == 0 || new_min_width <= new_max_width) &&
@@ -677,7 +686,8 @@ static void
 meta_wayland_xdg_toplevel_commit (MetaWaylandSurfaceRole  *surface_role,
                                   MetaWaylandPendingState *pending)
 {
-  MetaWaylandXdgToplevel *xdg_toplevel = META_WAYLAND_XDG_TOPLEVEL (surface_role);
+  MetaWaylandXdgToplevel *xdg_toplevel =
+    META_WAYLAND_XDG_TOPLEVEL (surface_role);
   MetaWaylandXdgSurface *xdg_surface = META_WAYLAND_XDG_SURFACE (xdg_toplevel);
   MetaWaylandXdgSurfacePrivate *xdg_surface_priv =
     meta_wayland_xdg_surface_get_instance_private (xdg_surface);
@@ -722,11 +732,13 @@ meta_wayland_xdg_toplevel_commit (MetaWaylandSurfaceRole  *surface_role,
   if (!pending->newly_attached)
     return;
 
-  geometry_changed = !meta_rectangle_equal (&old_geometry, &xdg_surface_priv->geometry);
+  geometry_changed = !meta_rectangle_equal (&old_geometry,
+                                            &xdg_surface_priv->geometry);
 
   if (geometry_changed || meta_window_wayland_needs_move_resize (window))
     {
-      window_geometry = meta_wayland_xdg_surface_get_window_geometry (xdg_surface);
+      window_geometry = meta_wayland_xdg_surface_get_window_geometry (
+        xdg_surface);
       meta_window_wayland_move_resize (window,
                                        &xdg_surface_priv->acked_configure_serial,
                                        window_geometry,
@@ -760,7 +772,6 @@ meta_wayland_xdg_toplevel_commit (MetaWaylandSurfaceRole  *surface_role,
           wl_resource_post_error (surface->resource,
                                   XDG_WM_BASE_ERROR_INVALID_SURFACE_STATE,
                                   "Invalid min/max size");
-
         }
     }
 
@@ -789,7 +800,8 @@ meta_wayland_xdg_toplevel_reset (MetaWaylandXdgSurface *xdg_surface)
 
   meta_wayland_surface_destroy_window (surface);
 
-  meta_wayland_actor_surface_reset_actor (META_WAYLAND_ACTOR_SURFACE (surface_role));
+  meta_wayland_actor_surface_reset_actor (META_WAYLAND_ACTOR_SURFACE (
+                                            surface_role));
   window = meta_window_wayland_new (meta_get_display (), surface);
   meta_wayland_shell_surface_set_window (shell_surface, window);
 
@@ -837,7 +849,8 @@ meta_wayland_xdg_toplevel_close (MetaWaylandShellSurface *shell_surface)
 }
 
 static void
-meta_wayland_xdg_toplevel_shell_client_destroyed (MetaWaylandXdgSurface *xdg_surface)
+meta_wayland_xdg_toplevel_shell_client_destroyed (
+  MetaWaylandXdgSurface *xdg_surface)
 {
   MetaWaylandXdgToplevel *xdg_toplevel =
     META_WAYLAND_XDG_TOPLEVEL (xdg_surface);
@@ -1140,7 +1153,8 @@ meta_wayland_xdg_popup_managed (MetaWaylandShellSurface *shell_surface,
 }
 
 static void
-meta_wayland_xdg_popup_shell_client_destroyed (MetaWaylandXdgSurface *xdg_surface)
+meta_wayland_xdg_popup_shell_client_destroyed (
+  MetaWaylandXdgSurface *xdg_surface)
 {
   MetaWaylandXdgPopup *xdg_popup = META_WAYLAND_XDG_POPUP (xdg_surface);
   struct wl_resource *xdg_wm_base_resource =
@@ -1251,7 +1265,8 @@ meta_wayland_xdg_popup_class_init (MetaWaylandXdgPopupClass *klass)
 }
 
 static struct wl_resource *
-meta_wayland_xdg_surface_get_wm_base_resource (MetaWaylandXdgSurface *xdg_surface)
+meta_wayland_xdg_surface_get_wm_base_resource (
+  MetaWaylandXdgSurface *xdg_surface)
 {
   MetaWaylandXdgSurfacePrivate *priv =
     meta_wayland_xdg_surface_get_instance_private (xdg_surface);
@@ -1382,7 +1397,8 @@ xdg_surface_ack_configure (struct wl_client   *client,
   priv->acked_configure_serial.value = serial;
 }
 
-static const struct xdg_surface_interface meta_wayland_xdg_surface_interface = {
+static const struct xdg_surface_interface meta_wayland_xdg_surface_interface =
+{
   xdg_surface_destroy,
   xdg_surface_get_toplevel,
   xdg_surface_get_popup,
@@ -1410,7 +1426,9 @@ meta_wayland_xdg_surface_real_reset (MetaWaylandXdgSurface *xdg_surface)
 
   priv->first_buffer_attached = FALSE;
   priv->configure_sent = FALSE;
-  priv->geometry = (MetaRectangle) { 0 };
+  priv->geometry = (MetaRectangle) {
+    0
+  };
   priv->has_set_geometry = FALSE;
 }
 
@@ -1509,7 +1527,8 @@ meta_wayland_xdg_surface_ping (MetaWaylandShellSurface *shell_surface,
 }
 
 static void
-meta_wayland_xdg_surface_real_shell_client_destroyed (MetaWaylandXdgSurface *xdg_surface)
+meta_wayland_xdg_surface_real_shell_client_destroyed (
+  MetaWaylandXdgSurface *xdg_surface)
 {
   MetaWaylandXdgSurfacePrivate *priv =
     meta_wayland_xdg_surface_get_instance_private (xdg_surface);
@@ -1538,11 +1557,11 @@ meta_wayland_xdg_surface_set_property (GObject      *object,
   switch (prop_id)
     {
     case XDG_SURFACE_PROP_SHELL_CLIENT:
-      priv->shell_client  = g_value_get_pointer (value);
+      priv->shell_client = g_value_get_pointer (value);
       break;
 
     case XDG_SURFACE_PROP_RESOURCE:
-      priv->resource  = g_value_get_pointer (value);
+      priv->resource = g_value_get_pointer (value);
       break;
 
     default:
@@ -1623,7 +1642,8 @@ meta_wayland_xdg_surface_class_init (MetaWaylandXdgSurfaceClass *klass)
 }
 
 static void
-meta_wayland_xdg_surface_shell_client_destroyed (MetaWaylandXdgSurface *xdg_surface)
+meta_wayland_xdg_surface_shell_client_destroyed (
+  MetaWaylandXdgSurface *xdg_surface)
 {
   MetaWaylandXdgSurfaceClass *xdg_surface_class =
     META_WAYLAND_XDG_SURFACE_GET_CLASS (xdg_surface);
@@ -1632,8 +1652,9 @@ meta_wayland_xdg_surface_shell_client_destroyed (MetaWaylandXdgSurface *xdg_surf
 }
 
 static void
-meta_wayland_xdg_surface_constructor_finalize (MetaWaylandXdgSurfaceConstructor *constructor,
-                                               MetaWaylandXdgSurface            *xdg_surface)
+meta_wayland_xdg_surface_constructor_finalize (
+  MetaWaylandXdgSurfaceConstructor *constructor,
+  MetaWaylandXdgSurface            *xdg_surface)
 {
   MetaWaylandXdgShellClient *shell_client = constructor->shell_client;
 
@@ -1677,7 +1698,8 @@ xdg_surface_constructor_get_toplevel (struct wl_client   *client,
   if (!meta_wayland_surface_assign_role (surface,
                                          META_TYPE_WAYLAND_XDG_TOPLEVEL,
                                          "shell-client", shell_client,
-                                         "xdg-surface-resource", xdg_surface_resource,
+                                         "xdg-surface-resource",
+                                         xdg_surface_resource,
                                          NULL))
     {
       wl_resource_post_error (resource, XDG_WM_BASE_ERROR_ROLE,
@@ -1689,7 +1711,8 @@ xdg_surface_constructor_get_toplevel (struct wl_client   *client,
   xdg_toplevel = META_WAYLAND_XDG_TOPLEVEL (surface->role);
   xdg_toplevel->resource = wl_resource_create (client,
                                                &xdg_toplevel_interface,
-                                               wl_resource_get_version (resource),
+                                               wl_resource_get_version (
+                                                 resource),
                                                id);
   wl_resource_set_implementation (xdg_toplevel->resource,
                                   &meta_wayland_xdg_toplevel_interface,
@@ -1715,7 +1738,8 @@ xdg_surface_constructor_get_popup (struct wl_client   *client,
     wl_resource_get_user_data (resource);
   MetaWaylandXdgShellClient *shell_client = constructor->shell_client;
   MetaWaylandSurface *surface = constructor->surface;
-  struct wl_resource *xdg_wm_base_resource = constructor->shell_client->resource;
+  struct wl_resource *xdg_wm_base_resource =
+    constructor->shell_client->resource;
   struct wl_resource *xdg_surface_resource = constructor->resource;
   MetaWaylandSurface *parent_surface =
     surface_from_xdg_surface_resource (parent_resource);
@@ -1726,7 +1750,8 @@ xdg_surface_constructor_get_popup (struct wl_client   *client,
   if (!meta_wayland_surface_assign_role (surface,
                                          META_TYPE_WAYLAND_XDG_POPUP,
                                          "shell-client", shell_client,
-                                         "xdg-surface-resource", xdg_surface_resource,
+                                         "xdg-surface-resource",
+                                         xdg_surface_resource,
                                          NULL))
     {
       wl_resource_post_error (xdg_wm_base_resource, XDG_WM_BASE_ERROR_ROLE,
@@ -1786,7 +1811,9 @@ xdg_surface_constructor_ack_configure (struct wl_client   *client,
                           "xdg_surface::ack_configure called before constructed");
 }
 
-static const struct xdg_surface_interface meta_wayland_xdg_surface_constructor_interface = {
+static const struct xdg_surface_interface
+  meta_wayland_xdg_surface_constructor_interface =
+{
   xdg_surface_constructor_destroy,
   xdg_surface_constructor_get_toplevel,
   xdg_surface_constructor_get_popup,
@@ -1864,17 +1891,20 @@ positioner_gravity_to_placement_gravity (uint32_t gravity)
 }
 
 static MetaPlacementRule
-meta_wayland_xdg_positioner_to_placement (MetaWaylandXdgPositioner *xdg_positioner)
+meta_wayland_xdg_positioner_to_placement (
+  MetaWaylandXdgPositioner *xdg_positioner)
 {
   return (MetaPlacementRule) {
-    .anchor_rect = xdg_positioner->anchor_rect,
-    .gravity = positioner_gravity_to_placement_gravity (xdg_positioner->gravity),
-    .anchor = positioner_anchor_to_placement_anchor (xdg_positioner->anchor),
-    .constraint_adjustment = xdg_positioner->constraint_adjustment,
-    .offset_x = xdg_positioner->offset_x,
-    .offset_y = xdg_positioner->offset_y,
-    .width = xdg_positioner->width,
-    .height = xdg_positioner->height,
+           .anchor_rect = xdg_positioner->anchor_rect,
+           .gravity = positioner_gravity_to_placement_gravity (
+             xdg_positioner->gravity),
+           .anchor = positioner_anchor_to_placement_anchor (
+             xdg_positioner->anchor),
+           .constraint_adjustment = xdg_positioner->constraint_adjustment,
+           .offset_x = xdg_positioner->offset_x,
+           .offset_y = xdg_positioner->offset_y,
+           .width = xdg_positioner->width,
+           .height = xdg_positioner->height,
   };
 }
 
@@ -1998,7 +2028,9 @@ xdg_positioner_set_offset (struct wl_client   *client,
   positioner->offset_y = y;
 }
 
-static const struct xdg_positioner_interface meta_wayland_xdg_positioner_interface = {
+static const struct xdg_positioner_interface
+  meta_wayland_xdg_positioner_interface =
+{
   xdg_positioner_destroy,
   xdg_positioner_set_size,
   xdg_positioner_set_anchor_rect,
@@ -2020,7 +2052,8 @@ static void
 xdg_wm_base_destroy (struct wl_client   *client,
                      struct wl_resource *resource)
 {
-  MetaWaylandXdgShellClient *shell_client = wl_resource_get_user_data (resource);
+  MetaWaylandXdgShellClient *shell_client =
+    wl_resource_get_user_data (resource);
 
   if (shell_client->surfaces || shell_client->surface_constructors)
     wl_resource_post_error (resource, XDG_WM_BASE_ERROR_DEFUNCT_SURFACES,
@@ -2054,7 +2087,8 @@ xdg_wm_base_get_xdg_surface (struct wl_client   *client,
                              uint32_t            id,
                              struct wl_resource *surface_resource)
 {
-  MetaWaylandXdgShellClient *shell_client = wl_resource_get_user_data (resource);
+  MetaWaylandXdgShellClient *shell_client =
+    wl_resource_get_user_data (resource);
   MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource);
   MetaWaylandXdgSurfaceConstructor *constructor;
 
@@ -2067,7 +2101,8 @@ xdg_wm_base_get_xdg_surface (struct wl_client   *client,
     }
 
   if (surface->role && META_IS_WAYLAND_XDG_SURFACE (surface->role) &&
-      meta_wayland_xdg_surface_is_assigned (META_WAYLAND_XDG_SURFACE (surface->role)))
+      meta_wayland_xdg_surface_is_assigned (META_WAYLAND_XDG_SURFACE (surface->
+                                                                      role)))
     {
       wl_resource_post_error (surface_resource,
                               XDG_WM_BASE_ERROR_ROLE,
@@ -2089,7 +2124,8 @@ xdg_wm_base_get_xdg_surface (struct wl_client   *client,
   constructor->shell_client = shell_client;
   constructor->resource = wl_resource_create (client,
                                               &xdg_surface_interface,
-                                              wl_resource_get_version (resource),
+                                              wl_resource_get_version (
+                                                resource),
                                               id);
   wl_resource_set_implementation (constructor->resource,
                                   &meta_wayland_xdg_surface_constructor_interface,
@@ -2110,7 +2146,8 @@ xdg_wm_base_pong (struct wl_client   *client,
   meta_display_pong_for_serial (display, serial);
 }
 
-static const struct xdg_wm_base_interface meta_wayland_xdg_wm_base_interface = {
+static const struct xdg_wm_base_interface meta_wayland_xdg_wm_base_interface =
+{
   xdg_wm_base_destroy,
   xdg_wm_base_create_positioner,
   xdg_wm_base_get_xdg_surface,
@@ -2134,7 +2171,7 @@ meta_wayland_xdg_shell_client_destroy (MetaWaylandXdgShellClient *shell_client)
       MetaWaylandXdgSurface *xdg_surface =
         g_list_first (shell_client->surfaces)->data;
 
-      meta_wayland_xdg_surface_shell_client_destroyed  (xdg_surface);
+      meta_wayland_xdg_surface_shell_client_destroyed (xdg_surface);
     }
   g_list_free (shell_client->surfaces);
 
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index 25b49918f..5b66904c8 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -67,7 +67,7 @@ static gboolean
 wayland_event_source_prepare (GSource *base,
                               int     *timeout)
 {
-  WaylandEventSource *source = (WaylandEventSource *)base;
+  WaylandEventSource *source = (WaylandEventSource *) base;
 
   *timeout = -1;
 
@@ -81,7 +81,7 @@ wayland_event_source_dispatch (GSource    *base,
                                GSourceFunc callback,
                                void       *data)
 {
-  WaylandEventSource *source = (WaylandEventSource *)base;
+  WaylandEventSource *source = (WaylandEventSource *) base;
   struct wl_event_loop *loop = wl_display_get_event_loop (source->display);
 
   wl_event_loop_dispatch (loop, 0);
@@ -148,10 +148,12 @@ wl_compositor_create_region (struct wl_client   *client,
   meta_wayland_region_create (compositor, client, resource, id);
 }
 
-static const struct wl_compositor_interface meta_wayland_wl_compositor_interface = {
+static const struct wl_compositor_interface meta_wayland_wl_compositor_interface
+  =
+  {
   wl_compositor_create_surface,
   wl_compositor_create_region
-};
+  };
 
 static void
 compositor_bind (struct wl_client *client,
@@ -181,7 +183,8 @@ void
 meta_wayland_compositor_update (MetaWaylandCompositor *compositor,
                                 const ClutterEvent    *event)
 {
-  if (meta_wayland_tablet_manager_consumes_event (compositor->tablet_manager, event))
+  if (meta_wayland_tablet_manager_consumes_event (compositor->tablet_manager,
+                                                  event))
     meta_wayland_tablet_manager_update (compositor->tablet_manager, event);
   else
     meta_wayland_seat_update (compositor->seat, event);
@@ -226,7 +229,8 @@ meta_wayland_compositor_handle_event (MetaWaylandCompositor *compositor,
  * @compositor: the #MetaWaylandCompositor
  * @key_vector: bit vector of key states
  * @key_vector_len: length of @key_vector
- * @offset: the key for the first evdev keycode is found at this offset in @key_vector
+ * @offset: the key for the first evdev keycode is found at this offset in
+ *@key_vector
  *
  * This function is used to resynchronize the key state that Mutter
  * is tracking with the actual keyboard state. This is useful, for example,
@@ -245,21 +249,22 @@ meta_wayland_compositor_update_key_state (MetaWaylandCompositor *compositor,
 }
 
 void
-meta_wayland_compositor_destroy_frame_callbacks (MetaWaylandCompositor *compositor,
-                                                 MetaWaylandSurface    *surface)
+meta_wayland_compositor_destroy_frame_callbacks (
+  MetaWaylandCompositor *compositor,
+  MetaWaylandSurface    *surface)
 {
   MetaWaylandFrameCallback *callback, *next;
 
   wl_list_for_each_safe (callback, next, &compositor->frame_callbacks, link)
-    {
-      if (callback->surface == surface)
-        wl_resource_destroy (callback->resource);
-    }
+  {
+    if (callback->surface == surface)
+      wl_resource_destroy (callback->resource);
+  }
 }
 
 static void
 set_gnome_env (const char *name,
-              const char *value)
+               const char *value)
 {
   GDBusConnection *session_bus;
   GError *error = NULL;
@@ -270,21 +275,24 @@ set_gnome_env (const char *name,
   g_assert (session_bus);
 
   g_dbus_connection_call_sync (session_bus,
-                              "org.gnome.SessionManager",
-                              "/org/gnome/SessionManager",
-                              "org.gnome.SessionManager",
-                              "Setenv",
-                              g_variant_new ("(ss)", name, value),
-                              NULL,
-                              G_DBUS_CALL_FLAGS_NO_AUTO_START,
-                              -1, NULL, &error);
+                               "org.gnome.SessionManager",
+                               "/org/gnome/SessionManager",
+                               "org.gnome.SessionManager",
+                               "Setenv",
+                               g_variant_new ("(ss)", name, value),
+                               NULL,
+                               G_DBUS_CALL_FLAGS_NO_AUTO_START,
+                               -1, NULL, &error);
   if (error)
     {
       char *remote_error;
 
       remote_error = g_dbus_error_get_remote_error (error);
-      if (g_strcmp0 (remote_error, "org.gnome.SessionManager.NotInInitialization") != 0)
-        meta_warning ("Failed to set environment variable %s for gnome-session: %s\n", name, error->message);
+      if (g_strcmp0 (remote_error,
+                     "org.gnome.SessionManager.NotInInitialization") != 0)
+        meta_warning (
+          "Failed to set environment variable %s for gnome-session: %s\n", name,
+          error->message);
 
       g_free (remote_error);
       g_error_free (error);
@@ -369,9 +377,9 @@ meta_wayland_init (void)
   g_source_attach (wayland_event_source, NULL);
 
   if (!wl_global_create (compositor->wayland_display,
-                        &wl_compositor_interface,
-                        META_WL_COMPOSITOR_VERSION,
-                        compositor, compositor_bind))
+                         &wl_compositor_interface,
+                         META_WL_COMPOSITOR_VERSION,
+                         compositor, compositor_bind))
     g_error ("Failed to register the global wl_compositor");
 
   wl_display_init_shm (compositor->wayland_display);
@@ -392,7 +400,8 @@ meta_wayland_init (void)
   meta_wayland_text_input_init (compositor);
   meta_wayland_gtk_text_input_init (compositor);
 
-  /* Xwayland specific protocol, needs to be filtered out for all other clients */
+  /* Xwayland specific protocol, needs to be filtered out for all other clients
+   * */
   if (meta_xwayland_grab_keyboard_init (compositor))
     wl_display_set_global_filter (compositor->wayland_display,
                                   meta_xwayland_global_filter,
@@ -404,7 +413,8 @@ meta_wayland_init (void)
 
   if (meta_should_autostart_x11_display ())
     {
-      if (!meta_xwayland_start (&compositor->xwayland_manager, compositor->wayland_display))
+      if (!meta_xwayland_start (&compositor->xwayland_manager,
+                                compositor->wayland_display))
         g_error ("Failed to start X Wayland");
     }
 
@@ -428,9 +438,11 @@ meta_wayland_init (void)
     }
 
   if (meta_should_autostart_x11_display ())
-    set_gnome_env ("DISPLAY", meta_wayland_get_xwayland_display_name (compositor));
+    set_gnome_env ("DISPLAY", meta_wayland_get_xwayland_display_name (
+                     compositor));
 
-  set_gnome_env ("WAYLAND_DISPLAY", meta_wayland_get_wayland_display_name (compositor));
+  set_gnome_env ("WAYLAND_DISPLAY",
+                 meta_wayland_get_wayland_display_name (compositor));
 }
 
 const char *
@@ -476,8 +488,9 @@ meta_wayland_compositor_restore_shortcuts (MetaWaylandCompositor *compositor,
 }
 
 gboolean
-meta_wayland_compositor_is_shortcuts_inhibited (MetaWaylandCompositor *compositor,
-                                                ClutterInputDevice    *source)
+meta_wayland_compositor_is_shortcuts_inhibited (
+  MetaWaylandCompositor *compositor,
+  ClutterInputDevice    *source)
 {
   MetaWaylandKeyboard *keyboard;
 
@@ -500,8 +513,9 @@ static void on_scheduled_association_unmanaged (MetaWindow *window,
                                                 gpointer    user_data);
 
 static void
-meta_wayland_compositor_remove_surface_association (MetaWaylandCompositor *compositor,
-                                                    int                    id)
+meta_wayland_compositor_remove_surface_association (
+  MetaWaylandCompositor *compositor,
+  int                    id)
 {
   MetaWindow *window;
 
@@ -524,13 +538,15 @@ on_scheduled_association_unmanaged (MetaWindow *window,
   MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
 
   meta_wayland_compositor_remove_surface_association (compositor,
-                                                      GPOINTER_TO_INT (user_data));
+                                                      GPOINTER_TO_INT (
+                                                        user_data));
 }
 
 void
-meta_wayland_compositor_schedule_surface_association (MetaWaylandCompositor *compositor,
-                                                      int                    id,
-                                                      MetaWindow            *window)
+meta_wayland_compositor_schedule_surface_association (
+  MetaWaylandCompositor *compositor,
+  int                    id,
+  MetaWindow            *window)
 {
   g_signal_connect (window, "unmanaged",
                     G_CALLBACK (on_scheduled_association_unmanaged),
diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c
index dffee486d..5e2296c5a 100644
--- a/src/wayland/meta-window-wayland.c
+++ b/src/wayland/meta-window-wayland.c
@@ -70,7 +70,8 @@ struct _MetaWindowWaylandClass
 G_DEFINE_TYPE (MetaWindowWayland, meta_window_wayland, META_TYPE_WINDOW)
 
 static int
-get_window_geometry_scale_for_logical_monitor (MetaLogicalMonitor *logical_monitor)
+get_window_geometry_scale_for_logical_monitor (
+  MetaLogicalMonitor *logical_monitor)
 {
   g_assert (logical_monitor);
 
@@ -172,7 +173,8 @@ meta_window_wayland_grab_op_began (MetaWindow *window,
   if (meta_grab_op_is_resizing (op))
     surface_state_changed (window);
 
-  META_WINDOW_CLASS (meta_window_wayland_parent_class)->grab_op_began (window, op);
+  META_WINDOW_CLASS (meta_window_wayland_parent_class)->grab_op_began (window,
+                                                                       op);
 }
 
 static void
@@ -182,7 +184,8 @@ meta_window_wayland_grab_op_ended (MetaWindow *window,
   if (meta_grab_op_is_resizing (op))
     surface_state_changed (window);
 
-  META_WINDOW_CLASS (meta_window_wayland_parent_class)->grab_op_ended (window, op);
+  META_WINDOW_CLASS (meta_window_wayland_parent_class)->grab_op_ended (window,
+                                                                       op);
 }
 
 static void
@@ -296,7 +299,8 @@ meta_window_wayland_move_resize_internal (MetaWindow                *window,
         }
       else
         {
-          /* We're just moving the window, so we don't need to wait for a configure
+          /* We're just moving the window, so we don't need to wait for a
+           * configure
            * and then ack to simply move the window. */
           can_move_now = TRUE;
         }
@@ -322,7 +326,8 @@ meta_window_wayland_move_resize_internal (MetaWindow                *window,
       int new_buffer_x = new_x - window->custom_frame_extents.left;
       int new_buffer_y = new_y - window->custom_frame_extents.top;
 
-      if (new_buffer_x != window->buffer_rect.x || new_buffer_y != window->buffer_rect.y)
+      if (new_buffer_x != window->buffer_rect.x ||
+          new_buffer_y != window->buffer_rect.y)
         {
           *result |= META_MOVE_RESIZE_RESULT_MOVED;
           window->buffer_rect.x = new_buffer_x;
@@ -344,7 +349,8 @@ meta_window_wayland_move_resize_internal (MetaWindow                *window,
           wl_window->pending_move_y = new_y;
         }
 
-      wl_window->has_pending_state_change = (flags & META_MOVE_RESIZE_STATE_CHANGED) != 0;
+      wl_window->has_pending_state_change =
+        (flags & META_MOVE_RESIZE_STATE_CHANGED) != 0;
     }
 }
 
@@ -374,8 +380,8 @@ scale_rect_size (MetaRectangle *rect,
 }
 
 static void
-meta_window_wayland_update_main_monitor (MetaWindow                   *window,
-                                         MetaWindowUpdateMonitorFlags  flags)
+meta_window_wayland_update_main_monitor (MetaWindow                  *window,
+                                         MetaWindowUpdateMonitorFlags flags)
 {
   MetaBackend *backend = meta_get_backend ();
   MetaMonitorManager *monitor_manager =
@@ -486,15 +492,17 @@ meta_window_wayland_main_monitor_changed (MetaWindow               *window,
   scale_rect_size (&window->rect, scale_factor);
   scale_rect_size (&window->unconstrained_rect, scale_factor);
   scale_rect_size (&window->saved_rect, scale_factor);
-  scale_size (&window->size_hints.min_width, &window->size_hints.min_height, scale_factor);
-  scale_size (&window->size_hints.max_width, &window->size_hints.max_height, scale_factor);
+  scale_size (&window->size_hints.min_width, &window->size_hints.min_height,
+              scale_factor);
+  scale_size (&window->size_hints.max_width, &window->size_hints.max_height,
+              scale_factor);
 
   /* Window geometry offset (XXX: Need a better place, see
    * meta_window_wayland_move_resize). */
   window->custom_frame_extents.left =
-    (int)(scale_factor * window->custom_frame_extents.left);
+    (int) (scale_factor * window->custom_frame_extents.left);
   window->custom_frame_extents.top =
-    (int)(scale_factor * window->custom_frame_extents.top);
+    (int) (scale_factor * window->custom_frame_extents.top);
 
   /* Buffer rect. */
   scale_rect_size (&window->buffer_rect, scale_factor);
@@ -528,8 +536,9 @@ meta_window_wayland_get_client_pid (MetaWindow *window)
   struct wl_resource *resource = surface->resource;
   pid_t pid;
 
-  wl_client_get_credentials (wl_resource_get_client (resource), &pid, NULL, NULL);
-  return (uint32_t)pid;
+  wl_client_get_credentials (wl_resource_get_client (resource), &pid, NULL,
+                             NULL);
+  return (uint32_t) pid;
 }
 
 static void
@@ -616,7 +625,8 @@ meta_window_wayland_class_init (MetaWindowWaylandClass *klass)
   window_class->update_main_monitor = meta_window_wayland_update_main_monitor;
   window_class->main_monitor_changed = meta_window_wayland_main_monitor_changed;
   window_class->get_client_pid = meta_window_wayland_get_client_pid;
-  window_class->force_restore_shortcuts = meta_window_wayland_force_restore_shortcuts;
+  window_class->force_restore_shortcuts =
+    meta_window_wayland_force_restore_shortcuts;
   window_class->shortcuts_inhibited = meta_window_wayland_shortcuts_inhibited;
   window_class->is_stackable = meta_window_wayland_is_stackable;
   window_class->are_updates_frozen = meta_window_wayland_are_updates_frozen;
@@ -647,9 +657,11 @@ meta_window_wayland_new (MetaDisplay        *display,
    * X requests (passing a window xid of None) until we thoroughly audit all
    * the code to make sure it knows about non X based clients...
    */
-  meta_x11_error_trap_push (display->x11_display); /* Push a trap over all of window
-                                                * creation, to reduce XSync() calls
-                                                */
+  meta_x11_error_trap_push (display->x11_display); /* Push a trap over all of
+                                                    * window
+                                                    * creation, to reduce
+                                                    *XSync() calls
+                                                    */
 
   window = _meta_window_shared_new (display,
                                     META_WINDOW_CLIENT_TYPE_WAYLAND,
@@ -660,7 +672,8 @@ meta_window_wayland_new (MetaDisplay        *display,
                                     &attrs);
   window->can_ping = TRUE;
 
-  meta_x11_error_trap_pop (display->x11_display); /* pop the XSync()-reducing trap */
+  meta_x11_error_trap_pop (display->x11_display); /* pop the XSync()-reducing
+                                                   * trap */
 
   return window;
 }
@@ -678,7 +691,8 @@ is_pending_ack_configure (MetaWindowWayland *wl_window,
 
       /* If we're waiting for a configure and this isn't an ACK for
        * the configure we're waiting for, then fizzle it out. */
-      if (acked_configure_serial->value != wl_window->pending_configure_serial.value)
+      if (acked_configure_serial->value !=
+          wl_window->pending_configure_serial.value)
         return FALSE;
     }
 
@@ -735,7 +749,8 @@ meta_window_wayland_move_resize (MetaWindow        *window,
 
   flags = META_MOVE_RESIZE_WAYLAND_RESIZE;
 
-  pending_ack_configure = is_pending_ack_configure (wl_window, acked_configure_serial);
+  pending_ack_configure = is_pending_ack_configure (wl_window,
+                                                    acked_configure_serial);
 
   /* x/y are ignored when we're doing interactive resizing */
   if (!meta_grab_op_is_resizing (window->display->grab_op))
@@ -873,10 +888,12 @@ meta_window_wayland_set_max_size (MetaWindow *window,
   new_height = height + (window->custom_frame_extents.top +
                          window->custom_frame_extents.bottom);
 
-  window->size_hints.max_width = (int) ((new_width > 0 && new_width < G_MAXINT) ?
-                                        new_width : G_MAXINT);
-  window->size_hints.max_height = (int)  ((new_height > 0 && new_height < G_MAXINT) ?
-                                          new_height : G_MAXINT);
+  window->size_hints.max_width =
+    (int) ((new_width > 0 && new_width < G_MAXINT) ?
+           new_width : G_MAXINT);
+  window->size_hints.max_height =
+    (int) ((new_height > 0 && new_height < G_MAXINT) ?
+           new_height : G_MAXINT);
   window->size_hints.flags |= PMaxSize;
 }
 
diff --git a/src/wayland/meta-window-xwayland.c b/src/wayland/meta-window-xwayland.c
index 6f073893a..84a8a1ce2 100644
--- a/src/wayland/meta-window-xwayland.c
+++ b/src/wayland/meta-window-xwayland.c
@@ -115,7 +115,8 @@ meta_window_xwayland_class_init (MetaWindowXwaylandClass *klass)
   MetaWindowClass *window_class = META_WINDOW_CLASS (klass);
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
-  window_class->force_restore_shortcuts = meta_window_xwayland_force_restore_shortcuts;
+  window_class->force_restore_shortcuts =
+    meta_window_xwayland_force_restore_shortcuts;
   window_class->shortcuts_inhibited = meta_window_xwayland_shortcuts_inhibited;
 
   gobject_class->get_property = meta_window_xwayland_get_property;
diff --git a/src/wayland/meta-xwayland-grab-keyboard.c b/src/wayland/meta-xwayland-grab-keyboard.c
index db2d5f0bd..d67c06afe 100644
--- a/src/wayland/meta-xwayland-grab-keyboard.c
+++ b/src/wayland/meta-xwayland-grab-keyboard.c
@@ -54,7 +54,8 @@ meta_xwayland_keyboard_grab_key (MetaWaylandKeyboardGrab *grab,
   keyboard = active_grab->keyboard_grab.keyboard;
 
   /* Force focus onto the surface who has the active grab on the keyboard */
-  if (active_grab->surface != NULL && keyboard->focus_surface != active_grab->surface)
+  if (active_grab->surface != NULL &&
+      keyboard->focus_surface != active_grab->surface)
     meta_wayland_keyboard_set_focus (keyboard, active_grab->surface);
 
   /* Chain-up with default keyboard handler */
@@ -72,12 +73,13 @@ meta_xwayland_keyboard_grab_modifiers (MetaWaylandKeyboardGrab *grab,
   keyboard = active_grab->keyboard_grab.keyboard;
 
   /* Force focus onto the surface who has the active grab on the keyboard */
-  if (active_grab->surface != NULL && keyboard->focus_surface != active_grab->surface)
+  if (active_grab->surface != NULL &&
+      keyboard->focus_surface != active_grab->surface)
     meta_wayland_keyboard_set_focus (keyboard, active_grab->surface);
 
   /* Chain-up with default keyboard handler */
- return keyboard->default_grab.interface->modifiers (&keyboard->default_grab,
-                                                     modifiers);
+  return keyboard->default_grab.interface->modifiers (&keyboard->default_grab,
+                                                      modifiers);
 }
 
 static void
@@ -88,7 +90,8 @@ meta_xwayland_keyboard_grab_end (MetaXwaylandKeyboardActiveGrab *active_grab)
   if (seat->keyboard->grab->interface->key == meta_xwayland_keyboard_grab_key)
     {
       meta_wayland_keyboard_end_grab (active_grab->keyboard_grab.keyboard);
-      meta_wayland_keyboard_set_focus (active_grab->keyboard_grab.keyboard, NULL);
+      meta_wayland_keyboard_set_focus (active_grab->keyboard_grab.keyboard,
+                                       NULL);
       meta_display_sync_wayland_input_focus (meta_get_display ());
     }
 
@@ -115,10 +118,11 @@ meta_xwayland_keyboard_grab_end (MetaXwaylandKeyboardActiveGrab *active_grab)
 }
 
 static const MetaWaylandKeyboardGrabInterface
-  keyboard_grab_interface = {
-    meta_xwayland_keyboard_grab_key,
-    meta_xwayland_keyboard_grab_modifiers
-  };
+  keyboard_grab_interface =
+{
+  meta_xwayland_keyboard_grab_key,
+  meta_xwayland_keyboard_grab_modifiers
+};
 
 static void
 zwp_xwayland_keyboard_grab_destructor (struct wl_resource *resource)
@@ -139,9 +143,10 @@ zwp_xwayland_keyboard_grab_destroy (struct wl_client   *client,
 }
 
 static const struct zwp_xwayland_keyboard_grab_v1_interface
-  xwayland_keyboard_grab_interface = {
-    zwp_xwayland_keyboard_grab_destroy,
-  };
+  xwayland_keyboard_grab_interface =
+{
+  zwp_xwayland_keyboard_grab_destroy,
+};
 
 static void
 surface_destroyed_cb (MetaWaylandSurface             *surface,
@@ -172,14 +177,17 @@ application_is_in_pattern_array (MetaWindow *window,
 
   for (i = 0; pattern_array && i < pattern_array->len; i++)
     {
-      GPatternSpec *pattern = (GPatternSpec *) g_ptr_array_index (pattern_array, i);
+      GPatternSpec *pattern = (GPatternSpec *) g_ptr_array_index (pattern_array,
+                                                                  i);
 
-      if ((window->res_class && g_pattern_match_string (pattern, window->res_class)) ||
-          (window->res_name && g_pattern_match_string (pattern, window->res_name)))
+      if ((window->res_class &&
+           g_pattern_match_string (pattern, window->res_class)) ||
+          (window->res_name &&
+           g_pattern_match_string (pattern, window->res_name)))
         return TRUE;
     }
 
-   return FALSE;
+  return FALSE;
 }
 
 static gboolean
@@ -202,8 +210,10 @@ meta_xwayland_grab_is_granted (MetaWindow *window)
   if (blacklist && application_is_in_pattern_array (window, blacklist))
     return FALSE;
 
-  /* Check if we are dealing with good citizen Xwayland client whitelisting itself. */
-  g_object_get (G_OBJECT (window), "xwayland-may-grab-keyboard", &may_grab, NULL);
+  /* Check if we are dealing with good citizen Xwayland client whitelisting
+   * itself. */
+  g_object_get (G_OBJECT (window), "xwayland-may-grab-keyboard", &may_grab,
+                NULL);
   if (may_grab)
     return TRUE;
 
@@ -215,7 +225,8 @@ meta_xwayland_grab_is_granted (MetaWindow *window)
 }
 
 static void
-meta_xwayland_keyboard_grab_activate (MetaXwaylandKeyboardActiveGrab *active_grab)
+meta_xwayland_keyboard_grab_activate (
+  MetaXwaylandKeyboardActiveGrab *active_grab)
 {
   MetaWaylandSurface *surface = active_grab->surface;
   MetaWindow *window = surface->window;
@@ -225,9 +236,11 @@ meta_xwayland_keyboard_grab_activate (MetaXwaylandKeyboardActiveGrab *active_gra
     {
       meta_verbose ("XWayland window %s has a grab granted", window->desc);
       meta_wayland_surface_inhibit_shortcuts (surface, seat);
-      /* Use a grab for O-R windows which never receive keyboard focus otherwise */
+      /* Use a grab for O-R windows which never receive keyboard focus otherwise
+       * */
       if (window->override_redirect)
-        meta_wayland_keyboard_start_grab (seat->keyboard, &active_grab->keyboard_grab);
+        meta_wayland_keyboard_start_grab (seat->keyboard,
+                                          &active_grab->keyboard_grab);
     }
   if (active_grab->window_associate_handler)
     {
@@ -238,8 +251,9 @@ meta_xwayland_keyboard_grab_activate (MetaXwaylandKeyboardActiveGrab *active_gra
 }
 
 static void
-meta_xwayland_keyboard_window_associated (MetaWaylandSurfaceRole         *surface_role,
-                                          MetaXwaylandKeyboardActiveGrab *active_grab)
+meta_xwayland_keyboard_window_associated (
+  MetaWaylandSurfaceRole         *surface_role,
+  MetaXwaylandKeyboardActiveGrab *active_grab)
 {
   meta_xwayland_keyboard_grab_activate (active_grab);
 }
@@ -293,10 +307,11 @@ zwp_xwayland_keyboard_grab_manager_grab (struct wl_client   *client,
 }
 
 static const struct zwp_xwayland_keyboard_grab_manager_v1_interface
-  meta_keyboard_grab_manager_interface = {
-    zwp_xwayland_keyboard_grab_manager_destroy,
-    zwp_xwayland_keyboard_grab_manager_grab,
-  };
+  meta_keyboard_grab_manager_interface =
+{
+  zwp_xwayland_keyboard_grab_manager_destroy,
+  zwp_xwayland_keyboard_grab_manager_grab,
+};
 
 static void
 bind_keyboard_grab (struct wl_client *client,
@@ -308,7 +323,8 @@ bind_keyboard_grab (struct wl_client *client,
 
   resource = wl_resource_create (client,
                                  &zwp_xwayland_keyboard_grab_manager_v1_interface,
-                                 MIN (META_ZWP_XWAYLAND_KEYBOARD_GRAB_V1_VERSION, version),
+                                 MIN (META_ZWP_XWAYLAND_KEYBOARD_GRAB_V1_VERSION,
+                                      version),
                                  id);
 
   wl_resource_set_implementation (resource,
diff --git a/src/wayland/meta-xwayland-selection.c b/src/wayland/meta-xwayland-selection.c
index 8502e2254..cd3b4a975 100644
--- a/src/wayland/meta-xwayland-selection.c
+++ b/src/wayland/meta-xwayland-selection.c
@@ -44,7 +44,8 @@
 #define INCR_CHUNK_SIZE (128 * 1024)
 #define XDND_VERSION 5
 
-typedef struct {
+typedef struct
+{
   MetaXWaylandSelection *selection_data;
   GInputStream *stream;
   GCancellable *cancellable;
@@ -55,7 +56,8 @@ typedef struct {
   guint incr : 1;
 } WaylandSelectionData;
 
-typedef struct {
+typedef struct
+{
   MetaXWaylandSelection *selection_data;
   GOutputStream *stream;
   GCancellable *cancellable;
@@ -63,7 +65,8 @@ typedef struct {
   guint incr : 1;
 } X11SelectionData;
 
-typedef struct {
+typedef struct
+{
   Atom selection_atom;
   Window window;
   Window owner;
@@ -76,10 +79,12 @@ typedef struct {
   struct wl_listener ownership_listener;
 } MetaSelectionBridge;
 
-typedef struct {
+typedef struct
+{
   MetaSelectionBridge selection;
   MetaWaylandSurface *focus_surface;
-  Window dnd_window; /* Mutter-internal window, acts as peer on wayland drop sites */
+  Window dnd_window; /* Mutter-internal window, acts as peer on wayland drop
+                      * sites */
   Window dnd_dest; /* X11 drag dest window */
   guint32 last_motion_time;
 } MetaDndBridge;
@@ -92,13 +97,15 @@ struct _MetaWaylandDataSourceXWayland
   guint has_utf8_string_atom : 1;
 };
 
-struct _MetaXWaylandSelection {
+struct _MetaXWaylandSelection
+{
   MetaSelectionBridge clipboard;
   MetaSelectionBridge primary;
   MetaDndBridge dnd;
 };
 
-enum {
+enum
+{
   ATOM_DND_SELECTION,
   ATOM_DND_AWARE,
   ATOM_DND_STATUS,
@@ -117,7 +124,8 @@ enum {
 };
 
 /* Matches order in enum above */
-const gchar *atom_names[] = {
+const gchar *atom_names[] =
+{
   "XdndSelection",
   "XdndAware",
   "XdndStatus",
@@ -197,9 +205,9 @@ xdnd_send_enter (MetaXWaylandSelection *selection_data,
       gint i = 2;
 
       wl_array_for_each (p, source_mime_types)
-        {
-          xev.xclient.data.l[i++] = gdk_x11_get_xatom_by_name (*p);
-        }
+      {
+        xev.xclient.data.l[i++] = gdk_x11_get_xatom_by_name (*p);
+      }
     }
   else
     {
@@ -213,9 +221,9 @@ xdnd_send_enter (MetaXWaylandSelection *selection_data,
       atomlist = g_new0 (Atom, source_mime_types->size);
 
       wl_array_for_each (p, source_mime_types)
-        {
-          atomlist[i++] = gdk_x11_get_xatom_by_name (*p);
-        }
+      {
+        atomlist[i++] = gdk_x11_get_xatom_by_name (*p);
+      }
 
       XChangeProperty (xdisplay, selection->window,
                        xdnd_atoms[ATOM_DND_TYPE_LIST],
@@ -366,7 +374,8 @@ meta_xwayland_init_dnd (MetaXWaylandManager *manager)
   attributes.override_redirect = True;
 
   dnd->dnd_window = XCreateWindow (xdisplay,
-                                   gdk_x11_window_get_xid (gdk_get_default_root_window ()),
+                                   gdk_x11_window_get_xid (
+                                     gdk_get_default_root_window ()),
                                    -1, -1, 1, 1,
                                    0, /* border width */
                                    0, /* depth */
@@ -377,7 +386,7 @@ meta_xwayland_init_dnd (MetaXWaylandManager *manager)
   XChangeProperty (xdisplay, dnd->dnd_window,
                    xdnd_atoms[ATOM_DND_AWARE],
                    XA_ATOM, 32, PropModeReplace,
-                   (guchar*) &version, 1);
+                   (guchar *) &version, 1);
 }
 
 static void
@@ -410,7 +419,8 @@ static MetaSelectionBridge *
 atom_to_selection_bridge (MetaWaylandCompositor *compositor,
                           Atom                   selection_atom)
 {
-  MetaXWaylandSelection *selection_data = compositor->xwayland_manager.selection_data;
+  MetaXWaylandSelection *selection_data =
+    compositor->xwayland_manager.selection_data;
 
   if (selection_atom == selection_data->clipboard.selection_atom)
     return &selection_data->clipboard;
@@ -452,7 +462,8 @@ static void
 x11_selection_data_send_finished (MetaSelectionBridge *selection,
                                   gboolean             success)
 {
-  uint32_t action = meta_wayland_data_source_get_current_action (selection->source);
+  uint32_t action = meta_wayland_data_source_get_current_action (
+    selection->source);
 
   if (!selection->x11_selection)
     return;
@@ -633,7 +644,7 @@ reply_selection_request (XSelectionRequestEvent *request_event,
   Display *xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
   XSelectionEvent event;
 
-  memset(&event, 0, sizeof (XSelectionEvent));
+  memset (&event, 0, sizeof (XSelectionEvent));
   event.type = SelectionNotify;
   event.time = request_event->time;
   event.requestor = request_event->requestor;
@@ -907,12 +918,14 @@ meta_x11_source_drag_finished (MetaWaylandDataSource *source)
 }
 
 static void
-meta_wayland_data_source_xwayland_init (MetaWaylandDataSourceXWayland *source_xwayland)
+meta_wayland_data_source_xwayland_init (
+  MetaWaylandDataSourceXWayland *source_xwayland)
 {
 }
 
 static void
-meta_wayland_data_source_xwayland_class_init (MetaWaylandDataSourceXWaylandClass *klass)
+meta_wayland_data_source_xwayland_class_init (
+  MetaWaylandDataSourceXWaylandClass *klass)
 {
   MetaWaylandDataSourceClass *data_source_class =
     META_WAYLAND_DATA_SOURCE_CLASS (klass);
@@ -943,7 +956,8 @@ meta_x11_drag_dest_focus_in (MetaWaylandDataDevice *data_device,
 {
   MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
 
-  compositor->xwayland_manager.selection_data->dnd.dnd_dest = surface->window->xwindow;
+  compositor->xwayland_manager.selection_data->dnd.dnd_dest =
+    surface->window->xwindow;
   xdnd_send_enter (compositor->xwayland_manager.selection_data,
                    compositor->xwayland_manager.selection_data->dnd.dnd_dest);
 }
@@ -1001,7 +1015,8 @@ meta_x11_drag_dest_update (MetaWaylandDataDevice *data_device,
                       pos.x, pos.y);
 }
 
-static const MetaWaylandDragDestFuncs meta_x11_drag_dest_funcs = {
+static const MetaWaylandDragDestFuncs meta_x11_drag_dest_funcs =
+{
   meta_x11_drag_dest_focus_in,
   meta_x11_drag_dest_focus_out,
   meta_x11_drag_dest_motion,
@@ -1080,20 +1095,26 @@ meta_xwayland_selection_get_x11_targets (MetaWaylandCompositor *compositor,
 
   if (meta_xwayland_data_source_fetch_mimetype_list (data_source,
                                                      selection->window,
-                                                     gdk_x11_get_xatom_by_name ("_META_SELECTION")))
+                                                     gdk_x11_get_xatom_by_name (
+                                                       "_META_SELECTION")))
     {
       g_clear_object (&selection->source);
       selection->source = data_source;
 
       if (selection->selection_atom == gdk_x11_get_xatom_by_name ("CLIPBOARD"))
         {
-          meta_wayland_data_device_set_selection (&compositor->seat->data_device, data_source,
-                                                  wl_display_next_serial (compositor->wayland_display));
+          meta_wayland_data_device_set_selection (
+            &compositor->seat->data_device, data_source,
+            wl_display_next_serial (
+              compositor->wayland_display));
         }
-      else if (selection->selection_atom == gdk_x11_get_xatom_by_name ("PRIMARY"))
+      else if (selection->selection_atom ==
+               gdk_x11_get_xatom_by_name ("PRIMARY"))
         {
-          meta_wayland_data_device_set_primary (&compositor->seat->data_device, data_source,
-                                                wl_display_next_serial (compositor->wayland_display));
+          meta_wayland_data_device_set_primary (&compositor->seat->data_device,
+                                                data_source,
+                                                wl_display_next_serial (
+                                                  compositor->wayland_display));
         }
     }
   else
@@ -1126,20 +1147,23 @@ meta_xwayland_selection_get_x11_data (MetaWaylandCompositor *compositor,
                       &bytes_after_ret,
                       &prop_ret);
 
-  selection->x11_selection->incr = (type_ret == gdk_x11_get_xatom_by_name ("INCR"));
+  selection->x11_selection->incr =
+    (type_ret == gdk_x11_get_xatom_by_name ("INCR"));
 
   if (selection->x11_selection->incr)
     return;
 
-  if (type_ret == gdk_x11_get_xatom_by_name (selection->x11_selection->mime_type))
+  if (type_ret ==
+      gdk_x11_get_xatom_by_name (selection->x11_selection->mime_type))
     x11_selection_data_write (selection, prop_ret, nitems_ret);
 
   XFree (prop_ret);
 }
 
 static gboolean
-meta_xwayland_selection_handle_selection_notify (MetaWaylandCompositor *compositor,
-                                                 XEvent                *xevent)
+meta_xwayland_selection_handle_selection_notify (
+  MetaWaylandCompositor *compositor,
+  XEvent                *xevent)
 {
   XSelectionEvent *event = (XSelectionEvent *) xevent;
   MetaSelectionBridge *selection;
@@ -1190,9 +1214,9 @@ meta_xwayland_selection_send_targets (MetaWaylandCompositor       *compositor,
   targets = g_new (Atom, source_mime_types->size + 2);
 
   wl_array_for_each (p, source_mime_types)
-    {
-      targets[i++] = gdk_x11_get_xatom_by_name (*p);
-    }
+  {
+    targets[i++] = gdk_x11_get_xatom_by_name (*p);
+  }
 
   targets[i++] = gdk_x11_get_xatom_by_name ("TIMESTAMP");
   targets[i++] = gdk_x11_get_xatom_by_name ("TARGETS");
@@ -1250,7 +1274,8 @@ handle_incr_chunk (MetaWaylandCompositor *compositor,
   else if (selection->wayland_selection &&
            selection->wayland_selection->incr &&
            event->state == PropertyDelete &&
-           event->window == selection->wayland_selection->request_event.requestor &&
+           event->window ==
+           selection->wayland_selection->request_event.requestor &&
            event->atom == selection->wayland_selection->request_event.property)
     {
       /* Wayland to X11 */
@@ -1262,18 +1287,21 @@ handle_incr_chunk (MetaWaylandCompositor *compositor,
 }
 
 static gboolean
-meta_xwayland_selection_handle_property_notify (MetaWaylandCompositor *compositor,
-                                                XEvent                *xevent)
+meta_xwayland_selection_handle_property_notify (
+  MetaWaylandCompositor *compositor,
+  XEvent                *xevent)
 {
-  MetaXWaylandSelection *selection_data = compositor->xwayland_manager.selection_data;
+  MetaXWaylandSelection *selection_data =
+    compositor->xwayland_manager.selection_data;
   XPropertyEvent *event = (XPropertyEvent *) xevent;
 
   return handle_incr_chunk (compositor, &selection_data->clipboard, event);
 }
 
 static gboolean
-meta_xwayland_selection_handle_selection_request (MetaWaylandCompositor *compositor,
-                                                  XEvent                *xevent)
+meta_xwayland_selection_handle_selection_request (
+  MetaWaylandCompositor *compositor,
+  XEvent                *xevent)
 {
   XSelectionRequestEvent *event = (XSelectionRequestEvent *) xevent;
   MetaWaylandDataSource *data_source;
@@ -1288,8 +1316,9 @@ meta_xwayland_selection_handle_selection_request (MetaWaylandCompositor *composi
     return FALSE;
 
   /* We must fetch from the currently active source, not the Xwayland one */
-  data_source = data_device_get_active_source_for_atom (&compositor->seat->data_device,
-                                                        selection->selection_atom);
+  data_source = data_device_get_active_source_for_atom (
+    &compositor->seat->data_device,
+    selection->selection_atom);
   if (!data_source)
     return FALSE;
 
@@ -1319,7 +1348,9 @@ meta_xwayland_selection_handle_selection_request (MetaWaylandCompositor *composi
     {
       if (data_source &&
           meta_wayland_data_source_has_mime_type (data_source,
-                                                  gdk_x11_get_xatom_name (event->target)))
+                                                  gdk_x11_get_xatom_name (event
+                                                                          ->
+                                                                          target)))
         {
           selection->wayland_selection = wayland_selection_data_new (event,
                                                                      compositor);
@@ -1427,15 +1458,17 @@ drag_xgrab_button (MetaWaylandPointerGrab *grab,
     meta_xwayland_end_dnd_grab (&seat->data_device);
 }
 
-static const MetaWaylandPointerGrabInterface drag_xgrab_interface = {
+static const MetaWaylandPointerGrabInterface drag_xgrab_interface =
+{
   drag_xgrab_focus,
   drag_xgrab_motion,
   drag_xgrab_button,
 };
 
 static gboolean
-meta_xwayland_selection_handle_client_message (MetaWaylandCompositor *compositor,
-                                               XEvent                *xevent)
+meta_xwayland_selection_handle_client_message (
+  MetaWaylandCompositor *compositor,
+  XEvent                *xevent)
 {
   XClientMessageEvent *event = (XClientMessageEvent *) xevent;
   MetaDndBridge *dnd = &compositor->xwayland_manager.selection_data->dnd;
@@ -1480,8 +1513,10 @@ meta_xwayland_selection_handle_client_message (MetaWaylandCompositor *compositor
            compositor->seat->data_device.current_grab &&
            (Window) event->data.l[0] == dnd->selection.owner)
     {
-      MetaWaylandDragGrab *drag_grab = compositor->seat->data_device.current_grab;
-      MetaWaylandSurface *drag_focus = meta_wayland_drag_grab_get_focus (drag_grab);
+      MetaWaylandDragGrab *drag_grab =
+        compositor->seat->data_device.current_grab;
+      MetaWaylandSurface *drag_focus = meta_wayland_drag_grab_get_focus (
+        drag_grab);
 
       if (!drag_focus &&
           event->message_type != xdnd_atoms[ATOM_DND_ENTER])
@@ -1512,17 +1547,20 @@ meta_xwayland_selection_handle_client_message (MetaWaylandCompositor *compositor
                         break;
 
                       mimetype = gdk_x11_get_xatom_name (event->data.l[i]);
-                      meta_wayland_data_source_add_mime_type (dnd->selection.source,
-                                                              mimetype);
+                      meta_wayland_data_source_add_mime_type (
+                        dnd->selection.source,
+                        mimetype);
                     }
                 }
             }
           else
             {
               /* Fetch mimetypes from type list */
-              meta_xwayland_data_source_fetch_mimetype_list (dnd->selection.source,
-                                                             event->data.l[0],
-                                                             xdnd_atoms[ATOM_DND_TYPE_LIST]);
+              meta_xwayland_data_source_fetch_mimetype_list (
+                dnd->selection.source,
+                event->data.l[0],
+                xdnd_atoms[
+                  ATOM_DND_TYPE_LIST]);
             }
 
           meta_wayland_drag_grab_set_focus (drag_grab, dnd->focus_surface);
@@ -1549,7 +1587,9 @@ meta_xwayland_selection_handle_client_message (MetaWaylandCompositor *compositor
           meta_wayland_surface_drag_dest_motion (drag_focus, motion);
           xdnd_send_status (compositor->xwayland_manager.selection_data,
                             (Window) event->data.l[0],
-                            meta_wayland_data_source_get_current_action (dnd->selection.source));
+                            meta_wayland_data_source_get_current_action (dnd->
+                                                                         selection
+                                                                         .source));
 
           clutter_event_free (motion);
           return TRUE;
@@ -1572,8 +1612,9 @@ meta_xwayland_selection_handle_client_message (MetaWaylandCompositor *compositor
 }
 
 static gboolean
-meta_xwayland_selection_handle_xfixes_selection_notify (MetaWaylandCompositor *compositor,
-                                                        XEvent                *xevent)
+meta_xwayland_selection_handle_xfixes_selection_notify (
+  MetaWaylandCompositor *compositor,
+  XEvent                *xevent)
 {
   XFixesSelectionNotifyEvent *event = (XFixesSelectionNotifyEvent *) xevent;
   Display *xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
@@ -1633,11 +1674,13 @@ meta_xwayland_selection_handle_xfixes_selection_notify (MetaWaylandCompositor *c
         {
           selection->client_message_timestamp = META_CURRENT_TIME;
           selection->source = meta_wayland_data_source_xwayland_new (selection);
-          meta_wayland_data_device_set_dnd_source (&compositor->seat->data_device,
-                                                   selection->source);
+          meta_wayland_data_device_set_dnd_source (
+            &compositor->seat->data_device,
+            selection->source);
 
           meta_wayland_data_device_start_drag (data_device,
-                                               wl_resource_get_client (focus->resource),
+                                               wl_resource_get_client (focus->
+                                                                       resource),
                                                &drag_xgrab_interface,
                                                focus, selection->source,
                                                NULL);
@@ -1664,22 +1707,27 @@ meta_xwayland_selection_handle_event (XEvent *xevent)
   switch (xevent->type)
     {
     case SelectionNotify:
-      return meta_xwayland_selection_handle_selection_notify (compositor, xevent);
+      return meta_xwayland_selection_handle_selection_notify (compositor,
+                                                              xevent);
     case PropertyNotify:
-      return meta_xwayland_selection_handle_property_notify (compositor, xevent);
+      return meta_xwayland_selection_handle_property_notify (compositor,
+                                                             xevent);
     case SelectionRequest:
-      return meta_xwayland_selection_handle_selection_request (compositor, xevent);
+      return meta_xwayland_selection_handle_selection_request (compositor,
+                                                               xevent);
     case ClientMessage:
       return meta_xwayland_selection_handle_client_message (compositor, xevent);
     default:
-      {
-        MetaX11Display *x11_display = meta_get_display ()->x11_display;
+    {
+      MetaX11Display *x11_display = meta_get_display ()->x11_display;
 
-        if (xevent->type - x11_display->xfixes_event_base == XFixesSelectionNotify)
-          return meta_xwayland_selection_handle_xfixes_selection_notify (compositor, xevent);
+      if (xevent->type - x11_display->xfixes_event_base ==
+          XFixesSelectionNotify)
+        return meta_xwayland_selection_handle_xfixes_selection_notify (
+          compositor, xevent);
 
-        return FALSE;
-      }
+      return FALSE;
+    }
     }
 }
 
@@ -1733,8 +1781,8 @@ init_selection_bridge (MetaSelectionBridge *selection,
                    &attributes);
 
   mask = XFixesSetSelectionOwnerNotifyMask |
-    XFixesSelectionWindowDestroyNotifyMask |
-    XFixesSelectionClientCloseNotifyMask;
+         XFixesSelectionWindowDestroyNotifyMask |
+         XFixesSelectionClientCloseNotifyMask;
 
   XFixesSelectSelectionInput (xdisplay, selection->window,
                               selection_atom, mask);
@@ -1765,7 +1813,8 @@ meta_xwayland_init_selection (void)
 
   meta_xwayland_init_dnd (manager);
   init_selection_bridge (&manager->selection_data->clipboard,
-                         gdk_x11_get_xatom_by_name ("CLIPBOARD"),
+                         gdk_x11_get_xatom_by_name (
+                           "CLIPBOARD"),
                          &compositor->seat->data_device.selection_ownership_signal);
   init_selection_bridge (&manager->selection_data->primary,
                          gdk_x11_get_xatom_by_name ("PRIMARY"),
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
index be29033cf..0fe241b67 100644
--- a/src/wayland/meta-xwayland.c
+++ b/src/wayland/meta-xwayland.c
@@ -36,7 +36,8 @@
 #include "meta/main.h"
 #include "wayland/meta-wayland-actor-surface.h"
 
-enum {
+enum
+{
   XWAYLAND_SURFACE_WINDOW_ASSOCIATED,
 
   XWAYLAND_SURFACE_LAST_SIGNAL
@@ -44,7 +45,8 @@ enum {
 
 guint xwayland_surface_signals[XWAYLAND_SURFACE_LAST_SIGNAL];
 
-#define META_TYPE_WAYLAND_SURFACE_ROLE_XWAYLAND (meta_wayland_surface_role_xwayland_get_type ())
+#define META_TYPE_WAYLAND_SURFACE_ROLE_XWAYLAND ( \
+    meta_wayland_surface_role_xwayland_get_type ())
 G_DECLARE_FINAL_TYPE (MetaWaylandSurfaceRoleXWayland,
                       meta_wayland_surface_role_xwayland,
                       META, WAYLAND_SURFACE_ROLE_XWAYLAND,
@@ -62,8 +64,8 @@ G_DEFINE_TYPE (MetaWaylandSurfaceRoleXWayland,
 static int display_number_override = -1;
 
 void
-meta_xwayland_associate_window_with_surface (MetaWindow          *window,
-                                             MetaWaylandSurface  *surface)
+meta_xwayland_associate_window_with_surface (MetaWindow         *window,
+                                             MetaWaylandSurface *surface)
 {
   MetaDisplay *display = window->display;
 
@@ -155,7 +157,7 @@ try_display (int    display,
 
   filename = g_strdup_printf ("/tmp/.X%d-lock", display);
 
- again:
+again:
   fd = open (filename, O_WRONLY | O_CLOEXEC | O_CREAT | O_EXCL, 0444);
 
   if (fd < 0 && errno == EEXIST)
@@ -203,7 +205,7 @@ try_display (int    display,
 
   ret = TRUE;
 
- out:
+out:
   if (!ret)
     {
       g_free (filename);
@@ -471,7 +473,7 @@ meta_xwayland_start (MetaXWaylandManager *manager,
   int xwayland_client_fd[2];
   int displayfd[2];
   gboolean started = FALSE;
-  g_autoptr(GSubprocessLauncher) launcher = NULL;
+  g_autoptr (GSubprocessLauncher) launcher = NULL;
   GSubprocessFlags flags;
   GError *error = NULL;
 
@@ -480,7 +482,8 @@ meta_xwayland_start (MetaXWaylandManager *manager,
 
   /* We want xwayland to be a wayland client so we make a socketpair to setup a
    * wayland protocol connection. */
-  if (socketpair (AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, xwayland_client_fd) < 0)
+  if (socketpair (AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0,
+                  xwayland_client_fd) < 0)
     {
       g_warning ("xwayland_client_fd socketpair failed\n");
       goto out;
@@ -517,7 +520,8 @@ meta_xwayland_start (MetaXWaylandManager *manager,
    * want core dumps from Xwayland but only if a real bug occurs...
    */
   manager->proc = g_subprocess_launcher_spawn (launcher, &error,
-                                               XWAYLAND_PATH, manager->display_name,
+                                               XWAYLAND_PATH,
+                                               manager->display_name,
                                                "-rootless",
                                                "-terminate",
                                                "-accessx",
@@ -566,10 +570,10 @@ void
 meta_xwayland_complete_init (MetaDisplay *display)
 {
   /* We install an X IO error handler in addition to the child watch,
-     because after Xlib connects our child watch may not be called soon
-     enough, and therefore we won't crash when X exits (and most important
-     we won't reset the tty).
-  */
+   *  because after Xlib connects our child watch may not be called soon
+   *  enough, and therefore we won't crash when X exits (and most important
+   *  we won't reset the tty).
+   */
   XSetIOErrorHandler (x_io_error);
 
   g_signal_connect (display, "x11-display-closing",
@@ -603,7 +607,8 @@ xwayland_surface_assigned (MetaWaylandSurfaceRole *surface_role)
   MetaWaylandSurface *surface =
     meta_wayland_surface_role_get_surface (surface_role);
   MetaWaylandSurfaceRoleClass *surface_role_class =
-    META_WAYLAND_SURFACE_ROLE_CLASS (meta_wayland_surface_role_xwayland_parent_class);
+    META_WAYLAND_SURFACE_ROLE_CLASS (
+      meta_wayland_surface_role_xwayland_parent_class);
 
   /* See comment in xwayland_surface_commit for why we reply even though the
    * surface may not be drawn the next frame.
@@ -622,7 +627,8 @@ xwayland_surface_commit (MetaWaylandSurfaceRole  *surface_role,
   MetaWaylandSurface *surface =
     meta_wayland_surface_role_get_surface (surface_role);
   MetaWaylandSurfaceRoleClass *surface_role_class =
-    META_WAYLAND_SURFACE_ROLE_CLASS (meta_wayland_surface_role_xwayland_parent_class);
+    META_WAYLAND_SURFACE_ROLE_CLASS (
+      meta_wayland_surface_role_xwayland_parent_class);
 
   /* For Xwayland windows, throttling frames when the window isn't actually
    * drawn is less useful, because Xwayland still has to do the drawing sent
@@ -652,7 +658,8 @@ meta_wayland_surface_role_xwayland_init (MetaWaylandSurfaceRoleXWayland *role)
 }
 
 static void
-meta_wayland_surface_role_xwayland_class_init (MetaWaylandSurfaceRoleXWaylandClass *klass)
+meta_wayland_surface_role_xwayland_class_init (
+  MetaWaylandSurfaceRoleXWaylandClass *klass)
 {
   MetaWaylandSurfaceRoleClass *surface_role_class =
     META_WAYLAND_SURFACE_ROLE_CLASS (klass);
diff --git a/src/x11/events.c b/src/x11/events.c
index 517cf6ec5..181098ee8 100644
--- a/src/x11/events.c
+++ b/src/x11/events.c
@@ -67,27 +67,32 @@ get_input_event (MetaX11Display *x11_display,
         case XI_Motion:
         case XI_ButtonPress:
         case XI_ButtonRelease:
-          if (((XIDeviceEvent *) input_event)->deviceid == META_VIRTUAL_CORE_POINTER_ID)
+          if (((XIDeviceEvent *) input_event)->deviceid ==
+              META_VIRTUAL_CORE_POINTER_ID)
             return input_event;
           break;
         case XI_KeyPress:
         case XI_KeyRelease:
-          if (((XIDeviceEvent *) input_event)->deviceid == META_VIRTUAL_CORE_KEYBOARD_ID)
+          if (((XIDeviceEvent *) input_event)->deviceid ==
+              META_VIRTUAL_CORE_KEYBOARD_ID)
             return input_event;
           break;
         case XI_FocusIn:
         case XI_FocusOut:
-          if (((XIEnterEvent *) input_event)->deviceid == META_VIRTUAL_CORE_KEYBOARD_ID)
+          if (((XIEnterEvent *) input_event)->deviceid ==
+              META_VIRTUAL_CORE_KEYBOARD_ID)
             return input_event;
           break;
         case XI_Enter:
         case XI_Leave:
-          if (((XIEnterEvent *) input_event)->deviceid == META_VIRTUAL_CORE_POINTER_ID)
+          if (((XIEnterEvent *) input_event)->deviceid ==
+              META_VIRTUAL_CORE_POINTER_ID)
             return input_event;
           break;
         case XI_BarrierHit:
         case XI_BarrierLeave:
-          if (((XIBarrierEvent *) input_event)->deviceid == META_VIRTUAL_CORE_POINTER_ID)
+          if (((XIBarrierEvent *) input_event)->deviceid ==
+              META_VIRTUAL_CORE_POINTER_ID)
             return input_event;
           break;
         default:
@@ -129,7 +134,7 @@ xievent_get_modified_window (MetaX11Display *x11_display,
  */
 static Window
 event_get_modified_window (MetaX11Display *x11_display,
-                           XEvent *event)
+                           XEvent         *event)
 {
   XIEvent *input_event = get_input_event (x11_display, event);
 
@@ -168,7 +173,7 @@ event_get_modified_window (MetaX11Display *x11_display,
       return event->xmaprequest.window;
 
     case ReparentNotify:
-     return event->xreparent.window;
+      return event->xreparent.window;
 
     case ConfigureNotify:
       return event->xconfigure.window;
@@ -192,7 +197,7 @@ event_get_modified_window (MetaX11Display *x11_display,
       if (META_X11_DISPLAY_HAS_SHAPE (x11_display) &&
           event->type == (x11_display->shape_event_base + ShapeNotify))
         {
-          XShapeEvent *sev = (XShapeEvent*) event;
+          XShapeEvent *sev = (XShapeEvent *) event;
           return sev->window;
         }
 
@@ -244,20 +249,20 @@ event_get_time (MetaX11Display *x11_display,
     }
 }
 
-const char*
+const char *
 meta_event_detail_to_string (int d)
 {
   const char *detail = "???";
   switch (d)
     {
-      /* We are an ancestor in the A<->B focus change relationship */
+    /* We are an ancestor in the A<->B focus change relationship */
     case XINotifyAncestor:
       detail = "NotifyAncestor";
       break;
     case XINotifyDetailNone:
       detail = "NotifyDetailNone";
       break;
-      /* We are a descendant in the A<->B focus change relationship */
+    /* We are a descendant in the A<->B focus change relationship */
     case XINotifyInferior:
       detail = "NotifyInferior";
       break;
@@ -281,7 +286,7 @@ meta_event_detail_to_string (int d)
   return detail;
 }
 
-const char*
+const char *
 meta_event_mode_to_string (int m)
 {
   const char *mode = "???";
@@ -304,7 +309,7 @@ meta_event_mode_to_string (int m)
   return mode;
 }
 
-G_GNUC_UNUSED static const char*
+G_GNUC_UNUSED static const char *
 stack_mode_to_string (int mode)
 {
   switch (mode)
@@ -330,12 +335,12 @@ sync_value_to_64 (const XSyncValue *value)
   gint64 v;
 
   v = XSyncValueLow32 (*value);
-  v |= (((gint64)XSyncValueHigh32 (*value)) << 32);
+  v |= (((gint64) XSyncValueHigh32 (*value)) << 32);
 
   return v;
 }
 
-static const char*
+static const char *
 alarm_state_to_string (XSyncAlarmState state)
 {
   switch (state)
@@ -389,19 +394,22 @@ meta_spew_xi2_event (MetaX11Display *x11_display,
     case XI_FocusIn:
     case XI_FocusOut:
       extra = g_strdup_printf ("detail: %s mode: %s\n",
-                               meta_event_detail_to_string (enter_event->detail),
+                               meta_event_detail_to_string (
+                                 enter_event->detail),
                                meta_event_mode_to_string (enter_event->mode));
       break;
     case XI_Enter:
     case XI_Leave:
-      extra = g_strdup_printf ("win: 0x%lx root: 0x%lx mode: %s detail: %s focus: %d x: %g y: %g",
-                               enter_event->event,
-                               enter_event->root,
-                               meta_event_mode_to_string (enter_event->mode),
-                               meta_event_detail_to_string (enter_event->detail),
-                               enter_event->focus,
-                               enter_event->root_x,
-                               enter_event->root_y);
+      extra = g_strdup_printf (
+        "win: 0x%lx root: 0x%lx mode: %s detail: %s focus: %d x: %g y: %g",
+        enter_event->event,
+        enter_event->root,
+        meta_event_mode_to_string (enter_event->mode),
+        meta_event_detail_to_string (
+          enter_event->detail),
+        enter_event->focus,
+        enter_event->root_x,
+        enter_event->root_y);
       break;
     }
 
@@ -456,10 +464,11 @@ meta_spew_core_event (MetaX11Display *x11_display,
       break;
     case MapNotify:
       name = "MapNotify";
-      extra = g_strdup_printf ("event: 0x%lx window: 0x%lx override_redirect: %d",
-                               event->xmap.event,
-                               event->xmap.window,
-                               event->xmap.override_redirect);
+      extra = g_strdup_printf (
+        "event: 0x%lx window: 0x%lx override_redirect: %d",
+        event->xmap.event,
+        event->xmap.window,
+        event->xmap.override_redirect);
       break;
     case MapRequest:
       name = "MapRequest";
@@ -476,40 +485,43 @@ meta_spew_core_event (MetaX11Display *x11_display,
       break;
     case ConfigureNotify:
       name = "ConfigureNotify";
-      extra = g_strdup_printf ("x: %d y: %d w: %d h: %d above: 0x%lx override_redirect: %d",
-                               event->xconfigure.x,
-                               event->xconfigure.y,
-                               event->xconfigure.width,
-                               event->xconfigure.height,
-                               event->xconfigure.above,
-                               event->xconfigure.override_redirect);
+      extra = g_strdup_printf (
+        "x: %d y: %d w: %d h: %d above: 0x%lx override_redirect: %d",
+        event->xconfigure.x,
+        event->xconfigure.y,
+        event->xconfigure.width,
+        event->xconfigure.height,
+        event->xconfigure.above,
+        event->xconfigure.override_redirect);
       break;
     case ConfigureRequest:
       name = "ConfigureRequest";
-      extra = g_strdup_printf ("parent: 0x%lx window: 0x%lx x: %d %sy: %d %sw: %d %sh: %d %sborder: %d 
%sabove: %lx %sstackmode: %s %s",
-                               event->xconfigurerequest.parent,
-                               event->xconfigurerequest.window,
-                               event->xconfigurerequest.x,
-                               event->xconfigurerequest.value_mask &
-                               CWX ? "" : "(unset) ",
-                               event->xconfigurerequest.y,
-                               event->xconfigurerequest.value_mask &
-                               CWY ? "" : "(unset) ",
-                               event->xconfigurerequest.width,
-                               event->xconfigurerequest.value_mask &
-                               CWWidth ? "" : "(unset) ",
-                               event->xconfigurerequest.height,
-                               event->xconfigurerequest.value_mask &
-                               CWHeight ? "" : "(unset) ",
-                               event->xconfigurerequest.border_width,
-                               event->xconfigurerequest.value_mask &
-                               CWBorderWidth ? "" : "(unset)",
-                               event->xconfigurerequest.above,
-                               event->xconfigurerequest.value_mask &
-                               CWSibling ? "" : "(unset)",
-                               stack_mode_to_string (event->xconfigurerequest.detail),
-                               event->xconfigurerequest.value_mask &
-                               CWStackMode ? "" : "(unset)");
+      extra = g_strdup_printf (
+        "parent: 0x%lx window: 0x%lx x: %d %sy: %d %sw: %d %sh: %d %sborder: %d %sabove: %lx %sstackmode: %s 
%s",
+        event->xconfigurerequest.parent,
+        event->xconfigurerequest.window,
+        event->xconfigurerequest.x,
+        event->xconfigurerequest.value_mask &
+        CWX ? "" : "(unset) ",
+        event->xconfigurerequest.y,
+        event->xconfigurerequest.value_mask &
+        CWY ? "" : "(unset) ",
+        event->xconfigurerequest.width,
+        event->xconfigurerequest.value_mask &
+        CWWidth ? "" : "(unset) ",
+        event->xconfigurerequest.height,
+        event->xconfigurerequest.value_mask &
+        CWHeight ? "" : "(unset) ",
+        event->xconfigurerequest.border_width,
+        event->xconfigurerequest.value_mask &
+        CWBorderWidth ? "" : "(unset)",
+        event->xconfigurerequest.above,
+        event->xconfigurerequest.value_mask &
+        CWSibling ? "" : "(unset)",
+        stack_mode_to_string (event->xconfigurerequest.
+                              detail),
+        event->xconfigurerequest.value_mask &
+        CWStackMode ? "" : "(unset)");
       break;
     case GravityNotify:
       name = "GravityNotify";
@@ -527,30 +539,30 @@ meta_spew_core_event (MetaX11Display *x11_display,
       name = "CirculateRequest";
       break;
     case PropertyNotify:
-      {
-        char *str;
-        const char *state;
-
-        name = "PropertyNotify";
-
-        meta_x11_error_trap_push (x11_display);
-        str = XGetAtomName (x11_display->xdisplay,
-                            event->xproperty.atom);
-        meta_x11_error_trap_pop (x11_display);
-
-        if (event->xproperty.state == PropertyNewValue)
-          state = "PropertyNewValue";
-        else if (event->xproperty.state == PropertyDelete)
-          state = "PropertyDelete";
-        else
-          state = "???";
-
-        extra = g_strdup_printf ("atom: %s state: %s",
-                                 str ? str : "(unknown atom)",
-                                 state);
-        meta_XFree (str);
-      }
-      break;
+    {
+      char *str;
+      const char *state;
+
+      name = "PropertyNotify";
+
+      meta_x11_error_trap_push (x11_display);
+      str = XGetAtomName (x11_display->xdisplay,
+                          event->xproperty.atom);
+      meta_x11_error_trap_pop (x11_display);
+
+      if (event->xproperty.state == PropertyNewValue)
+        state = "PropertyNewValue";
+      else if (event->xproperty.state == PropertyDelete)
+        state = "PropertyDelete";
+      else
+        state = "???";
+
+      extra = g_strdup_printf ("atom: %s state: %s",
+                               str ? str : "(unknown atom)",
+                               state);
+      meta_XFree (str);
+    }
+    break;
     case SelectionClear:
       name = "SelectionClear";
       break;
@@ -564,19 +576,19 @@ meta_spew_core_event (MetaX11Display *x11_display,
       name = "ColormapNotify";
       break;
     case ClientMessage:
-      {
-        char *str;
-        name = "ClientMessage";
-        meta_x11_error_trap_push (x11_display);
-        str = XGetAtomName (x11_display->xdisplay,
-                            event->xclient.message_type);
-        meta_x11_error_trap_pop (x11_display);
-        extra = g_strdup_printf ("type: %s format: %d\n",
-                                 str ? str : "(unknown atom)",
-                                 event->xclient.format);
-        meta_XFree (str);
-      }
-      break;
+    {
+      char *str;
+      name = "ClientMessage";
+      meta_x11_error_trap_push (x11_display);
+      str = XGetAtomName (x11_display->xdisplay,
+                          event->xclient.message_type);
+      meta_x11_error_trap_pop (x11_display);
+      extra = g_strdup_printf ("type: %s format: %d\n",
+                               str ? str : "(unknown atom)",
+                               event->xclient.format);
+      meta_XFree (str);
+    }
+    break;
     case MappingNotify:
       name = "MappingNotify";
       break;
@@ -584,7 +596,7 @@ meta_spew_core_event (MetaX11Display *x11_display,
       if (META_X11_DISPLAY_HAS_XSYNC (x11_display) &&
           event->type == (x11_display->xsync_event_base + XSyncAlarmNotify))
         {
-          XSyncAlarmNotifyEvent *aevent = (XSyncAlarmNotifyEvent*) event;
+          XSyncAlarmNotifyEvent *aevent = (XSyncAlarmNotifyEvent *) event;
 
           name = "XSyncAlarmNotify";
           extra =
@@ -595,33 +607,33 @@ meta_spew_core_event (MetaX11Display *x11_display,
                              aevent->alarm,
                              (gint64) sync_value_to_64 (&aevent->counter_value),
                              (gint64) sync_value_to_64 (&aevent->alarm_value),
-                             (unsigned int)aevent->time,
+                             (unsigned int) aevent->time,
                              alarm_state_to_string (aevent->state));
         }
       else
-        if (META_X11_DISPLAY_HAS_SHAPE (x11_display) &&
-            event->type == (x11_display->shape_event_base + ShapeNotify))
-          {
-            XShapeEvent *sev = (XShapeEvent*) event;
-
-            name = "ShapeNotify";
-
-            extra =
-              g_strdup_printf ("kind: %s "
-                               "x: %d y: %d w: %u h: %u "
-                               "shaped: %d",
-                               sev->kind == ShapeBounding ?
-                               "ShapeBounding" :
-                               (sev->kind == ShapeClip ?
-                                "ShapeClip" : "(unknown)"),
-                               sev->x, sev->y, sev->width, sev->height,
-                               sev->shaped);
-          }
-        else
-          {
-            name = "(Unknown event)";
-            extra = g_strdup_printf ("type: %d", event->xany.type);
-          }
+      if (META_X11_DISPLAY_HAS_SHAPE (x11_display) &&
+          event->type == (x11_display->shape_event_base + ShapeNotify))
+        {
+          XShapeEvent *sev = (XShapeEvent *) event;
+
+          name = "ShapeNotify";
+
+          extra =
+            g_strdup_printf ("kind: %s "
+                             "x: %d y: %d w: %u h: %u "
+                             "shaped: %d",
+                             sev->kind == ShapeBounding ?
+                             "ShapeBounding" :
+                             (sev->kind == ShapeClip ?
+                              "ShapeClip" : "(unknown)"),
+                             sev->x, sev->y, sev->width, sev->height,
+                             sev->shaped);
+        }
+      else
+        {
+          name = "(Unknown event)";
+          extra = g_strdup_printf ("type: %d", event->xany.type);
+        }
       break;
     }
 
@@ -899,7 +911,8 @@ handle_input_xevent (MetaX11Display *x11_display,
       break;
     case XI_FocusIn:
     case XI_FocusOut:
-      if (handle_window_focus_event (x11_display, window, enter_event, serial) &&
+      if (handle_window_focus_event (x11_display, window, enter_event,
+                                     serial) &&
           enter_event->event == enter_event->root)
         {
           if (enter_event->evtype == XI_FocusIn &&
@@ -909,9 +922,11 @@ handle_input_xevent (MetaX11Display *x11_display,
                           "Focus got set to None, probably due to "
                           "brain-damage in the X protocol (see bug "
                           "125492).  Setting the default focus window.\n");
-              meta_workspace_focus_default_window (workspace_manager->active_workspace,
-                                                   NULL,
-                                                   meta_x11_display_get_current_time_roundtrip 
(x11_display));
+              meta_workspace_focus_default_window (
+                workspace_manager->active_workspace,
+                NULL,
+                meta_x11_display_get_current_time_roundtrip (
+                  x11_display));
             }
           else if (enter_event->evtype == XI_FocusIn &&
                    enter_event->mode == XINotifyNormal &&
@@ -921,15 +936,18 @@ handle_input_xevent (MetaX11Display *x11_display,
                           "Focus got set to root window, probably due to "
                           "gnome-session logout dialog usage (see bug "
                           "153220).  Setting the default focus window.\n");
-              meta_workspace_focus_default_window (workspace_manager->active_workspace,
-                                                   NULL,
-                                                   meta_x11_display_get_current_time_roundtrip 
(x11_display));
+              meta_workspace_focus_default_window (
+                workspace_manager->active_workspace,
+                NULL,
+                meta_x11_display_get_current_time_roundtrip (
+                  x11_display));
             }
         }
       break;
     }
 
-  /* Don't eat events for GTK frames (we need to update the :hover state on buttons) */
+  /* Don't eat events for GTK frames (we need to update the :hover state on
+   * buttons) */
   if (window && window->frame && modified == window->frame->xwindow)
     return FALSE;
 
@@ -979,7 +997,7 @@ process_request_frame_extents (MetaX11Display *x11_display,
   XChangeProperty (x11_display->xdisplay, xwindow,
                    x11_display->atom__NET_FRAME_EXTENTS,
                    XA_CARDINAL,
-                   32, PropModeReplace, (guchar*) data, 4);
+                   32, PropModeReplace, (guchar *) data, 4);
   meta_x11_error_trap_pop (x11_display);
 
   meta_XFree (hints);
@@ -1004,16 +1022,16 @@ convert_property (MetaX11Display *x11_display,
   meta_x11_error_trap_push (x11_display);
   if (target == x11_display->atom_TARGETS)
     XChangeProperty (x11_display->xdisplay, w, property,
-                    XA_ATOM, 32, PropModeReplace,
-                    (unsigned char *)conversion_targets, N_TARGETS);
+                     XA_ATOM, 32, PropModeReplace,
+                     (unsigned char *) conversion_targets, N_TARGETS);
   else if (target == x11_display->atom_TIMESTAMP)
     XChangeProperty (x11_display->xdisplay, w, property,
-                    XA_INTEGER, 32, PropModeReplace,
-                     (unsigned char *)&x11_display->wm_sn_timestamp, 1);
+                     XA_INTEGER, 32, PropModeReplace,
+                     (unsigned char *) &x11_display->wm_sn_timestamp, 1);
   else if (target == x11_display->atom_VERSION)
     XChangeProperty (x11_display->xdisplay, w, property,
-                    XA_INTEGER, 32, PropModeReplace,
-                    (unsigned char *)icccm_version, 2);
+                     XA_INTEGER, 32, PropModeReplace,
+                     (unsigned char *) icccm_version, 2);
   else
     {
       meta_x11_error_trap_pop_with_return (x11_display);
@@ -1050,8 +1068,9 @@ process_selection_request (MetaX11Display *x11_display,
                           event->xselectionrequest.selection);
       meta_x11_error_trap_pop (x11_display);
 
-      meta_verbose ("Selection request with selection %s window 0x%lx not a WM_Sn selection we recognize\n",
-                    str ? str : "(bad atom)", event->xselectionrequest.owner);
+      meta_verbose (
+        "Selection request with selection %s window 0x%lx not a WM_Sn selection we recognize\n",
+        str ? str : "(bad atom)", event->xselectionrequest.owner);
 
       meta_XFree (str);
 
@@ -1078,9 +1097,11 @@ process_selection_request (MetaX11Display *x11_display,
           meta_x11_error_trap_push (x11_display);
           if (XGetWindowProperty (x11_display->xdisplay,
                                   event->xselectionrequest.requestor,
-                                  event->xselectionrequest.property, 0, 256, False,
+                                  event->xselectionrequest.property, 0, 256,
+                                  False,
                                   x11_display->atom_ATOM_PAIR,
-                                  &type, &format, &num, &rest, &data) != Success)
+                                  &type, &format, &num, &rest,
+                                  &data) != Success)
             {
               meta_x11_error_trap_pop_with_return (x11_display);
               return;
@@ -1092,14 +1113,14 @@ process_selection_request (MetaX11Display *x11_display,
                * but since we have 4 possible targets, we will hardly ever
                * meet multiple requests with a length > 8
                */
-              adata = (Atom*)data;
+              adata = (Atom *) data;
               i = 0;
               while (i < (int) num)
                 {
                   if (!convert_property (x11_display,
                                          event->xselectionrequest.requestor,
-                                         adata[i], adata[i+1]))
-                    adata[i+1] = None;
+                                         adata[i], adata[i + 1]))
+                    adata[i + 1] = None;
                   i += 2;
                 }
 
@@ -1128,7 +1149,7 @@ process_selection_request (MetaX11Display *x11_display,
 
   XSendEvent (x11_display->xdisplay,
               event->xselectionrequest.requestor,
-              False, 0L, (XEvent*)&reply);
+              False, 0L, (XEvent *) &reply);
 
   meta_verbose ("Handled selection request\n");
 }
@@ -1159,8 +1180,9 @@ process_selection_clear (MetaX11Display *x11_display,
                           event->xselectionclear.selection);
       meta_x11_error_trap_pop (x11_display);
 
-      meta_verbose ("Selection clear with selection %s window 0x%lx not a WM_Sn selection we recognize\n",
-                    str ? str : "(bad atom)", event->xselectionclear.window);
+      meta_verbose (
+        "Selection clear with selection %s window 0x%lx not a WM_Sn selection we recognize\n",
+        str ? str : "(bad atom)", event->xselectionclear.window);
 
       meta_XFree (str);
 
@@ -1174,7 +1196,8 @@ process_selection_clear (MetaX11Display *x11_display,
   if (!x11_display->display_close_idle)
     {
       x11_display->xselectionclear_timestamp = event->xselectionclear.time;
-      x11_display->display_close_idle = g_idle_add (close_display_idle_cb, x11_display);
+      x11_display->display_close_idle = g_idle_add (close_display_idle_cb,
+                                                    x11_display);
     }
 
   return TRUE;
@@ -1185,7 +1208,7 @@ notify_bell (MetaX11Display *x11_display,
              XkbAnyEvent    *xkb_ev)
 {
   MetaDisplay *display = x11_display->display;
-  XkbBellNotifyEvent *xkb_bell_event = (XkbBellNotifyEvent*) xkb_ev;
+  XkbBellNotifyEvent *xkb_bell_event = (XkbBellNotifyEvent *) xkb_ev;
   MetaWindow *window;
 
   window = meta_x11_display_lookup_x_window (x11_display,
@@ -1219,8 +1242,10 @@ handle_other_xevent (MetaX11Display *x11_display,
   gboolean bypass_gtk = FALSE;
 
   modified = event_get_modified_window (x11_display, event);
-  window = modified != None ? meta_x11_display_lookup_x_window (x11_display, modified) : NULL;
-  frame_was_receiver = (window && window->frame && modified == window->frame->xwindow);
+  window = modified != None ? meta_x11_display_lookup_x_window (x11_display,
+                                                                modified) : NULL;
+  frame_was_receiver =
+    (window && window->frame && modified == window->frame->xwindow);
 
   /* We only want to respond to _NET_WM_USER_TIME property notify
    * events on _NET_WM_USER_TIME_WINDOW windows; in particular,
@@ -1236,22 +1261,26 @@ handle_other_xevent (MetaX11Display *x11_display,
   if (META_X11_DISPLAY_HAS_XSYNC (x11_display) &&
       event->type == (x11_display->xsync_event_base + XSyncAlarmNotify))
     {
-      MetaWindow *alarm_window = meta_x11_display_lookup_sync_alarm (x11_display,
-                                                                     ((XSyncAlarmNotifyEvent*)event)->alarm);
+      MetaWindow *alarm_window = meta_x11_display_lookup_sync_alarm (
+        x11_display,
+        ((
+           XSyncAlarmNotifyEvent *) event)->alarm);
 
       if (alarm_window != NULL)
         {
-          XSyncValue value = ((XSyncAlarmNotifyEvent*)event)->counter_value;
+          XSyncValue value = ((XSyncAlarmNotifyEvent *) event)->counter_value;
           gint64 new_counter_value;
-          new_counter_value = XSyncValueLow32 (value) + ((gint64)XSyncValueHigh32 (value) << 32);
-          meta_window_x11_update_sync_request_counter (alarm_window, new_counter_value);
+          new_counter_value = XSyncValueLow32 (value) +
+                              ((gint64) XSyncValueHigh32 (value) << 32);
+          meta_window_x11_update_sync_request_counter (alarm_window,
+                                                       new_counter_value);
           bypass_gtk = TRUE; /* GTK doesn't want to see this really */
         }
       else
         {
           if (x11_display->alarm_filter &&
               x11_display->alarm_filter (x11_display,
-                                         (XSyncAlarmNotifyEvent*)event,
+                                         (XSyncAlarmNotifyEvent *) event,
                                          x11_display->alarm_filter_data))
             bypass_gtk = TRUE;
         }
@@ -1266,7 +1295,7 @@ handle_other_xevent (MetaX11Display *x11_display,
 
       if (window && !frame_was_receiver)
         {
-          XShapeEvent *sev = (XShapeEvent*) event;
+          XShapeEvent *sev = (XShapeEvent *) event;
 
           if (sev->kind == ShapeBounding)
             meta_window_x11_update_shape_region (window);
@@ -1297,19 +1326,19 @@ handle_other_xevent (MetaX11Display *x11_display,
     case VisibilityNotify:
       break;
     case CreateNotify:
-      {
-        if (event->xcreatewindow.parent == x11_display->xroot)
-          meta_stack_tracker_create_event (display->stack_tracker,
-                                           &event->xcreatewindow);
-      }
-      break;
+    {
+      if (event->xcreatewindow.parent == x11_display->xroot)
+        meta_stack_tracker_create_event (display->stack_tracker,
+                                         &event->xcreatewindow);
+    }
+    break;
 
     case DestroyNotify:
-      {
-        if (event->xdestroywindow.event == x11_display->xroot)
-          meta_stack_tracker_destroy_event (display->stack_tracker,
-                                            &event->xdestroywindow);
-      }
+    {
+      if (event->xdestroywindow.event == x11_display->xroot)
+        meta_stack_tracker_destroy_event (display->stack_tracker,
+                                          &event->xdestroywindow);
+    }
       if (window)
         {
           /* FIXME: It sucks that DestroyNotify events don't come with
@@ -1325,8 +1354,9 @@ handle_other_xevent (MetaX11Display *x11_display,
 
           if (frame_was_receiver)
             {
-              meta_warning ("Unexpected destruction of frame 0x%lx, not sure if this should silently fail or 
be considered a bug\n",
-                            window->frame->xwindow);
+              meta_warning (
+                "Unexpected destruction of frame 0x%lx, not sure if this should silently fail or be 
considered a bug\n",
+                window->frame->xwindow);
               meta_x11_error_trap_push (x11_display);
               meta_window_destroy_frame (window->frame->window);
               meta_x11_error_trap_pop (x11_display);
@@ -1421,20 +1451,21 @@ handle_other_xevent (MetaX11Display *x11_display,
           meta_window_unminimize (window);
           if (window->workspace != workspace_manager->active_workspace)
             {
-              meta_verbose ("Changing workspace due to MapRequest mapped = %d minimized = %d\n",
-                            window->mapped, window->minimized);
+              meta_verbose (
+                "Changing workspace due to MapRequest mapped = %d minimized = %d\n",
+                window->mapped, window->minimized);
               meta_window_change_workspace (window,
                                             workspace_manager->active_workspace);
             }
         }
       break;
     case ReparentNotify:
-      {
-        if (event->xreparent.event == x11_display->xroot)
-          meta_stack_tracker_reparent_event (display->stack_tracker,
-                                             &event->xreparent);
-      }
-      break;
+    {
+      if (event->xreparent.event == x11_display->xroot)
+        meta_stack_tracker_reparent_event (display->stack_tracker,
+                                           &event->xreparent);
+    }
+    break;
     case ConfigureNotify:
       if (event->xconfigure.event != event->xconfigure.window)
         {
@@ -1462,7 +1493,7 @@ handle_other_xevent (MetaX11Display *x11_display,
           XWindowChanges xwc;
 
           xwcm = event->xconfigurerequest.value_mask &
-            (CWX | CWY | CWWidth | CWHeight | CWBorderWidth);
+                 (CWX | CWY | CWWidth | CWHeight | CWBorderWidth);
 
           xwc.x = event->xconfigurerequest.x;
           xwc.y = event->xconfigurerequest.y;
@@ -1470,10 +1501,12 @@ handle_other_xevent (MetaX11Display *x11_display,
           xwc.height = event->xconfigurerequest.height;
           xwc.border_width = event->xconfigurerequest.border_width;
 
-          meta_verbose ("Configuring withdrawn window to %d,%d %dx%d border %d (some values may not be in 
mask)\n",
-                        xwc.x, xwc.y, xwc.width, xwc.height, xwc.border_width);
+          meta_verbose (
+            "Configuring withdrawn window to %d,%d %dx%d border %d (some values may not be in mask)\n",
+            xwc.x, xwc.y, xwc.width, xwc.height, xwc.border_width);
           meta_x11_error_trap_push (x11_display);
-          XConfigureWindow (x11_display->xdisplay, event->xconfigurerequest.window,
+          XConfigureWindow (x11_display->xdisplay,
+                            event->xconfigurerequest.window,
                             xwcm, &xwc);
           meta_x11_error_trap_pop (x11_display);
         }
@@ -1492,40 +1525,40 @@ handle_other_xevent (MetaX11Display *x11_display,
     case CirculateRequest:
       break;
     case PropertyNotify:
-      {
-        MetaGroup *group;
-
-        if (window && !frame_was_receiver)
-          meta_window_x11_property_notify (window, event);
-        else if (property_for_window && !frame_was_receiver)
-          meta_window_x11_property_notify (property_for_window, event);
-
-        group = meta_x11_display_lookup_group (x11_display,
-                                               event->xproperty.window);
-        if (group != NULL)
-          meta_group_property_notify (group, event);
-
-        if (event->xproperty.window == x11_display->xroot)
-          {
-            if (event->xproperty.atom ==
-                x11_display->atom__NET_DESKTOP_LAYOUT)
-              meta_x11_display_update_workspace_layout (x11_display);
-            else if (event->xproperty.atom ==
-                     x11_display->atom__NET_DESKTOP_NAMES)
-              meta_x11_display_update_workspace_names (x11_display);
-
-            /* we just use this property as a sentinel to avoid
-             * certain race conditions.  See the comment for the
-             * sentinel_counter variable declaration in display.h
-             */
-            if (event->xproperty.atom ==
-                x11_display->atom__MUTTER_SENTINEL)
-              {
-                meta_display_decrement_focus_sentinel (display);
-              }
-          }
-      }
-      break;
+    {
+      MetaGroup *group;
+
+      if (window && !frame_was_receiver)
+        meta_window_x11_property_notify (window, event);
+      else if (property_for_window && !frame_was_receiver)
+        meta_window_x11_property_notify (property_for_window, event);
+
+      group = meta_x11_display_lookup_group (x11_display,
+                                             event->xproperty.window);
+      if (group != NULL)
+        meta_group_property_notify (group, event);
+
+      if (event->xproperty.window == x11_display->xroot)
+        {
+          if (event->xproperty.atom ==
+              x11_display->atom__NET_DESKTOP_LAYOUT)
+            meta_x11_display_update_workspace_layout (x11_display);
+          else if (event->xproperty.atom ==
+                   x11_display->atom__NET_DESKTOP_NAMES)
+            meta_x11_display_update_workspace_names (x11_display);
+
+          /* we just use this property as a sentinel to avoid
+           * certain race conditions.  See the comment for the
+           * sentinel_counter variable declaration in display.h
+           */
+          if (event->xproperty.atom ==
+              x11_display->atom__MUTTER_SENTINEL)
+            {
+              meta_display_decrement_focus_sentinel (display);
+            }
+        }
+    }
+    break;
     case SelectionRequest:
       process_selection_request (x11_display, event);
       break;
@@ -1547,7 +1580,8 @@ handle_other_xevent (MetaX11Display *x11_display,
             {
               if (meta_is_wayland_compositor ())
                 g_object_set (G_OBJECT (window),
-                              "xwayland-may-grab-keyboard", (event->xclient.data.l[0] != 0),
+                              "xwayland-may-grab-keyboard",
+                              (event->xclient.data.l[0] != 0),
                               NULL);
             }
           else
@@ -1571,9 +1605,11 @@ handle_other_xevent (MetaX11Display *x11_display,
 
                   meta_verbose ("Request to change current workspace to %d with "
                                 "specified timestamp of %u\n",
-                                space, time);
+                                space,
+                                time);
 
-                  workspace = meta_workspace_manager_get_workspace_by_index (workspace_manager, space);
+                  workspace = meta_workspace_manager_get_workspace_by_index (
+                    workspace_manager, space);
 
                   /* Handle clients using the older version of the spec... */
                   if (time == 0 && workspace)
@@ -1581,7 +1617,8 @@ handle_other_xevent (MetaX11Display *x11_display,
                       meta_warning ("Received a NET_CURRENT_DESKTOP message "
                                     "from a broken (outdated) client who sent "
                                     "a 0 timestamp\n");
-                      time = meta_x11_display_get_current_time_roundtrip (x11_display);
+                      time = meta_x11_display_get_current_time_roundtrip (
+                        x11_display);
                     }
 
                   if (workspace)
@@ -1605,20 +1642,23 @@ handle_other_xevent (MetaX11Display *x11_display,
                        x11_display->atom__NET_SHOWING_DESKTOP)
                 {
                   gboolean showing_desktop;
-                  guint32  timestamp;
+                  guint32 timestamp;
 
                   showing_desktop = event->xclient.data.l[0] != 0;
                   /* FIXME: Braindead protocol doesn't have a timestamp */
-                  timestamp = meta_x11_display_get_current_time_roundtrip (x11_display);
+                  timestamp = meta_x11_display_get_current_time_roundtrip (
+                    x11_display);
                   meta_verbose ("Request to %s desktop\n",
                                 showing_desktop ? "show" : "hide");
 
                   if (showing_desktop)
-                    meta_workspace_manager_show_desktop (workspace_manager, timestamp);
+                    meta_workspace_manager_show_desktop (workspace_manager,
+                                                         timestamp);
                   else
                     {
                       meta_workspace_manager_unshow_desktop (workspace_manager);
-                      meta_workspace_focus_default_window (workspace_manager->active_workspace, NULL, 
timestamp);
+                      meta_workspace_focus_default_window (
+                        workspace_manager->active_workspace, NULL, timestamp);
                     }
                 }
               else if (event->xclient.message_type ==
@@ -1626,7 +1666,8 @@ handle_other_xevent (MetaX11Display *x11_display,
                 {
                   meta_verbose ("Received WM_PROTOCOLS message\n");
 
-                  if ((Atom)event->xclient.data.l[0] == x11_display->atom__NET_WM_PING)
+                  if ((Atom) event->xclient.data.l[0] ==
+                      x11_display->atom__NET_WM_PING)
                     {
                       guint32 timestamp = event->xclient.data.l[1];
 
@@ -1650,34 +1691,34 @@ handle_other_xevent (MetaX11Display *x11_display,
         }
       break;
     case MappingNotify:
-      {
-        gboolean ignore_current;
-
-        ignore_current = FALSE;
-
-        /* Check whether the next event is an identical MappingNotify
-         * event.  If it is, ignore the current event, we'll update
-         * when we get the next one.
-         */
-        if (XPending (x11_display->xdisplay))
-          {
-            XEvent next_event;
-
-            XPeekEvent (x11_display->xdisplay, &next_event);
-
-            if (next_event.type == MappingNotify &&
-                next_event.xmapping.request == event->xmapping.request)
-              ignore_current = TRUE;
-          }
-
-        if (!ignore_current)
-          {
-            /* Let XLib know that there is a new keyboard mapping.
-             */
-            XRefreshKeyboardMapping (&event->xmapping);
-          }
-      }
-      break;
+    {
+      gboolean ignore_current;
+
+      ignore_current = FALSE;
+
+      /* Check whether the next event is an identical MappingNotify
+       * event.  If it is, ignore the current event, we'll update
+       * when we get the next one.
+       */
+      if (XPending (x11_display->xdisplay))
+        {
+          XEvent next_event;
+
+          XPeekEvent (x11_display->xdisplay, &next_event);
+
+          if (next_event.type == MappingNotify &&
+              next_event.xmapping.request == event->xmapping.request)
+            ignore_current = TRUE;
+        }
+
+      if (!ignore_current)
+        {
+          /* Let XLib know that there is a new keyboard mapping.
+           */
+          XRefreshKeyboardMapping (&event->xmapping);
+        }
+    }
+    break;
     default:
       if (event->type == x11_display->xkb_base_event_type)
         {
@@ -1686,8 +1727,8 @@ handle_other_xevent (MetaX11Display *x11_display,
           switch (xkb_ev->xkb_type)
             {
             case XkbBellNotify:
-              if (XSERVER_TIME_IS_BEFORE(x11_display->last_bell_time,
-                                         xkb_ev->time - 100))
+              if (XSERVER_TIME_IS_BEFORE (x11_display->last_bell_time,
+                                          xkb_ev->time - 100))
                 {
                   notify_bell (x11_display, xkb_ev);
                 }
@@ -1699,7 +1740,7 @@ handle_other_xevent (MetaX11Display *x11_display,
       break;
     }
 
- out:
+out:
   return bypass_gtk;
 }
 
@@ -1768,13 +1809,16 @@ meta_x11_display_handle_xevent (MetaX11Display *x11_display,
   if (display->focused_by_us &&
       event->xany.serial > x11_display->focus_serial &&
       display->focus_window &&
-      !window_has_xwindow (display->focus_window, x11_display->server_focus_window))
+      !window_has_xwindow (display->focus_window,
+                           x11_display->server_focus_window))
     {
       meta_topic (META_DEBUG_FOCUS, "Earlier attempt to focus %s failed\n",
                   display->focus_window->desc);
       meta_display_update_focus_window (display,
-                                        meta_x11_display_lookup_x_window (x11_display,
-                                                                          x11_display->server_focus_window),
+                                        meta_x11_display_lookup_x_window (
+                                          x11_display,
+                                          x11_display
+                                          ->server_focus_window),
                                         x11_display->server_focus_window,
                                         x11_display->server_focus_serial,
                                         FALSE);
@@ -1799,7 +1843,8 @@ meta_x11_display_handle_xevent (MetaX11Display *x11_display,
       if (meta_ui_window_should_not_cause_focus (x11_display->xdisplay,
                                                  modified))
         {
-          meta_display_add_ignored_crossing_serial (display, event->xany.serial);
+          meta_display_add_ignored_crossing_serial (display,
+                                                    event->xany.serial);
           meta_topic (META_DEBUG_FOCUS,
                       "Adding EnterNotify serial %lu to ignored focus serials\n",
                       event->xany.serial);
@@ -1833,11 +1878,12 @@ meta_x11_display_handle_xevent (MetaX11Display *x11_display,
         }
     }
 
- out:
+out:
   if (!bypass_compositor)
     {
       MetaWindow *window = modified != None ?
-                           meta_x11_display_lookup_x_window (x11_display, modified) :
+                           meta_x11_display_lookup_x_window (x11_display,
+                                                             modified) :
                            NULL;
 
       if (meta_compositor_process_event (display->compositor, event, window))
diff --git a/src/x11/group-props.c b/src/x11/group-props.c
index a906696c3..4e2853085 100644
--- a/src/x11/group-props.c
+++ b/src/x11/group-props.c
@@ -29,26 +29,26 @@
 #include "x11/meta-x11-display-private.h"
 #include "x11/xprops.h"
 
-typedef void (* InitValueFunc)   (MetaX11Display *x11_display,
-                                  Atom            property,
-                                  MetaPropValue  *value);
-typedef void (* ReloadValueFunc) (MetaGroup      *group,
-                                  MetaPropValue  *value);
+typedef void (*InitValueFunc)   (MetaX11Display *x11_display,
+                                 Atom            property,
+                                 MetaPropValue  *value);
+typedef void (*ReloadValueFunc) (MetaGroup     *group,
+                                 MetaPropValue *value);
 
 struct _MetaGroupPropHooks
 {
   Atom property;
-  InitValueFunc   init_func;
+  InitValueFunc init_func;
   ReloadValueFunc reload_func;
 };
 
-static void                init_prop_value   (MetaX11Display *x11_display,
-                                              Atom            property,
-                                              MetaPropValue  *value);
-static void                reload_prop_value (MetaGroup      *group,
-                                              MetaPropValue  *value);
-static MetaGroupPropHooks *find_hooks        (MetaX11Display *x11_display,
-                                              Atom            property);
+static void                init_prop_value (MetaX11Display *x11_display,
+                                            Atom            property,
+                                            MetaPropValue  *value);
+static void                reload_prop_value (MetaGroup     *group,
+                                              MetaPropValue *value);
+static MetaGroupPropHooks *find_hooks (MetaX11Display *x11_display,
+                                       Atom            property);
 
 void
 meta_group_reload_property (MetaGroup *group,
@@ -107,18 +107,18 @@ init_prop_value (MetaX11Display *x11_display,
 
   hooks = find_hooks (x11_display, property);
   if (hooks && hooks->init_func != NULL)
-    (* hooks->init_func) (x11_display, property, value);
+    (*hooks->init_func)(x11_display, property, value);
 }
 
 static void
-reload_prop_value (MetaGroup    *group,
+reload_prop_value (MetaGroup     *group,
                    MetaPropValue *value)
 {
   MetaGroupPropHooks *hooks;
 
   hooks = find_hooks (group->x11_display, value->atom);
   if (hooks && hooks->reload_func != NULL)
-    (* hooks->reload_func) (group, value);
+    (*hooks->reload_func)(group, value);
 }
 
 static void
@@ -212,7 +212,7 @@ meta_x11_display_free_group_prop_hooks (MetaX11Display *x11_display)
   x11_display->group_prop_hooks = NULL;
 }
 
-static MetaGroupPropHooks*
+static MetaGroupPropHooks *
 find_hooks (MetaX11Display *x11_display,
             Atom            property)
 {
diff --git a/src/x11/group.c b/src/x11/group.c
index a3227467f..ee26d7c0b 100644
--- a/src/x11/group.c
+++ b/src/x11/group.c
@@ -37,7 +37,7 @@
 #include "x11/group-props.h"
 #include "x11/meta-x11-display-private.h"
 
-static MetaGroup*
+static MetaGroup *
 meta_group_new (MetaX11Display *x11_display,
                 Window          group_leader)
 {
@@ -59,12 +59,16 @@ meta_group_new (MetaX11Display *x11_display,
   xcb_generic_error_t *e;
   g_autofree xcb_get_window_attributes_reply_t *attrs =
     xcb_get_window_attributes_reply (xcb_conn,
-                                     xcb_get_window_attributes (xcb_conn, group_leader),
+                                     xcb_get_window_attributes (xcb_conn,
+                                                                group_leader),
                                      &e);
   if (e)
     return NULL;
 
-  const uint32_t events[] = { attrs->your_event_mask | XCB_EVENT_MASK_PROPERTY_CHANGE };
+  const uint32_t events[] =
+  {
+    attrs->your_event_mask | XCB_EVENT_MASK_PROPERTY_CHANGE
+  };
   xcb_change_window_attributes (xcb_conn, group_leader,
                                 XCB_CW_EVENT_MASK, events);
 
@@ -72,7 +76,8 @@ meta_group_new (MetaX11Display *x11_display,
     x11_display->groups_by_leader = g_hash_table_new (meta_unsigned_long_hash,
                                                       meta_unsigned_long_equal);
 
-  g_assert (g_hash_table_lookup (x11_display->groups_by_leader, &group_leader) == NULL);
+  g_assert (g_hash_table_lookup (x11_display->groups_by_leader,
+                                 &group_leader) == NULL);
 
   g_hash_table_insert (x11_display->groups_by_leader,
                        &group->group_leader,
@@ -130,7 +135,7 @@ meta_group_unref (MetaGroup *group)
  * @window: a #MetaWindow
  *
  */
-MetaGroup*
+MetaGroup *
 meta_window_get_group (MetaWindow *window)
 {
   if (window->unmanaging)
@@ -140,7 +145,7 @@ meta_window_get_group (MetaWindow *window)
 }
 
 void
-meta_window_compute_group (MetaWindow* window)
+meta_window_compute_group (MetaWindow *window)
 {
   MetaGroup *group;
   MetaWindow *ancestor;
@@ -254,7 +259,7 @@ meta_x11_display_lookup_group (MetaX11Display *x11_display,
  *
  * Returns: (transfer container) (element-type Meta.Window): List of windows
  */
-GSList*
+GSList *
 meta_group_list_windows (MetaGroup *group)
 {
   return g_slist_copy (group->windows);
@@ -298,7 +303,7 @@ meta_group_update_layers (MetaGroup *group)
   g_slist_free (frozen_stacks);
 }
 
-const char*
+const char *
 meta_group_get_startup_id (MetaGroup *group)
 {
   return group->startup_id;
@@ -311,14 +316,13 @@ meta_group_get_startup_id (MetaGroup *group)
  *
  */
 gboolean
-meta_group_property_notify (MetaGroup  *group,
-                            XEvent     *event)
+meta_group_property_notify (MetaGroup *group,
+                            XEvent    *event)
 {
   meta_group_reload_property (group,
                               event->xproperty.atom);
 
   return TRUE;
-
 }
 
 int
@@ -329,4 +333,3 @@ meta_group_get_size (MetaGroup *group)
 
   return group->refcount;
 }
-
diff --git a/src/x11/iconcache.c b/src/x11/iconcache.c
index 7ab63b6a5..b2bb182a8 100644
--- a/src/x11/iconcache.c
+++ b/src/x11/iconcache.c
@@ -51,7 +51,7 @@ find_largest_sizes (gulong *data,
       w = data[0];
       h = data[1];
 
-      if (nitems < ((gulong)(w * h) + 2))
+      if (nitems < ((gulong) (w * h) + 2))
         return FALSE; /* not enough data */
 
       *width = MAX (w, *width);
@@ -107,7 +107,7 @@ find_best_size (gulong  *data,
       w = data[0];
       h = data[1];
 
-      if (nitems < ((gulong)(w * h) + 2))
+      if (nitems < ((gulong) (w * h) + 2))
         break; /* not enough data */
 
       if (best_start == NULL)
@@ -213,11 +213,11 @@ read_rgb_icon (MetaX11Display   *x11_display,
   type = None;
   data = NULL;
   result = XGetWindowProperty (x11_display->xdisplay,
-                              xwindow,
+                               xwindow,
                                x11_display->atom__NET_WM_ICON,
-                              0, G_MAXLONG,
-                              False, XA_CARDINAL, &type, &format, &nitems,
-                              &bytes_after, &data);
+                               0, G_MAXLONG,
+                               False, XA_CARDINAL, &type, &format, &nitems,
+                               &bytes_after, &data);
   err = meta_x11_error_trap_pop_with_return (x11_display);
 
   if (err != Success ||
@@ -230,7 +230,7 @@ read_rgb_icon (MetaX11Display   *x11_display,
       return FALSE;
     }
 
-  data_as_long = (gulong *)data;
+  data_as_long = (gulong *) data;
 
   if (!find_best_size (data_as_long, nitems,
                        ideal_width, ideal_height,
@@ -307,7 +307,8 @@ standard_pict_format_for_depth (int depth)
 static XRenderPictFormat *
 pict_format_for_depth (Display *xdisplay, int depth)
 {
-  return XRenderFindStandardFormat (xdisplay, standard_pict_format_for_depth (depth));
+  return XRenderFindStandardFormat (xdisplay,
+                                    standard_pict_format_for_depth (depth));
 }
 
 static cairo_surface_t *
@@ -322,8 +323,12 @@ surface_from_pixmap (Display *xdisplay, Pixmap xpixmap,
                      &x_ret, &y_ret, &w_ret, &h_ret, &bw_ret, &depth_ret))
     return NULL;
 
-  return cairo_xlib_surface_create_with_xrender_format (xdisplay, xpixmap, DefaultScreenOfDisplay (xdisplay),
-                                                        pict_format_for_depth (xdisplay, depth_ret), w_ret, 
h_ret);
+  return cairo_xlib_surface_create_with_xrender_format (xdisplay, xpixmap, DefaultScreenOfDisplay (
+                                                          xdisplay),
+                                                        pict_format_for_depth (
+                                                          xdisplay,
+                                                          depth_ret), w_ret,
+                                                        h_ret);
 }
 
 static gboolean
@@ -361,8 +366,10 @@ try_pixmap_and_mask (MetaX11Display   *x11_display,
 
       masked = cairo_surface_create_similar_image (icon,
                                                    CAIRO_FORMAT_ARGB32,
-                                                   cairo_xlib_surface_get_width (icon),
-                                                   cairo_xlib_surface_get_height (icon));
+                                                   cairo_xlib_surface_get_width (
+                                                     icon),
+                                                   cairo_xlib_surface_get_height (
+                                                     icon));
       cr = cairo_create (masked);
 
       cairo_set_source_surface (cr, icon, 0, 0);
@@ -407,12 +414,12 @@ get_kwm_win_icon (MetaX11Display *x11_display,
   icons = NULL;
   result = XGetWindowProperty (x11_display->xdisplay, xwindow,
                                x11_display->atom__KWM_WIN_ICON,
-                              0, G_MAXLONG,
-                              False,
+                               0, G_MAXLONG,
+                               False,
                                x11_display->atom__KWM_WIN_ICON,
-                              &type, &format, &nitems,
-                              &bytes_after, &data);
-  icons = (Pixmap *)data;
+                               &type, &format, &nitems,
+                               &bytes_after, &data);
+  icons = (Pixmap *) data;
 
   err = meta_x11_error_trap_pop_with_return (x11_display);
   if (err != Success ||
diff --git a/src/x11/meta-x11-display.c b/src/x11/meta-x11-display.c
index 8c5dfaafd..f2a937dad 100644
--- a/src/x11/meta-x11-display.c
+++ b/src/x11/meta-x11-display.c
@@ -127,13 +127,15 @@ meta_x11_display_dispose (GObject *object)
 
   if (x11_display->wm_sn_selection_window != None)
     {
-      XDestroyWindow (x11_display->xdisplay, x11_display->wm_sn_selection_window);
+      XDestroyWindow (x11_display->xdisplay,
+                      x11_display->wm_sn_selection_window);
       x11_display->wm_sn_selection_window = None;
     }
 
   if (x11_display->timestamp_pinging_window != None)
     {
-      XDestroyWindow (x11_display->xdisplay, x11_display->timestamp_pinging_window);
+      XDestroyWindow (x11_display->xdisplay,
+                      x11_display->timestamp_pinging_window);
       x11_display->timestamp_pinging_window = None;
     }
 
@@ -271,10 +273,11 @@ query_xsync_extension (MetaX11Display *x11_display)
       XSyncSetPriority (x11_display->xdisplay, None, 10);
     }
 
-  meta_verbose ("Attempted to init Xsync, found version %d.%d error base %d event base %d\n",
-                major, minor,
-                x11_display->xsync_error_base,
-                x11_display->xsync_event_base);
+  meta_verbose (
+    "Attempted to init Xsync, found version %d.%d error base %d event base %d\n",
+    major, minor,
+    x11_display->xsync_error_base,
+    x11_display->xsync_event_base);
 }
 
 static void
@@ -402,7 +405,7 @@ query_xi_extension (MetaX11Display *x11_display)
                        &x11_display->xinput_error_base,
                        &x11_display->xinput_event_base))
     {
-        if (XIQueryVersion (x11_display->xdisplay, &major, &minor) == Success)
+      if (XIQueryVersion (x11_display->xdisplay, &major, &minor) == Success)
         {
           int version = (major * 10) + minor;
           if (version >= 22)
@@ -414,7 +417,8 @@ query_xi_extension (MetaX11Display *x11_display)
     }
 
   if (!has_xi)
-    meta_fatal ("X server doesn't have the XInput extension, version 2.2 or newer\n");
+    meta_fatal (
+      "X server doesn't have the XInput extension, version 2.2 or newer\n");
 }
 
 /*
@@ -484,7 +488,7 @@ shutdown_x11_bell (MetaX11Display *x11_display)
  */
 static void
 set_x11_bell_is_audible (MetaX11Display *x11_display,
-                         gboolean is_audible)
+                         gboolean        is_audible)
 {
 #ifdef HAVE_LIBCANBERRA
   /* When we are playing sounds using libcanberra support, we handle the
@@ -522,14 +526,15 @@ set_desktop_geometry_hint (MetaX11Display *x11_display)
   data[0] = monitor_width;
   data[1] = monitor_height;
 
-  meta_verbose ("Setting _NET_DESKTOP_GEOMETRY to %lu, %lu\n", data[0], data[1]);
+  meta_verbose ("Setting _NET_DESKTOP_GEOMETRY to %lu, %lu\n", data[0],
+                data[1]);
 
   meta_x11_error_trap_push (x11_display);
   XChangeProperty (x11_display->xdisplay,
                    x11_display->xroot,
                    x11_display->atom__NET_DESKTOP_GEOMETRY,
                    XA_CARDINAL,
-                   32, PropModeReplace, (guchar*) data, 2);
+                   32, PropModeReplace, (guchar *) data, 2);
   meta_x11_error_trap_pop (x11_display);
 }
 
@@ -554,7 +559,7 @@ set_desktop_viewport_hint (MetaX11Display *x11_display)
                    x11_display->xroot,
                    x11_display->atom__NET_DESKTOP_VIEWPORT,
                    XA_CARDINAL,
-                   32, PropModeReplace, (guchar*) data, 2);
+                   32, PropModeReplace, (guchar *) data, 2);
   meta_x11_error_trap_pop (x11_display);
 }
 
@@ -571,7 +576,7 @@ set_wm_check_hint (MetaX11Display *x11_display)
                    x11_display->xroot,
                    x11_display->atom__NET_SUPPORTING_WM_CHECK,
                    XA_WINDOW,
-                   32, PropModeReplace, (guchar*) data, 1);
+                   32, PropModeReplace, (guchar *) data, 1);
 
   return Success;
 }
@@ -587,9 +592,10 @@ unset_wm_check_hint (MetaX11Display *x11_display)
 static int
 set_supported_hint (MetaX11Display *x11_display)
 {
-  Atom atoms[] = {
+  Atom atoms[] =
+  {
 #define EWMH_ATOMS_ONLY
-#define item(x)  x11_display->atom_##x,
+#define item(x)  x11_display->atom_ ## x,
 #include "x11/atomnames.h"
 #undef item
 #undef EWMH_ATOMS_ONLY
@@ -603,7 +609,7 @@ set_supported_hint (MetaX11Display *x11_display)
                    x11_display->atom__NET_SUPPORTED,
                    XA_ATOM,
                    32, PropModeReplace,
-                   (guchar*) atoms, G_N_ELEMENTS(atoms));
+                   (guchar *) atoms, G_N_ELEMENTS (atoms));
 
   return Success;
 }
@@ -633,7 +639,7 @@ set_wm_icon_size_hint (MetaX11Display *x11_display)
                    x11_display->xroot,
                    x11_display->atom_WM_ICON_SIZE,
                    XA_CARDINAL,
-                   32, PropModeReplace, (guchar*) vals, N_VALS);
+                   32, PropModeReplace, (guchar *) vals, N_VALS);
 
   return Success;
 #undef N_VALS
@@ -658,13 +664,15 @@ take_manager_selection (MetaX11Display *x11_display,
           /* We want to find out when the current selection owner dies */
           meta_x11_error_trap_push (x11_display);
           attrs.event_mask = StructureNotifyMask;
-          XChangeWindowAttributes (x11_display->xdisplay, current_owner, CWEventMask, &attrs);
+          XChangeWindowAttributes (x11_display->xdisplay, current_owner,
+                                   CWEventMask, &attrs);
           if (meta_x11_error_trap_pop_with_return (x11_display) != Success)
             current_owner = None; /* don't wait for it to die later on */
         }
       else
         {
-          meta_warning (_("Display “%s” already has a window manager; try using the --replace option to 
replace the current window manager."),
+          meta_warning (_(
+                          "Display “%s” already has a window manager; try using the --replace option to 
replace the current window manager."),
                         x11_display->name);
           return None;
         }
@@ -673,13 +681,16 @@ take_manager_selection (MetaX11Display *x11_display,
   /* We need SelectionClear and SelectionRequest events on the new owner,
    * but those cannot be masked, so we only need NoEventMask.
    */
-  new_owner = meta_x11_display_create_offscreen_window (x11_display, xroot, NoEventMask);
+  new_owner = meta_x11_display_create_offscreen_window (x11_display, xroot,
+                                                        NoEventMask);
 
-  XSetSelectionOwner (x11_display->xdisplay, manager_atom, new_owner, timestamp);
+  XSetSelectionOwner (x11_display->xdisplay, manager_atom, new_owner,
+                      timestamp);
 
   if (XGetSelectionOwner (x11_display->xdisplay, manager_atom) != new_owner)
     {
-      meta_warning ("Could not acquire selection: %s", XGetAtomName (x11_display->xdisplay, manager_atom));
+      meta_warning ("Could not acquire selection: %s",
+                    XGetAtomName (x11_display->xdisplay, manager_atom));
       return None;
     }
 
@@ -694,7 +705,8 @@ take_manager_selection (MetaX11Display *x11_display,
     ev.data.l[0] = timestamp;
     ev.data.l[1] = manager_atom;
 
-    XSendEvent (x11_display->xdisplay, xroot, False, StructureNotifyMask, (XEvent *) &ev);
+    XSendEvent (x11_display->xdisplay, xroot, False, StructureNotifyMask,
+                (XEvent *) &ev);
   }
 
   /* Wait for old window manager to go away */
@@ -706,7 +718,8 @@ take_manager_selection (MetaX11Display *x11_display,
 
       meta_verbose ("Waiting for old window manager to exit\n");
       do
-        XWindowEvent (x11_display->xdisplay, current_owner, StructureNotifyMask, &event);
+        XWindowEvent (x11_display->xdisplay, current_owner, StructureNotifyMask,
+                      &event);
       while (event.type != DestroyNotify);
     }
 
@@ -754,7 +767,7 @@ init_leader_window (MetaX11Display *x11_display,
                    x11_display->leader_window,
                    x11_display->atom__NET_SUPPORTING_WM_CHECK,
                    XA_WINDOW,
-                   32, PropModeReplace, (guchar*) data, 1);
+                   32, PropModeReplace, (guchar *) data, 1);
 
   XWindowEvent (x11_display->xdisplay,
                 x11_display->leader_window,
@@ -762,7 +775,7 @@ init_leader_window (MetaX11Display *x11_display,
                 &event);
 
   if (timestamp)
-   *timestamp = event.xproperty.time;
+    *timestamp = event.xproperty.time;
 
   /* Make it painfully clear that we can't rely on PropertyNotify events on
    * this window, as per bug 354213.
@@ -819,7 +832,7 @@ set_active_workspace_hint (MetaWorkspaceManager *workspace_manager,
                    x11_display->xroot,
                    x11_display->atom__NET_CURRENT_DESKTOP,
                    XA_CARDINAL,
-                   32, PropModeReplace, (guchar*) data, 1);
+                   32, PropModeReplace, (guchar *) data, 1);
   meta_x11_error_trap_pop (x11_display);
 }
 
@@ -843,7 +856,7 @@ set_number_of_spaces_hint (MetaWorkspaceManager *workspace_manager,
                    x11_display->xroot,
                    x11_display->atom__NET_NUMBER_OF_DESKTOPS,
                    XA_CARDINAL,
-                   32, PropModeReplace, (guchar*) data, 1);
+                   32, PropModeReplace, (guchar *) data, 1);
   meta_x11_error_trap_pop (x11_display);
 }
 
@@ -860,7 +873,7 @@ set_showing_desktop_hint (MetaWorkspaceManager *workspace_manager,
                    x11_display->xroot,
                    x11_display->atom__NET_SHOWING_DESKTOP,
                    XA_CARDINAL,
-                   32, PropModeReplace, (guchar*) data, 1);
+                   32, PropModeReplace, (guchar *) data, 1);
   meta_x11_error_trap_pop (x11_display);
 }
 
@@ -899,7 +912,7 @@ set_workspace_names (MetaX11Display *x11_display)
                    x11_display->atom__NET_DESKTOP_NAMES,
                    x11_display->atom_UTF8_STRING,
                    8, PropModeReplace,
-                   (unsigned char *)flattened->str, flattened->len);
+                   (unsigned char *) flattened->str, flattened->len);
   meta_x11_error_trap_pop (x11_display);
 
   g_string_free (flattened, TRUE);
@@ -937,7 +950,7 @@ set_work_area_hint (MetaDisplay    *display,
                    x11_display->xroot,
                    x11_display->atom__NET_WORKAREA,
                    XA_CARDINAL, 32, PropModeReplace,
-                   (guchar*) data, num_workspaces*4);
+                   (guchar *) data, num_workspaces * 4);
   meta_x11_error_trap_pop (x11_display);
 
   g_free (data);
@@ -1015,13 +1028,13 @@ meta_x11_init_gdk_display (GError **error)
     }
 
   if (gdk_gl_env)
-    g_setenv("GDK_GL", gdk_gl_env, TRUE);
+    g_setenv ("GDK_GL", gdk_gl_env, TRUE);
   else
-    unsetenv("GDK_GL");
+    unsetenv ("GDK_GL");
 
   /* We need to be able to fully trust that the window and monitor sizes
-     that Gdk reports corresponds to the X ones, so we disable the automatic
-     scale handling */
+   *  that Gdk reports corresponds to the X ones, so we disable the automatic
+   *  scale handling */
   gdk_x11_display_set_window_scale (gdk_display, 1);
 
   meta_verbose ("Opening display '%s'\n", XDisplayName (NULL));
@@ -1079,12 +1092,13 @@ meta_x11_display_new (MetaDisplay *display, GError **error)
     meta_backend_get_monitor_manager (backend);
 
   /* A list of all atom names, so that we can intern them in one go. */
-  const char *atom_names[] = {
+  const char *atom_names[] =
+  {
 #define item(x) #x,
 #include "x11/atomnames.h"
 #undef item
   };
-  Atom atoms[G_N_ELEMENTS(atom_names)];
+  Atom atoms[G_N_ELEMENTS (atom_names)];
 
   g_assert (prepared_gdk_display);
   gdk_display = g_steal_pointer (&prepared_gdk_display);
@@ -1151,11 +1165,11 @@ meta_x11_display_new (MetaDisplay *display, GError **error)
   x11_display->default_depth = DefaultDepthOfScreen (xscreen);
 
   meta_verbose ("Creating %d atoms\n", (int) G_N_ELEMENTS (atom_names));
-  XInternAtoms (xdisplay, (char **)atom_names, G_N_ELEMENTS (atom_names),
+  XInternAtoms (xdisplay, (char **) atom_names, G_N_ELEMENTS (atom_names),
                 False, atoms);
 
   i = 0;
-#define item(x) x11_display->atom_##x = atoms[i++];
+#define item(x) x11_display->atom_ ## x = atoms[i++];
 #include "x11/atomnames.h"
 #undef item
 
@@ -1218,7 +1232,8 @@ meta_x11_display_new (MetaDisplay *display, GError **error)
   sprintf (buf, "WM_S%d", number);
 
   wm_sn_atom = XInternAtom (xdisplay, buf, False);
-  new_wm_sn_owner = take_manager_selection (x11_display, xroot, wm_sn_atom, timestamp, replace_current_wm);
+  new_wm_sn_owner = take_manager_selection (x11_display, xroot, wm_sn_atom,
+                                            timestamp, replace_current_wm);
   if (new_wm_sn_owner == None)
     {
       g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
@@ -1242,7 +1257,8 @@ meta_x11_display_new (MetaDisplay *display, GError **error)
   /* If we're a Wayland compositor, then we don't grab the COW, since it
    * will map it. */
   if (!meta_is_wayland_compositor ())
-    x11_display->composite_overlay_window = XCompositeGetOverlayWindow (xdisplay, xroot);
+    x11_display->composite_overlay_window = XCompositeGetOverlayWindow (
+      xdisplay, xroot);
 
   /* Now that we've gotten taken a reference count on the COW, we
    * can close the helper that is holding on to it */
@@ -1253,7 +1269,8 @@ meta_x11_display_new (MetaDisplay *display, GError **error)
   x11_display->no_focus_window =
     meta_x11_display_create_offscreen_window (x11_display,
                                               xroot,
-                                              FocusChangeMask|KeyPressMask|KeyReleaseMask);
+                                              FocusChangeMask | KeyPressMask |
+                                              KeyReleaseMask);
   XMapWindow (xdisplay, x11_display->no_focus_window);
   /* Done with no_focus_window stuff */
 
@@ -1286,8 +1303,9 @@ meta_x11_display_new (MetaDisplay *display, GError **error)
                     (int) current_workspace_index);
 
       /* Switch to the _NET_CURRENT_DESKTOP workspace */
-      current_workspace = meta_workspace_manager_get_workspace_by_index (display->workspace_manager,
-                                                                         current_workspace_index);
+      current_workspace = meta_workspace_manager_get_workspace_by_index (
+        display->workspace_manager,
+        current_workspace_index);
 
       if (current_workspace != NULL)
         meta_workspace_activate (current_workspace, timestamp);
@@ -1312,13 +1330,16 @@ meta_x11_display_new (MetaDisplay *display, GError **error)
           meta_XFree (list);
         }
 
-        if (num > meta_workspace_manager_get_n_workspaces (display->workspace_manager))
-          meta_workspace_manager_update_num_workspaces (display->workspace_manager, timestamp, num);
+      if (num >
+          meta_workspace_manager_get_n_workspaces (display->workspace_manager))
+        meta_workspace_manager_update_num_workspaces (
+          display->workspace_manager, timestamp, num);
     }
 
   set_active_workspace_hint (display->workspace_manager, x11_display);
 
-  g_signal_connect_object (display->workspace_manager, "active-workspace-changed",
+  g_signal_connect_object (display->workspace_manager,
+                           "active-workspace-changed",
                            G_CALLBACK (set_active_workspace_hint),
                            x11_display, 0);
 
@@ -1330,7 +1351,8 @@ meta_x11_display_new (MetaDisplay *display, GError **error)
 
   set_showing_desktop_hint (display->workspace_manager, x11_display);
 
-  g_signal_connect_object (display->workspace_manager, "showing-desktop-changed",
+  g_signal_connect_object (display->workspace_manager,
+                           "showing-desktop-changed",
                            G_CALLBACK (set_showing_desktop_hint),
                            x11_display, 0);
 
@@ -1432,7 +1454,7 @@ meta_x11_display_create_offscreen_window (MetaX11Display *x11_display,
                         0,
                         CopyFromParent,
                         CopyFromParent,
-                        (Visual *)CopyFromParent,
+                        (Visual *) CopyFromParent,
                         CWOverrideRedirect | CWEventMask,
                         &attrs);
 }
@@ -1637,7 +1659,8 @@ create_guard_window (MetaX11Display *x11_display)
         MetaBackendX11 *backend = META_BACKEND_X11 (meta_get_backend ());
         Display *backend_xdisplay = meta_backend_x11_get_xdisplay (backend);
         unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
-        XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
+        XIEventMask mask =
+        { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
 
         XISetMask (mask.mask, XI_ButtonPress);
         XISetMask (mask.mask, XI_ButtonRelease);
@@ -1713,13 +1736,15 @@ meta_x11_display_set_cm_selection (MetaX11Display *x11_display)
               DefaultScreen (x11_display->xdisplay));
   a = XInternAtom (x11_display->xdisplay, selection, False);
 
-  x11_display->wm_cm_selection_window = take_manager_selection (x11_display, x11_display->xroot, a, 
timestamp, TRUE);
+  x11_display->wm_cm_selection_window = take_manager_selection (x11_display,
+                                                                x11_display->xroot, a, timestamp,
+                                                                TRUE);
 }
 
 static Bool
-find_timestamp_predicate (Display  *xdisplay,
-                          XEvent   *ev,
-                          XPointer  arg)
+find_timestamp_predicate (Display *xdisplay,
+                          XEvent  *ev,
+                          XPointer arg)
 {
   MetaX11Display *x11_display = (MetaX11Display *) arg;
 
@@ -1764,7 +1789,7 @@ meta_x11_display_get_current_time_roundtrip (MetaX11Display *x11_display)
  */
 gboolean
 meta_x11_display_xwindow_is_a_no_focus_window (MetaX11Display *x11_display,
-                                               Window xwindow)
+                                               Window          xwindow)
 {
   return xwindow == x11_display->no_focus_window;
 }
@@ -1798,7 +1823,7 @@ meta_x11_display_update_active_window_hint (MetaX11Display *x11_display)
                    x11_display->xroot,
                    x11_display->atom__NET_ACTIVE_WINDOW,
                    XA_WINDOW,
-                   32, PropModeReplace, (guchar*) data, 1);
+                   32, PropModeReplace, (guchar *) data, 1);
   meta_x11_error_trap_pop (x11_display);
 }
 
@@ -1850,7 +1875,8 @@ request_xserver_input_focus_change (MetaX11Display *x11_display,
 
   x11_display->display->last_focus_time = timestamp;
 
-  if (meta_window == NULL || meta_window != x11_display->display->autoraise_window)
+  if (meta_window == NULL ||
+      meta_window != x11_display->display->autoraise_window)
     meta_display_remove_autoraise_callback (x11_display->display);
 }
 
@@ -1965,8 +1991,9 @@ meta_x11_display_ensure_xinerama_indices (MetaX11Display *x11_display)
 }
 
 int
-meta_x11_display_logical_monitor_to_xinerama_index (MetaX11Display     *x11_display,
-                                                    MetaLogicalMonitor *logical_monitor)
+meta_x11_display_logical_monitor_to_xinerama_index (
+  MetaX11Display     *x11_display,
+  MetaLogicalMonitor *logical_monitor)
 {
   MetaX11DisplayLogicalMonitorData *logical_monitor_data;
 
@@ -2055,7 +2082,8 @@ meta_x11_display_update_workspace_names (MetaX11Display *x11_display)
 void
 meta_x11_display_update_workspace_layout (MetaX11Display *x11_display)
 {
-  MetaWorkspaceManager *workspace_manager = x11_display->display->workspace_manager;
+  MetaWorkspaceManager *workspace_manager =
+    x11_display->display->workspace_manager;
   gboolean vertical_layout = FALSE;
   int n_rows = -1;
   int n_columns = 1;
@@ -2087,7 +2115,8 @@ meta_x11_display_update_workspace_layout (MetaX11Display *x11_display)
               vertical_layout = TRUE;
               break;
             default:
-              meta_warning ("Someone set a weird orientation in _NET_DESKTOP_LAYOUT\n");
+              meta_warning (
+                "Someone set a weird orientation in _NET_DESKTOP_LAYOUT\n");
               break;
             }
 
@@ -2096,7 +2125,9 @@ meta_x11_display_update_workspace_layout (MetaX11Display *x11_display)
 
           if (rows <= 0 && cols <= 0)
             {
-              meta_warning ("Columns = %d rows = %d in _NET_DESKTOP_LAYOUT makes no sense\n", rows, cols);
+              meta_warning (
+                "Columns = %d rows = %d in _NET_DESKTOP_LAYOUT makes no sense\n",
+                rows, cols);
             }
           else
             {
@@ -2128,7 +2159,8 @@ meta_x11_display_update_workspace_layout (MetaX11Display *x11_display)
                   starting_corner = META_DISPLAY_BOTTOMLEFT;
                   break;
                 default:
-                  meta_warning ("Someone set a weird starting corner in _NET_DESKTOP_LAYOUT\n");
+                  meta_warning (
+                    "Someone set a weird starting corner in _NET_DESKTOP_LAYOUT\n");
                   break;
                 }
             }
@@ -2136,7 +2168,8 @@ meta_x11_display_update_workspace_layout (MetaX11Display *x11_display)
       else
         {
           meta_warning ("Someone set _NET_DESKTOP_LAYOUT to %d integers instead of 4 "
-                        "(3 is accepted for backwards compat)\n", n_items);
+                        "(3 is accepted for backwards compat)\n",
+                        n_items);
         }
 
       meta_XFree (list);
diff --git a/src/x11/meta-x11-errors.c b/src/x11/meta-x11-errors.c
index 506769464..d6e26f7f0 100644
--- a/src/x11/meta-x11-errors.c
+++ b/src/x11/meta-x11-errors.c
@@ -34,16 +34,19 @@
 
 #include "x11/meta-x11-display-private.h"
 
-/* In GTK+-3.0, the error trapping code was significantly rewritten. The new code
+/* In GTK+-3.0, the error trapping code was significantly rewritten. The new
+ * code
  * has some neat features (like knowing automatically if a sync is needed or not
- * and handling errors asynchronously when the error code isn't needed immediately),
+ * and handling errors asynchronously when the error code isn't needed
+ *immediately),
  * but it's basically incompatible with the hacks we played with GTK+-2.0 to
  * use a custom error handler along with gdk_error_trap_push().
  *
  * Since the main point of our custom error trap was to get the error logged
  * to the right place, with GTK+-3.0 we simply omit our own error handler and
  * use the GTK+ handling straight-up.
- * (See https://bugzilla.gnome.org/show_bug.cgi?id=630216 for restoring logging.)
+ * (See https://bugzilla.gnome.org/show_bug.cgi?id=630216 for restoring
+ *logging.)
  */
 
 void
diff --git a/src/x11/session.c b/src/x11/session.c
index 540cbfb88..be87154ed 100644
--- a/src/x11/session.c
+++ b/src/x11/session.c
@@ -41,7 +41,7 @@ meta_session_init (const char *client_id,
   meta_topic (META_DEBUG_SM, "Compiled without session management support\n");
 }
 
-const MetaWindowSessionInfo*
+const MetaWindowSessionInfo *
 meta_window_lookup_saved_state (MetaWindow *window)
 {
   return NULL;
@@ -50,7 +50,6 @@ meta_window_lookup_saved_state (MetaWindow *window)
 void
 meta_window_release_saved_state (const MetaWindowSessionInfo *info)
 {
-  ;
 }
 #else /* HAVE_SM */
 
@@ -74,20 +73,21 @@ meta_window_release_saved_state (const MetaWindowSessionInfo *info)
 static void ice_io_error_handler (IceConn connection);
 
 static void new_ice_connection (IceConn connection, IcePointer client_data,
-                               Bool opening, IcePointer *watch_data);
+                                Bool opening, IcePointer *watch_data);
 
-static void        save_state         (void);
-static char*       load_state         (const char *previous_save_file);
+static void        save_state (void);
+static char *load_state (const char *previous_save_file);
 static void        regenerate_save_file (void);
-static const char* full_save_file       (void);
-static void        warn_about_lame_clients_and_finish_interact (gboolean shutdown);
-static void        disconnect         (void);
+static const char *full_save_file (void);
+static void        warn_about_lame_clients_and_finish_interact (
+  gboolean shutdown);
+static void        disconnect (void);
 
 /* This is called when data is available on an ICE connection.  */
 static gboolean
-process_ice_messages (GIOChannel *channel,
+process_ice_messages (GIOChannel  *channel,
                       GIOCondition condition,
-                      gpointer client_data)
+                      gpointer     client_data)
 {
   IceConn connection = (IceConn) client_data;
   IceProcessMessagesStatus status;
@@ -118,10 +118,10 @@ process_ice_messages (GIOChannel *channel,
 }
 
 /* This is called when a new ICE connection is made.  It arranges for
-   the ICE connection to be handled via the event loop.  */
+ *  the ICE connection to be handled via the event loop.  */
 static void
 new_ice_connection (IceConn connection, IcePointer client_data, Bool opening,
-                   IcePointer *watch_data)
+                    IcePointer *watch_data)
 {
   guint input_id;
 
@@ -148,7 +148,7 @@ new_ice_connection (IceConn connection, IcePointer client_data, Bool opening,
     }
   else
     {
-      input_id = GPOINTER_TO_UINT ((gpointer) *watch_data);
+      input_id = GPOINTER_TO_UINT ((gpointer) * watch_data);
 
       g_source_remove (input_id);
     }
@@ -157,12 +157,12 @@ new_ice_connection (IceConn connection, IcePointer client_data, Bool opening,
 static IceIOErrorHandler ice_installed_handler;
 
 /* We call any handler installed before (or after) gnome_ice_init but
-   avoid calling the default libICE handler which does an exit() */
+ *  avoid calling the default libICE handler which does an exit() */
 static void
 ice_io_error_handler (IceConn connection)
 {
-    if (ice_installed_handler)
-      (*ice_installed_handler) (connection);
+  if (ice_installed_handler)
+    (*ice_installed_handler)(connection);
 }
 
 static void
@@ -170,7 +170,7 @@ ice_init (void)
 {
   static gboolean ice_initted = FALSE;
 
-  if (! ice_initted)
+  if (!ice_initted)
     {
       IceIOErrorHandler default_handler;
 
@@ -178,7 +178,7 @@ ice_init (void)
       default_handler = IceSetIOErrorHandler (ice_io_error_handler);
 
       if (ice_installed_handler == default_handler)
-       ice_installed_handler = NULL;
+        ice_installed_handler = NULL;
 
       IceAddConnectionWatch (new_ice_connection, NULL);
 
@@ -200,23 +200,23 @@ typedef enum
   STATE_REGISTERING
 } ClientState;
 
-static void save_phase_2_callback       (SmcConn   smc_conn,
-                                         SmPointer client_data);
-static void interact_callback           (SmcConn   smc_conn,
-                                         SmPointer client_data);
+static void save_phase_2_callback (SmcConn   smc_conn,
+                                   SmPointer client_data);
+static void interact_callback (SmcConn   smc_conn,
+                               SmPointer client_data);
 static void shutdown_cancelled_callback (SmcConn   smc_conn,
                                          SmPointer client_data);
-static void save_complete_callback      (SmcConn   smc_conn,
-                                         SmPointer client_data);
-static void die_callback                (SmcConn   smc_conn,
-                                         SmPointer client_data);
-static void save_yourself_callback      (SmcConn   smc_conn,
-                                         SmPointer client_data,
-                                         int       save_style,
-                                         Bool      shutdown,
-                                         int       interact_style,
-                                         Bool      fast);
-static void set_clone_restart_commands  (void);
+static void save_complete_callback (SmcConn   smc_conn,
+                                    SmPointer client_data);
+static void die_callback (SmcConn   smc_conn,
+                          SmPointer client_data);
+static void save_yourself_callback (SmcConn   smc_conn,
+                                    SmPointer client_data,
+                                    int       save_style,
+                                    Bool      shutdown,
+                                    int       interact_style,
+                                    Bool      fast);
+static void set_clone_restart_commands (void);
 
 static char *client_id = NULL;
 static gpointer session_connection = NULL;
@@ -255,7 +255,7 @@ meta_session_init (const char *previous_client_id,
   ice_init ();
 
   mask = SmcSaveYourselfProcMask | SmcDieProcMask |
-    SmcSaveCompleteProcMask | SmcShutdownCancelledProcMask;
+         SmcSaveCompleteProcMask | SmcShutdownCancelledProcMask;
 
   callbacks.save_yourself.callback = save_yourself_callback;
   callbacks.save_yourself.client_data = NULL;
@@ -276,7 +276,7 @@ meta_session_init (const char *previous_client_id,
                        SmProtoMinor,
                        mask,
                        &callbacks,
-                       (char*) previous_client_id,
+                       (char *) previous_client_id,
                        &client_id,
                        255, buf);
 
@@ -315,48 +315,48 @@ meta_session_init (const char *previous_client_id,
 
     prgname = g_get_prgname ();
 
-    prop1.name = (char *)SmProgram;
-    prop1.type = (char *)SmARRAY8;
+    prop1.name = (char *) SmProgram;
+    prop1.type = (char *) SmARRAY8;
     prop1.num_vals = 1;
     prop1.vals = &prop1val;
-    prop1val.value = (char *)prgname;
+    prop1val.value = (char *) prgname;
     prop1val.length = strlen (prgname);
 
     /* twm sets getuid() for this, but the SM spec plainly
      * says pw_name, twm is on crack
      */
-    prop2.name = (char *)SmUserID;
-    prop2.type = (char *)SmARRAY8;
+    prop2.name = (char *) SmUserID;
+    prop2.type = (char *) SmARRAY8;
     prop2.num_vals = 1;
     prop2.vals = &prop2val;
-    prop2val.value = (char*) g_get_user_name ();
+    prop2val.value = (char *) g_get_user_name ();
     prop2val.length = strlen (prop2val.value);
 
-    prop3.name = (char *)SmRestartStyleHint;
-    prop3.type = (char *)SmCARD8;
+    prop3.name = (char *) SmRestartStyleHint;
+    prop3.type = (char *) SmCARD8;
     prop3.num_vals = 1;
     prop3.vals = &prop3val;
     prop3val.value = &hint;
     prop3val.length = 1;
 
     sprintf (pid, "%d", getpid ());
-    prop4.name = (char *)SmProcessID;
-    prop4.type = (char *)SmARRAY8;
+    prop4.name = (char *) SmProcessID;
+    prop4.type = (char *) SmARRAY8;
     prop4.num_vals = 1;
     prop4.vals = &prop4val;
     prop4val.value = pid;
     prop4val.length = strlen (prop4val.value);
 
     /* Always start in home directory */
-    prop5.name = (char *)SmCurrentDirectory;
-    prop5.type = (char *)SmARRAY8;
+    prop5.name = (char *) SmCurrentDirectory;
+    prop5.type = (char *) SmARRAY8;
     prop5.num_vals = 1;
     prop5.vals = &prop5val;
-    prop5val.value = (char*) g_get_home_dir ();
+    prop5val.value = (char *) g_get_home_dir ();
     prop5val.length = strlen (prop5val.value);
 
-    prop6.name = (char *)"_GSM_Priority";
-    prop6.type = (char *)SmCARD8;
+    prop6.name = (char *) "_GSM_Priority";
+    prop6.type = (char *) SmCARD8;
     prop6.num_vals = 1;
     prop6.vals = &prop6val;
     prop6val.value = &priority;
@@ -372,7 +372,7 @@ meta_session_init (const char *previous_client_id,
     SmcSetProperties (session_connection, 6, props);
   }
 
- out:
+out:
   g_free (saved_client_id);
 }
 
@@ -413,7 +413,8 @@ save_yourself_possibly_done (gboolean shutdown,
       Status status;
 
       status = SmcInteractRequest (session_connection,
-                                   /* ignore this feature of the protocol by always
+                                   /* ignore this feature of the protocol by
+                                    * always
                                     * claiming normal
                                     */
                                    SmDialogNormal,
@@ -485,13 +486,13 @@ save_yourself_callback (SmcConn   smc_conn,
       /* Double check that this is a section 7.2 SaveYourself: */
 
       if (save_style == SmSaveLocal &&
-         interact_style == SmInteractStyleNone &&
-         !shutdown && !fast)
-       {
-         /* The protocol requires this even if xsm ignores it. */
-         SmcSaveYourselfDone (session_connection, successful);
-         return;
-       }
+          interact_style == SmInteractStyleNone &&
+          !shutdown && !fast)
+        {
+          /* The protocol requires this even if xsm ignores it. */
+          SmcSaveYourselfDone (session_connection, successful);
+          return;
+        }
     }
 #endif
 
@@ -591,15 +592,15 @@ set_clone_restart_commands (void)
 
   /* Restart (use same client ID) */
 
-  prop1.name = (char *)SmRestartCommand;
-  prop1.type = (char *)SmLISTofARRAY8;
+  prop1.name = (char *) SmRestartCommand;
+  prop1.type = (char *) SmLISTofARRAY8;
 
   g_return_if_fail (client_id);
 
   i = 0;
-  restartv[i] = (char *)prgname;
+  restartv[i] = (char *) prgname;
   ++i;
-  restartv[i] = (char *)"--sm-client-id";
+  restartv[i] = (char *) "--sm-client-id";
   ++i;
   restartv[i] = client_id;
   ++i;
@@ -618,12 +619,12 @@ set_clone_restart_commands (void)
   /* Clone (no client ID) */
 
   i = 0;
-  clonev[i] = (char *)prgname;
+  clonev[i] = (char *) prgname;
   ++i;
   clonev[i] = NULL;
 
-  prop2.name = (char *)SmCloneCommand;
-  prop2.type = (char *)SmLISTofARRAY8;
+  prop2.name = (char *) SmCloneCommand;
+  prop2.type = (char *) SmLISTofARRAY8;
 
   prop2.vals = g_new (SmPropValue, i);
   i = 0;
@@ -638,16 +639,16 @@ set_clone_restart_commands (void)
   /* Discard */
 
   i = 0;
-  discardv[i] = (char *)"rm";
+  discardv[i] = (char *) "rm";
   ++i;
-  discardv[i] = (char *)"-f";
+  discardv[i] = (char *) "-f";
   ++i;
-  discardv[i] = (char*) full_save_file ();
+  discardv[i] = (char *) full_save_file ();
   ++i;
   discardv[i] = NULL;
 
-  prop3.name = (char *)SmDiscardCommand;
-  prop3.type = (char *)SmLISTofARRAY8;
+  prop3.name = (char *) SmDiscardCommand;
+  prop3.type = (char *) SmLISTofARRAY8;
 
   prop3.vals = g_new (SmPropValue, i);
   i = 0;
@@ -676,7 +677,7 @@ set_clone_restart_commands (void)
  * session manager.
  */
 
-static const char*
+static const char *
 window_type_to_string (MetaWindowType type)
 {
   switch (type)
@@ -770,7 +771,7 @@ window_gravity_from_string (const char *str)
     return NorthWestGravity;
 }
 
-static char*
+static char *
 encode_text_as_utf8_markup (const char *text)
 {
   /* text can be any encoding, and is nul-terminated.
@@ -795,7 +796,7 @@ encode_text_as_utf8_markup (const char *text)
   return escaped;
 }
 
-static char*
+static char *
 decode_text_from_utf8 (const char *text)
 {
   /* Convert back from the encoded (but not escaped) UTF-8 */
@@ -839,8 +840,8 @@ save_state (void)
    * can just use the directory name from that.
    */
   mutter_dir = g_strconcat (g_get_user_config_dir (),
-                              G_DIR_SEPARATOR_S "mutter",
-                              NULL);
+                            G_DIR_SEPARATOR_S "mutter",
+                            NULL);
 
   session_dir = g_strconcat (mutter_dir,
                              G_DIR_SEPARATOR_S "sessions",
@@ -873,11 +874,13 @@ save_state (void)
 
   /* The file format is:
    * <mutter_session id="foo">
-   *   <window id="bar" class="XTerm" name="xterm" title="/foo/bar" role="blah" type="normal" stacking="5">
+   *   <window id="bar" class="XTerm" name="xterm" title="/foo/bar" role="blah"
+   *type="normal" stacking="5">
    *     <workspace index="2"/>
    *     <workspace index="4"/>
    *     <sticky/> <minimized/> <maximized/>
-   *     <geometry x="100" y="100" width="200" height="200" gravity="northwest"/>
+   *     <geometry x="100" y="100" width="200" height="200"
+   *gravity="northwest"/>
    *   </window>
    * </mutter_session>
    *
@@ -918,17 +921,18 @@ save_state (void)
 
           sm_client_id = encode_text_as_utf8_markup (window->sm_client_id);
           res_class = window->res_class ?
-            encode_text_as_utf8_markup (window->res_class) : NULL;
+                      encode_text_as_utf8_markup (window->res_class) : NULL;
           res_name = window->res_name ?
-            encode_text_as_utf8_markup (window->res_name) : NULL;
+                     encode_text_as_utf8_markup (window->res_name) : NULL;
           role = window->role ?
-            encode_text_as_utf8_markup (window->role) : NULL;
+                 encode_text_as_utf8_markup (window->role) : NULL;
           if (window->title)
             title = g_markup_escape_text (window->title, -1);
           else
             title = NULL;
 
-          meta_topic (META_DEBUG_SM, "Saving session managed window %s, client ID '%s'\n",
+          meta_topic (META_DEBUG_SM,
+                      "Saving session managed window %s, client ID '%s'\n",
                       window->desc, window->sm_client_id);
 
           fprintf (outfile,
@@ -951,7 +955,9 @@ save_state (void)
           if (window->on_all_workspaces_requested)
             {
               fputs ("    <sticky/>\n", outfile);
-            } else {
+            }
+          else
+            {
               int n;
               if (window->workspace)
                 n = meta_workspace_index (window->workspace);
@@ -992,7 +998,8 @@ save_state (void)
         }
       else
         {
-          meta_topic (META_DEBUG_SM, "Not saving window '%s', not session managed\n",
+          meta_topic (META_DEBUG_SM,
+                      "Not saving window '%s', not session managed\n",
                       window->desc);
         }
 
@@ -1004,7 +1011,7 @@ save_state (void)
 
   fputs ("</mutter_session>\n", outfile);
 
- out:
+out:
   if (outfile)
     {
       /* FIXME need a dialog for this */
@@ -1041,25 +1048,26 @@ typedef struct
 } ParseData;
 
 static void                   session_info_free (MetaWindowSessionInfo *info);
-static MetaWindowSessionInfo* session_info_new  (void);
-
-static void start_element_handler (GMarkupParseContext  *context,
-                                   const gchar          *element_name,
-                                   const gchar         **attribute_names,
-                                   const gchar         **attribute_values,
-                                   gpointer              user_data,
-                                   GError              **error);
-static void end_element_handler   (GMarkupParseContext  *context,
-                                   const gchar          *element_name,
-                                   gpointer              user_data,
-                                   GError              **error);
-static void text_handler          (GMarkupParseContext  *context,
-                                   const gchar          *text,
-                                   gsize                 text_len,
-                                   gpointer              user_data,
-                                   GError              **error);
-
-static GMarkupParser mutter_session_parser = {
+static MetaWindowSessionInfo *session_info_new (void);
+
+static void start_element_handler (GMarkupParseContext *context,
+                                   const gchar         *element_name,
+                                   const gchar        **attribute_names,
+                                   const gchar        **attribute_values,
+                                   gpointer             user_data,
+                                   GError             **error);
+static void end_element_handler (GMarkupParseContext *context,
+                                 const gchar         *element_name,
+                                 gpointer             user_data,
+                                 GError             **error);
+static void text_handler (GMarkupParseContext *context,
+                          const gchar         *text,
+                          gsize                text_len,
+                          gpointer             user_data,
+                          GError             **error);
+
+static GMarkupParser mutter_session_parser =
+{
   start_element_handler,
   end_element_handler,
   text_handler,
@@ -1069,7 +1077,7 @@ static GMarkupParser mutter_session_parser = {
 
 static GSList *window_info_list = NULL;
 
-static char*
+static char *
 load_state (const char *previous_save_file)
 {
   GMarkupParseContext *context;
@@ -1143,7 +1151,7 @@ load_state (const char *previous_save_file)
 
   goto out;
 
- error:
+error:
 
   meta_warning ("Failed to parse saved session file: %s\n",
                 error->message);
@@ -1155,7 +1163,7 @@ load_state (const char *previous_save_file)
   g_free (parse_data.previous_id);
   parse_data.previous_id = NULL;
 
- out:
+out:
 
   g_free (text);
 
@@ -1193,7 +1201,7 @@ start_element_handler  (GMarkupParseContext *context,
             {
               g_set_error (error,
                            G_MARKUP_ERROR,
-                       G_MARKUP_ERROR_PARSE,
+                           G_MARKUP_ERROR_PARSE,
                            "<mutter_session> attribute seen but we already have the session ID");
               return;
             }
@@ -1489,7 +1497,8 @@ end_element_handler    (GMarkupParseContext *context,
       window_info_list = g_slist_prepend (window_info_list,
                                           pd->info);
 
-      meta_topic (META_DEBUG_SM, "Loaded window info from session with class: %s name: %s role: %s\n",
+      meta_topic (META_DEBUG_SM,
+                  "Loaded window info from session with class: %s name: %s role: %s\n",
                   pd->info->res_class ? pd->info->res_class : "(none)",
                   pd->info->res_name ? pd->info->res_name : "(none)",
                   pd->info->role ? pd->info->role : "(none)");
@@ -1522,7 +1531,7 @@ both_null_or_matching (const char *a,
     return FALSE;
 }
 
-static GSList*
+static GSList *
 get_possible_matches (MetaWindow *window)
 {
   /* Get all windows with this client ID */
@@ -1547,7 +1556,8 @@ get_possible_matches (MetaWindow *window)
           both_null_or_matching (info->res_name, window->res_name) &&
           both_null_or_matching (info->role, window->role))
         {
-          meta_topic (META_DEBUG_SM, "Window %s may match saved window with class: %s name: %s role: %s\n",
+          meta_topic (META_DEBUG_SM,
+                      "Window %s may match saved window with class: %s name: %s role: %s\n",
                       window->desc,
                       info->res_class ? info->res_class : "(none)",
                       info->res_name ? info->res_name : "(none)",
@@ -1560,28 +1570,35 @@ get_possible_matches (MetaWindow *window)
           if (meta_is_verbose ())
             {
               if (!both_null_or_matching (info->id, window->sm_client_id))
-                meta_topic (META_DEBUG_SM, "Window %s has SM client ID %s, saved state has %s, no match\n",
+                meta_topic (META_DEBUG_SM,
+                            "Window %s has SM client ID %s, saved state has %s, no match\n",
                             window->desc,
                             window->sm_client_id ? window->sm_client_id : "(none)",
                             info->id ? info->id : "(none)");
-              else if (!both_null_or_matching (info->res_class, window->res_class))
-                meta_topic (META_DEBUG_SM, "Window %s has class %s doesn't match saved class %s, no match\n",
+              else if (!both_null_or_matching (info->res_class,
+                                               window->res_class))
+                meta_topic (META_DEBUG_SM,
+                            "Window %s has class %s doesn't match saved class %s, no match\n",
                             window->desc,
                             window->res_class ? window->res_class : "(none)",
                             info->res_class ? info->res_class : "(none)");
 
-              else if (!both_null_or_matching (info->res_name, window->res_name))
-                meta_topic (META_DEBUG_SM, "Window %s has name %s doesn't match saved name %s, no match\n",
+              else if (!both_null_or_matching (info->res_name,
+                                               window->res_name))
+                meta_topic (META_DEBUG_SM,
+                            "Window %s has name %s doesn't match saved name %s, no match\n",
                             window->desc,
                             window->res_name ? window->res_name : "(none)",
                             info->res_name ? info->res_name : "(none)");
               else if (!both_null_or_matching (info->role, window->role))
-                meta_topic (META_DEBUG_SM, "Window %s has role %s doesn't match saved role %s, no match\n",
+                meta_topic (META_DEBUG_SM,
+                            "Window %s has role %s doesn't match saved role %s, no match\n",
                             window->desc,
                             window->role ? window->role : "(none)",
                             info->role ? info->role : "(none)");
               else
-                meta_topic (META_DEBUG_SM, "???? should not happen - window %s doesn't match saved state %s 
for no good reason\n",
+                meta_topic (META_DEBUG_SM,
+                            "???? should not happen - window %s doesn't match saved state %s for no good 
reason\n",
                             window->desc, info->id);
             }
         }
@@ -1592,7 +1609,7 @@ get_possible_matches (MetaWindow *window)
   return retval;
 }
 
-static const MetaWindowSessionInfo*
+static const MetaWindowSessionInfo *
 find_best_match (GSList     *infos,
                  MetaWindow *window)
 {
@@ -1635,7 +1652,7 @@ find_best_match (GSList     *infos,
     return infos->data;
 }
 
-const MetaWindowSessionInfo*
+const MetaWindowSessionInfo *
 meta_window_lookup_saved_state (MetaWindow *window)
 {
   GSList *possibles;
@@ -1658,7 +1675,8 @@ meta_window_lookup_saved_state (MetaWindow *window)
 
   if (possibles == NULL)
     {
-      meta_topic (META_DEBUG_SM, "Window %s has no possible matches in the list of saved window states\n",
+      meta_topic (META_DEBUG_SM,
+                  "Window %s has no possible matches in the list of saved window states\n",
                   window->desc);
       return NULL;
     }
@@ -1678,7 +1696,7 @@ meta_window_release_saved_state (const MetaWindowSessionInfo *info)
    */
   window_info_list = g_slist_remove (window_info_list, info);
 
-  session_info_free ((MetaWindowSessionInfo*) info);
+  session_info_free ((MetaWindowSessionInfo *) info);
 }
 
 static void
@@ -1695,7 +1713,7 @@ session_info_free (MetaWindowSessionInfo *info)
   g_free (info);
 }
 
-static MetaWindowSessionInfo*
+static MetaWindowSessionInfo *
 session_info_new (void)
 {
   MetaWindowSessionInfo *info;
@@ -1708,7 +1726,7 @@ session_info_new (void)
   return info;
 }
 
-static char* full_save_path = NULL;
+static char *full_save_path = NULL;
 
 static void
 regenerate_save_file (void)
@@ -1716,17 +1734,18 @@ regenerate_save_file (void)
   g_free (full_save_path);
 
   if (client_id)
-    full_save_path = g_strconcat (g_get_user_config_dir (),
-                                  G_DIR_SEPARATOR_S "mutter"
-                                  G_DIR_SEPARATOR_S "sessions" G_DIR_SEPARATOR_S,
-                                  client_id,
-                                  ".ms",
-                                  NULL);
+    full_save_path = g_strconcat (
+      g_get_user_config_dir (),
+      G_DIR_SEPARATOR_S "mutter"
+      G_DIR_SEPARATOR_S "sessions" G_DIR_SEPARATOR_S,
+      client_id,
+      ".ms",
+      NULL);
   else
     full_save_path = NULL;
 }
 
-static const char*
+static const char *
 full_save_file (void)
 {
   return full_save_path;
@@ -1798,8 +1817,8 @@ warn_about_lame_clients_and_finish_interact (gboolean shutdown)
       return;
     }
 
-  columns = g_slist_prepend (columns, (gpointer)"Window");
-  columns = g_slist_prepend (columns, (gpointer)"Class");
+  columns = g_slist_prepend (columns, (gpointer) "Window");
+  columns = g_slist_prepend (columns, (gpointer) "Class");
 
   lame = g_slist_sort (lame, (GCompareFunc) windows_cmp_by_title);
 
@@ -1809,7 +1828,7 @@ warn_about_lame_clients_and_finish_interact (gboolean shutdown)
       MetaWindow *w = tmp->data;
 
       lame_details = g_slist_prepend (lame_details,
-                                      w->res_class ? w->res_class : (gpointer)"");
+                                      w->res_class ? w->res_class : (gpointer) "");
       lame_details = g_slist_prepend (lame_details,
                                       w->title);
 
@@ -1817,16 +1836,16 @@ warn_about_lame_clients_and_finish_interact (gboolean shutdown)
     }
   g_slist_free (lame);
 
-  pid = meta_show_dialog("--list",
-                         _("These windows do not support “save current setup” "
-                           "and will have to be restarted manually next time "
-                           "you log in."),
-                         "240",
-                         meta_get_display()->x11_display->screen_name,
-                         NULL, NULL, NULL,
-                         None,
-                         columns,
-                         lame_details);
+  pid = meta_show_dialog ("--list",
+                          _("These windows do not support “save current setup” "
+                            "and will have to be restarted manually next time "
+                            "you log in."),
+                          "240",
+                          meta_get_display ()->x11_display->screen_name,
+                          NULL, NULL, NULL,
+                          None,
+                          columns,
+                          lame_details);
 
   g_slist_free (lame_details);
 
diff --git a/src/x11/window-props.c b/src/x11/window-props.c
index dc35db8f1..bcaa2b52c 100644
--- a/src/x11/window-props.c
+++ b/src/x11/window-props.c
@@ -59,15 +59,16 @@
 #define HOST_NAME_MAX 255
 #endif
 
-typedef void (* ReloadValueFunc) (MetaWindow    *window,
-                                  MetaPropValue *value,
-                                  gboolean       initial);
+typedef void (*ReloadValueFunc) (MetaWindow    *window,
+                                 MetaPropValue *value,
+                                 gboolean       initial);
 
-typedef enum {
-  NONE       = 0,
-  LOAD_INIT  = (1 << 0),
+typedef enum
+{
+  NONE = 0,
+  LOAD_INIT = (1 << 0),
   INCLUDE_OR = (1 << 1),
-  INIT_ONLY  = (1 << 2),
+  INIT_ONLY = (1 << 2),
   FORCE_INIT = (1 << 3),
 } MetaPropHookFlags;
 
@@ -79,22 +80,22 @@ struct _MetaWindowPropHooks
   MetaPropHookFlags flags;
 };
 
-static void init_prop_value            (MetaWindow          *window,
-                                        MetaWindowPropHooks *hooks,
-                                        MetaPropValue       *value);
-static void reload_prop_value          (MetaWindow          *window,
-                                        MetaWindowPropHooks *hooks,
-                                        MetaPropValue       *value,
-                                        gboolean             initial);
+static void init_prop_value (MetaWindow          *window,
+                             MetaWindowPropHooks *hooks,
+                             MetaPropValue       *value);
+static void reload_prop_value (MetaWindow          *window,
+                               MetaWindowPropHooks *hooks,
+                               MetaPropValue       *value,
+                               gboolean             initial);
 static MetaWindowPropHooks *find_hooks (MetaX11Display *x11_display,
                                         Atom            property);
 
 
 void
-meta_window_reload_property_from_xwindow (MetaWindow      *window,
-                                          Window           xwindow,
-                                          Atom             property,
-                                          gboolean         initial)
+meta_window_reload_property_from_xwindow (MetaWindow *window,
+                                          Window      xwindow,
+                                          Atom        property,
+                                          gboolean    initial)
 {
   MetaPropValue value = { 0, };
   MetaWindowPropHooks *hooks;
@@ -118,9 +119,9 @@ meta_window_reload_property_from_xwindow (MetaWindow      *window,
 }
 
 static void
-meta_window_reload_property (MetaWindow      *window,
-                             Atom             property,
-                             gboolean         initial)
+meta_window_reload_property (MetaWindow *window,
+                             Atom        property,
+                             gboolean    initial)
 {
   meta_window_reload_property_from_xwindow (window,
                                             window->xwindow,
@@ -201,7 +202,7 @@ reload_prop_value (MetaWindow          *window,
                    gboolean             initial)
 {
   if (!(window->override_redirect && !(hooks->flags & INCLUDE_OR)))
-    (* hooks->reload_func) (window, value, initial);
+    (*hooks->reload_func)(window, value, initial);
 }
 
 static void
@@ -237,8 +238,9 @@ complain_about_broken_client (MetaWindow    *window,
                               MetaPropValue *value,
                               gboolean       initial)
 {
-  meta_warning ("Broken client! Window %s changed client leader window or SM client ID\n",
-                window->desc);
+  meta_warning (
+    "Broken client! Window %s changed client leader window or SM client ID\n",
+    window->desc);
 }
 
 static void
@@ -286,8 +288,8 @@ reload_net_wm_window_type (MetaWindow    *window,
 }
 
 static void
-reload_icon (MetaWindow    *window,
-             Atom           atom)
+reload_icon (MetaWindow *window,
+             Atom        atom)
 {
   MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
   MetaWindowX11Private *priv = window_x11->priv;
@@ -295,7 +297,7 @@ reload_icon (MetaWindow    *window,
   meta_icon_cache_property_changed (&priv->icon_cache,
                                     window->display->x11_display,
                                     atom);
-  meta_window_queue(window, META_QUEUE_UPDATE_ICON);
+  meta_window_queue (window, META_QUEUE_UPDATE_ICON);
 }
 
 static void
@@ -323,17 +325,18 @@ reload_icon_geometry (MetaWindow    *window,
     {
       if (value->v.cardinal_list.n_cardinals != 4)
         {
-          meta_verbose ("_NET_WM_ICON_GEOMETRY on %s has %d values instead of 4\n",
-                        window->desc, value->v.cardinal_list.n_cardinals);
+          meta_verbose (
+            "_NET_WM_ICON_GEOMETRY on %s has %d values instead of 4\n",
+            window->desc, value->v.cardinal_list.n_cardinals);
         }
       else
         {
           MetaRectangle geometry;
 
-          geometry.x = (int)value->v.cardinal_list.cardinals[0];
-          geometry.y = (int)value->v.cardinal_list.cardinals[1];
-          geometry.width = (int)value->v.cardinal_list.cardinals[2];
-          geometry.height = (int)value->v.cardinal_list.cardinals[3];
+          geometry.x = (int) value->v.cardinal_list.cardinals[0];
+          geometry.y = (int) value->v.cardinal_list.cardinals[1];
+          geometry.width = (int) value->v.cardinal_list.cardinals[2];
+          geometry.height = (int) value->v.cardinal_list.cardinals[3];
 
           meta_window_set_icon_geometry (window, &geometry);
         }
@@ -352,7 +355,8 @@ meta_window_set_custom_frame_extents (MetaWindow *window,
   if (extents)
     {
       if (window->has_custom_frame_extents &&
-          memcmp (&window->custom_frame_extents, extents, sizeof (GtkBorder)) == 0)
+          memcmp (&window->custom_frame_extents, extents,
+                  sizeof (GtkBorder)) == 0)
         return;
 
       window->has_custom_frame_extents = TRUE;
@@ -365,8 +369,11 @@ meta_window_set_custom_frame_extents (MetaWindow *window,
        */
       if (is_initial)
         {
-          meta_window_client_rect_to_frame_rect (window, &window->rect, &window->rect);
-          meta_window_client_rect_to_frame_rect (window, &window->unconstrained_rect, 
&window->unconstrained_rect);
+          meta_window_client_rect_to_frame_rect (window, &window->rect,
+                                                 &window->rect);
+          meta_window_client_rect_to_frame_rect (window,
+                                                 &window->unconstrained_rect,
+                                                 &window->unconstrained_rect);
         }
     }
   else
@@ -375,7 +382,8 @@ meta_window_set_custom_frame_extents (MetaWindow *window,
         return;
 
       window->has_custom_frame_extents = FALSE;
-      memset (&window->custom_frame_extents, 0, sizeof (window->custom_frame_extents));
+      memset (&window->custom_frame_extents, 0,
+              sizeof (window->custom_frame_extents));
     }
 
   meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
@@ -396,10 +404,10 @@ reload_gtk_frame_extents (MetaWindow    *window,
       else
         {
           GtkBorder extents;
-          extents.left   = (int)value->v.cardinal_list.cardinals[0];
-          extents.right  = (int)value->v.cardinal_list.cardinals[1];
-          extents.top    = (int)value->v.cardinal_list.cardinals[2];
-          extents.bottom = (int)value->v.cardinal_list.cardinals[3];
+          extents.left = (int) value->v.cardinal_list.cardinals[0];
+          extents.right = (int) value->v.cardinal_list.cardinals[1];
+          extents.top = (int) value->v.cardinal_list.cardinals[2];
+          extents.bottom = (int) value->v.cardinal_list.cardinals[3];
           meta_window_set_custom_frame_extents (window, &extents, initial);
         }
     }
@@ -472,7 +480,8 @@ reload_net_wm_user_time_window (MetaWindow    *window,
       /* Unregister old NET_WM_USER_TIME_WINDOW */
       if (window->user_time_window != None)
         {
-          /* See the comment to the meta_display_register_x_window call below. */
+          /* See the comment to the meta_display_register_x_window call below.
+           * */
           meta_x11_display_unregister_x_window (window->display->x11_display,
                                                 window->user_time_window);
           /* Don't get events on not-managed windows */
@@ -484,12 +493,13 @@ reload_net_wm_user_time_window (MetaWindow    *window,
       /* Ensure the new user time window is not used on another MetaWindow,
        * and unset its user time window if that is the case.
        */
-      prev_owner = meta_x11_display_lookup_x_window (window->display->x11_display,
-                                                     value->v.xwindow);
+      prev_owner = meta_x11_display_lookup_x_window (
+        window->display->x11_display,
+        value->v.xwindow);
       if (prev_owner && prev_owner->user_time_window == value->v.xwindow)
         {
           meta_x11_display_unregister_x_window (window->display->x11_display,
-                                               value->v.xwindow);
+                                                value->v.xwindow);
           prev_owner->user_time_window = None;
         }
 
@@ -541,11 +551,11 @@ reload_net_wm_user_time_window (MetaWindow    *window,
  * Returns: %TRUE if a new title was set.
  */
 static gboolean
-set_title_text (MetaWindow  *window,
-                gboolean     previous_was_modified,
-                const char  *title,
-                Atom         atom,
-                char       **target)
+set_title_text (MetaWindow *window,
+                gboolean    previous_was_modified,
+                const char *title,
+                Atom        atom,
+                char      **target)
 {
   gboolean modified = FALSE;
 
@@ -566,7 +576,7 @@ set_title_text (MetaWindow  *window,
   else if (meta_window_is_remote (window))
     {
       *target = g_strdup_printf (_("%s (on %s)"),
-                      title, window->wm_client_machine);
+                                 title, window->wm_client_machine);
       modified = TRUE;
     }
   else
@@ -697,7 +707,8 @@ reload_opaque_region (MetaWindow    *window,
 
       if (nitems % 4 != 0)
         {
-          meta_verbose ("_NET_WM_OPAQUE_REGION does not have a list of 4-tuples.");
+          meta_verbose (
+            "_NET_WM_OPAQUE_REGION does not have a list of 4-tuples.");
           goto out;
         }
 
@@ -728,7 +739,7 @@ reload_opaque_region (MetaWindow    *window,
       g_free (rects);
     }
 
- out:
+out:
   meta_window_set_opaque_region (window, opaque_region);
   cairo_region_destroy (opaque_region);
 }
@@ -740,9 +751,9 @@ reload_mutter_hints (MetaWindow    *window,
 {
   if (value->type != META_PROP_VALUE_INVALID)
     {
-      char     *new_hints = value->v.str;
-      char     *old_hints = window->mutter_hints;
-      gboolean  changed   = FALSE;
+      char *new_hints = value->v.str;
+      char *old_hints = window->mutter_hints;
+      gboolean changed = FALSE;
 
       if (new_hints)
         {
@@ -791,12 +802,13 @@ reload_net_wm_state (MetaWindow    *window,
    * clients don't change the property.
    */
 
-  if (!initial) {
-    /* no, they DON'T change the property */
-    meta_verbose ("Ignoring _NET_WM_STATE: we should be the one who set "
-                  "the property in the first place\n");
-    return;
-  }
+  if (!initial)
+    {
+      /* no, they DON'T change the property */
+      meta_verbose ("Ignoring _NET_WM_STATE: we should be the one who set "
+                    "the property in the first place\n");
+      return;
+    }
 
   window->shaded = FALSE;
   window->maximized_horizontally = FALSE;
@@ -817,30 +829,41 @@ reload_net_wm_state (MetaWindow    *window,
     {
       if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_SHADED)
         window->shaded = TRUE;
-      else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_MAXIMIZED_HORZ)
+      else if (value->v.atom_list.atoms[i] ==
+               x11_display->atom__NET_WM_STATE_MAXIMIZED_HORZ)
         window->maximize_horizontally_after_placement = TRUE;
-      else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_MAXIMIZED_VERT)
+      else if (value->v.atom_list.atoms[i] ==
+               x11_display->atom__NET_WM_STATE_MAXIMIZED_VERT)
         window->maximize_vertically_after_placement = TRUE;
-      else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_HIDDEN)
+      else if (value->v.atom_list.atoms[i] ==
+               x11_display->atom__NET_WM_STATE_HIDDEN)
         window->minimize_after_placement = TRUE;
-      else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_MODAL)
+      else if (value->v.atom_list.atoms[i] ==
+               x11_display->atom__NET_WM_STATE_MODAL)
         priv->wm_state_modal = TRUE;
-      else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_SKIP_TASKBAR)
+      else if (value->v.atom_list.atoms[i] ==
+               x11_display->atom__NET_WM_STATE_SKIP_TASKBAR)
         priv->wm_state_skip_taskbar = TRUE;
-      else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_SKIP_PAGER)
+      else if (value->v.atom_list.atoms[i] ==
+               x11_display->atom__NET_WM_STATE_SKIP_PAGER)
         priv->wm_state_skip_pager = TRUE;
-      else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_FULLSCREEN)
+      else if (value->v.atom_list.atoms[i] ==
+               x11_display->atom__NET_WM_STATE_FULLSCREEN)
         {
           window->fullscreen = TRUE;
           g_object_notify (G_OBJECT (window), "fullscreen");
         }
-      else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_ABOVE)
+      else if (value->v.atom_list.atoms[i] ==
+               x11_display->atom__NET_WM_STATE_ABOVE)
         window->wm_state_above = TRUE;
-      else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_BELOW)
+      else if (value->v.atom_list.atoms[i] ==
+               x11_display->atom__NET_WM_STATE_BELOW)
         window->wm_state_below = TRUE;
-      else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_DEMANDS_ATTENTION)
+      else if (value->v.atom_list.atoms[i] ==
+               x11_display->atom__NET_WM_STATE_DEMANDS_ATTENTION)
         window->wm_state_demands_attention = TRUE;
-      else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_STICKY)
+      else if (value->v.atom_list.atoms[i] ==
+               x11_display->atom__NET_WM_STATE_STICKY)
         window->on_all_workspaces_requested = TRUE;
 
       ++i;
@@ -886,7 +909,7 @@ reload_mwm_hints (MetaWindow    *window,
   if (hints->flags & MWM_HINTS_DECORATIONS)
     {
       meta_verbose ("Window %s sets MWM_HINTS_DECORATIONS 0x%x\n",
-          window->desc, hints->decorations);
+                    window->desc, hints->decorations);
 
       if (hints->decorations == 0)
         window->mwm_decorated = FALSE;
@@ -989,7 +1012,8 @@ reload_wm_class (MetaWindow    *window,
 {
   if (value->type != META_PROP_VALUE_INVALID)
     {
-      g_autofree gchar *res_class = g_convert (value->v.class_hint.res_class, -1,
+      g_autofree gchar *res_class = g_convert (value->v.class_hint.res_class,
+                                               -1,
                                                "UTF-8", "LATIN1",
                                                NULL, NULL, NULL);
       g_autofree gchar *res_name = g_convert (value->v.class_hint.res_name, -1,
@@ -1003,9 +1027,9 @@ reload_wm_class (MetaWindow    *window,
     }
 
   meta_verbose ("Window %s class: '%s' name: '%s'\n",
-      window->desc,
-      window->res_class ? window->res_class : "none",
-      window->res_name ? window->res_name : "none");
+                window->desc,
+                window->res_class ? window->res_class : "none",
+                window->res_name ? window->res_name : "none");
 }
 
 static void
@@ -1041,22 +1065,22 @@ reload_net_startup_id (MetaWindow    *window,
 
   /* Update timestamp and workspace on a running window */
   if (!window->constructing)
-  {
-    window->initial_timestamp_set = 0;
-    window->initial_workspace_set = 0;
-
-    if (meta_display_apply_startup_properties (window->display, window))
-      {
-
-        if (window->initial_timestamp_set)
-          timestamp = window->initial_timestamp;
-        if (window->initial_workspace_set)
-          workspace = meta_workspace_manager_get_workspace_by_index (workspace_manager,
-                                                                     window->initial_workspace);
+    {
+      window->initial_timestamp_set = 0;
+      window->initial_workspace_set = 0;
 
-        meta_window_activate_with_workspace (window, timestamp, workspace);
-      }
-  }
+      if (meta_display_apply_startup_properties (window->display, window))
+        {
+          if (window->initial_timestamp_set)
+            timestamp = window->initial_timestamp;
+          if (window->initial_workspace_set)
+            workspace = meta_workspace_manager_get_workspace_by_index (
+              workspace_manager,
+              window->initial_workspace);
+
+          meta_window_activate_with_workspace (window, timestamp, workspace);
+        }
+    }
 
   meta_verbose ("New _NET_STARTUP_ID \"%s\" for %s\n",
                 window->startup_id ? window->startup_id : "unset",
@@ -1089,25 +1113,26 @@ reload_update_counter (MetaWindow    *window,
           window->sync_request_counter = value->v.xcounter_list.counters[1];
           window->extended_sync_request_counter = TRUE;
         }
-      meta_verbose ("Window has _NET_WM_SYNC_REQUEST_COUNTER 0x%lx (extended=%s)\n",
-                    window->sync_request_counter,
-                    window->extended_sync_request_counter ? "true" : "false");
+      meta_verbose (
+        "Window has _NET_WM_SYNC_REQUEST_COUNTER 0x%lx (extended=%s)\n",
+        window->sync_request_counter,
+        window->extended_sync_request_counter ? "true" : "false");
 
       if (window->extended_sync_request_counter)
         meta_window_x11_create_sync_request_alarm (window);
     }
 }
 
-#define FLAG_TOGGLED_ON(old,new,flag) \
- (((old)->flags & (flag)) == 0 &&     \
-  ((new)->flags & (flag)) != 0)
+#define FLAG_TOGGLED_ON(old, new, flag) \
+  (((old)->flags & (flag)) == 0 &&     \
+   ((new)->flags & (flag)) != 0)
 
-#define FLAG_TOGGLED_OFF(old,new,flag) \
- (((old)->flags & (flag)) != 0 &&      \
-  ((new)->flags & (flag)) == 0)
+#define FLAG_TOGGLED_OFF(old, new, flag) \
+  (((old)->flags & (flag)) != 0 &&      \
+   ((new)->flags & (flag)) == 0)
 
-#define FLAG_CHANGED(old,new,flag) \
-  (FLAG_TOGGLED_ON(old,new,flag) || FLAG_TOGGLED_OFF(old,new,flag))
+#define FLAG_CHANGED(old, new, flag) \
+  (FLAG_TOGGLED_ON (old, new, flag) || FLAG_TOGGLED_OFF (old, new, flag))
 
 static void
 spew_size_hints_differences (const XSizeHints *old,
@@ -1126,34 +1151,40 @@ spew_size_hints_differences (const XSizeHints *old,
     meta_topic (META_DEBUG_GEOMETRY, "XSizeHints: PSize now %s\n",
                 FLAG_TOGGLED_ON (old, new, PSize) ? "set" : "unset");
   if (FLAG_CHANGED (old, new, PMinSize))
-    meta_topic (META_DEBUG_GEOMETRY, "XSizeHints: PMinSize now %s (%d x %d -> %d x %d)\n",
+    meta_topic (META_DEBUG_GEOMETRY,
+                "XSizeHints: PMinSize now %s (%d x %d -> %d x %d)\n",
                 FLAG_TOGGLED_ON (old, new, PMinSize) ? "set" : "unset",
                 old->min_width, old->min_height,
                 new->min_width, new->min_height);
   if (FLAG_CHANGED (old, new, PMaxSize))
-    meta_topic (META_DEBUG_GEOMETRY, "XSizeHints: PMaxSize now %s (%d x %d -> %d x %d)\n",
+    meta_topic (META_DEBUG_GEOMETRY,
+                "XSizeHints: PMaxSize now %s (%d x %d -> %d x %d)\n",
                 FLAG_TOGGLED_ON (old, new, PMaxSize) ? "set" : "unset",
                 old->max_width, old->max_height,
                 new->max_width, new->max_height);
   if (FLAG_CHANGED (old, new, PResizeInc))
-    meta_topic (META_DEBUG_GEOMETRY, "XSizeHints: PResizeInc now %s (width_inc %d -> %d height_inc %d -> 
%d)\n",
+    meta_topic (META_DEBUG_GEOMETRY,
+                "XSizeHints: PResizeInc now %s (width_inc %d -> %d height_inc %d -> %d)\n",
                 FLAG_TOGGLED_ON (old, new, PResizeInc) ? "set" : "unset",
                 old->width_inc, new->width_inc,
                 old->height_inc, new->height_inc);
   if (FLAG_CHANGED (old, new, PAspect))
-    meta_topic (META_DEBUG_GEOMETRY, "XSizeHints: PAspect now %s (min %d/%d -> %d/%d max %d/%d -> %d/%d)\n",
+    meta_topic (META_DEBUG_GEOMETRY,
+                "XSizeHints: PAspect now %s (min %d/%d -> %d/%d max %d/%d -> %d/%d)\n",
                 FLAG_TOGGLED_ON (old, new, PAspect) ? "set" : "unset",
                 old->min_aspect.x, old->min_aspect.y,
                 new->min_aspect.x, new->min_aspect.y,
                 old->max_aspect.x, old->max_aspect.y,
                 new->max_aspect.x, new->max_aspect.y);
   if (FLAG_CHANGED (old, new, PBaseSize))
-    meta_topic (META_DEBUG_GEOMETRY, "XSizeHints: PBaseSize now %s (%d x %d -> %d x %d)\n",
+    meta_topic (META_DEBUG_GEOMETRY,
+                "XSizeHints: PBaseSize now %s (%d x %d -> %d x %d)\n",
                 FLAG_TOGGLED_ON (old, new, PBaseSize) ? "set" : "unset",
                 old->base_width, old->base_height,
                 new->base_width, new->base_height);
   if (FLAG_CHANGED (old, new, PWinGravity))
-    meta_topic (META_DEBUG_GEOMETRY, "XSizeHints: PWinGravity now %s  (%d -> %d)\n",
+    meta_topic (META_DEBUG_GEOMETRY,
+                "XSizeHints: PWinGravity now %s  (%d -> %d)\n",
                 FLAG_TOGGLED_ON (old, new, PWinGravity) ? "set" : "unset",
                 old->win_gravity, new->win_gravity);
 }
@@ -1364,10 +1395,14 @@ meta_set_normal_hints (MetaWindow *window,
   if (window->size_hints.max_aspect.y < 1)
     window->size_hints.max_aspect.y = 1;
 
-  minw  = window->size_hints.min_width;  minh  = window->size_hints.min_height;
-  maxw  = window->size_hints.max_width;  maxh  = window->size_hints.max_height;
-  basew = window->size_hints.base_width; baseh = window->size_hints.base_height;
-  winc  = window->size_hints.width_inc;  hinc  = window->size_hints.height_inc;
+  minw = window->size_hints.min_width;
+  minh = window->size_hints.min_height;
+  maxw = window->size_hints.max_width;
+  maxh = window->size_hints.max_height;
+  basew = window->size_hints.base_width;
+  baseh = window->size_hints.base_height;
+  winc = window->size_hints.width_inc;
+  hinc = window->size_hints.height_inc;
 
   /* Make sure min and max size hints are consistent with the base + increment
    * size hints.  If they're not, it's not a real big deal, but it means the
@@ -1377,7 +1412,7 @@ meta_set_normal_hints (MetaWindow *window,
   if ((minw - basew) % winc != 0)
     {
       /* Take advantage of integer division throwing away the remainder... */
-      window->size_hints.min_width = basew + ((minw - basew)/winc + 1)*winc;
+      window->size_hints.min_width = basew + ((minw - basew) / winc + 1) * winc;
 
       meta_topic (META_DEBUG_GEOMETRY,
                   "Window %s has width_inc (%d) that does not evenly divide "
@@ -1390,7 +1425,7 @@ meta_set_normal_hints (MetaWindow *window,
   if (maxw != G_MAXINT && (maxw - basew) % winc != 0)
     {
       /* Take advantage of integer division throwing away the remainder... */
-      window->size_hints.max_width = basew + ((maxw - basew)/winc)*winc;
+      window->size_hints.max_width = basew + ((maxw - basew) / winc) * winc;
 
       meta_topic (META_DEBUG_GEOMETRY,
                   "Window %s has width_inc (%d) that does not evenly divide "
@@ -1403,7 +1438,8 @@ meta_set_normal_hints (MetaWindow *window,
   if ((minh - baseh) % hinc != 0)
     {
       /* Take advantage of integer division throwing away the remainder... */
-      window->size_hints.min_height = baseh + ((minh - baseh)/hinc + 1)*hinc;
+      window->size_hints.min_height = baseh + ((minh - baseh) / hinc + 1) *
+                                      hinc;
 
       meta_topic (META_DEBUG_GEOMETRY,
                   "Window %s has height_inc (%d) that does not evenly divide "
@@ -1416,7 +1452,7 @@ meta_set_normal_hints (MetaWindow *window,
   if (maxh != G_MAXINT && (maxh - baseh) % hinc != 0)
     {
       /* Take advantage of integer division throwing away the remainder... */
-      window->size_hints.max_height = baseh + ((maxh - baseh)/hinc)*hinc;
+      window->size_hints.max_height = baseh + ((maxh - baseh) / hinc) * hinc;
 
       meta_topic (META_DEBUG_GEOMETRY,
                   "Window %s has height_inc (%d) that does not evenly divide "
@@ -1454,10 +1490,10 @@ meta_set_normal_hints (MetaWindow *window,
     }
 
   /* Make sure the aspect ratio hints are sane. */
-  minr =         window->size_hints.min_aspect.x /
-         (double)window->size_hints.min_aspect.y;
-  maxr =         window->size_hints.max_aspect.x /
-         (double)window->size_hints.max_aspect.y;
+  minr = window->size_hints.min_aspect.x /
+         (double) window->size_hints.min_aspect.y;
+  maxr = window->size_hints.max_aspect.x /
+         (double) window->size_hints.max_aspect.y;
   if (minr > maxr)
     {
       /* another cracksmoker; not even minimally (self) consistent */
@@ -1472,7 +1508,7 @@ meta_set_normal_hints (MetaWindow *window,
     }
   else /* check consistency of aspect ratio hints with other hints */
     {
-      if (minh > 0 && minr > (maxw / (double)minh))
+      if (minh > 0 && minr > (maxw / (double) minh))
         {
           /* another cracksmoker */
           meta_topic (META_DEBUG_GEOMETRY,
@@ -1483,7 +1519,7 @@ meta_set_normal_hints (MetaWindow *window,
           window->size_hints.min_aspect.x = 1;
           window->size_hints.min_aspect.y = G_MAXINT;
         }
-      if (maxr < (minw / (double)maxh))
+      if (maxr < (minw / (double) maxh))
         {
           /* another cracksmoker */
           meta_topic (META_DEBUG_GEOMETRY,
@@ -1509,7 +1545,8 @@ reload_normal_hints (MetaWindow    *window,
     {
       XSizeHints old_hints;
 
-      meta_topic (META_DEBUG_GEOMETRY, "Updating WM_NORMAL_HINTS for %s\n", window->desc);
+      meta_topic (META_DEBUG_GEOMETRY, "Updating WM_NORMAL_HINTS for %s\n",
+                  window->desc);
 
       old_hints = window->size_hints;
 
@@ -1520,7 +1557,7 @@ reload_normal_hints (MetaWindow    *window,
       meta_window_recalc_features (window);
 
       if (!initial)
-        meta_window_queue(window, META_QUEUE_MOVE_RESIZE);
+        meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
     }
 }
 
@@ -1600,11 +1637,12 @@ reload_wm_hints (MetaWindow    *window,
       if (hints->flags & XUrgencyHint)
         urgent = TRUE;
 
-      meta_verbose ("Read WM_HINTS input: %d iconic: %d group leader: 0x%lx pixmap: 0x%lx mask: 0x%lx\n",
-                    window->input, window->initially_iconic,
-                    window->xgroup_leader,
-                    priv->wm_hints_pixmap,
-                    priv->wm_hints_mask);
+      meta_verbose (
+        "Read WM_HINTS input: %d iconic: %d group leader: 0x%lx pixmap: 0x%lx mask: 0x%lx\n",
+        window->input, window->initially_iconic,
+        window->xgroup_leader,
+        priv->wm_hints_pixmap,
+        priv->wm_hints_mask);
     }
 
   if (window->xgroup_leader != old_group_leader)
@@ -1640,8 +1678,9 @@ reload_transient_for (MetaWindow    *window,
                                                  transient_for);
       if (!parent)
         {
-          meta_warning ("Invalid WM_TRANSIENT_FOR window 0x%lx specified for %s.\n",
-                        transient_for, window->desc);
+          meta_warning (
+            "Invalid WM_TRANSIENT_FOR window 0x%lx specified for %s.\n",
+            transient_for, window->desc);
           transient_for = None;
         }
 
@@ -1650,14 +1689,16 @@ reload_transient_for (MetaWindow    *window,
         {
           if (parent == window)
             {
-              meta_warning ("WM_TRANSIENT_FOR window 0x%lx for %s would create loop.\n",
-                            transient_for, window->desc);
+              meta_warning (
+                "WM_TRANSIENT_FOR window 0x%lx for %s would create loop.\n",
+                transient_for, window->desc);
               transient_for = None;
               break;
             }
 
-          parent = meta_x11_display_lookup_x_window (parent->display->x11_display,
-                                                     parent->xtransient_for);
+          parent = meta_x11_display_lookup_x_window (
+            parent->display->x11_display,
+            parent->xtransient_for);
         }
     }
   else
@@ -1669,7 +1710,8 @@ reload_transient_for (MetaWindow    *window,
   window->xtransient_for = transient_for;
 
   if (window->xtransient_for != None)
-    meta_verbose ("Window %s transient for 0x%lx\n", window->desc, window->xtransient_for);
+    meta_verbose ("Window %s transient for 0x%lx\n", window->desc,
+                  window->xtransient_for);
   else
     meta_verbose ("Window %s is not transient\n", window->desc);
 
@@ -1689,8 +1731,8 @@ reload_gtk_theme_variant (MetaWindow    *window,
                           MetaPropValue *value,
                           gboolean       initial)
 {
-  char     *requested_variant = NULL;
-  char     *current_variant   = window->gtk_theme_variant;
+  char *requested_variant = NULL;
+  char *current_variant = window->gtk_theme_variant;
 
   if (value->type != META_PROP_VALUE_INVALID)
     {
@@ -1718,7 +1760,8 @@ reload_gtk_hide_titlebar_when_maximized (MetaWindow    *window,
   gboolean requested_value = FALSE;
   gboolean current_value = window->hide_titlebar_when_maximized;
 
-  if (!meta_prefs_get_ignore_request_hide_titlebar () && value->type != META_PROP_VALUE_INVALID)
+  if (!meta_prefs_get_ignore_request_hide_titlebar () &&
+      value->type != META_PROP_VALUE_INVALID)
     {
       requested_value = ((int) value->v.cardinal == 1);
       meta_verbose ("Request to hide titlebar for window %s.\n", window->desc);
@@ -1748,15 +1791,17 @@ reload_bypass_compositor (MetaWindow    *window,
   int current_value = window->bypass_compositor;
 
   if (value->type != META_PROP_VALUE_INVALID)
-      requested_value = (int) value->v.cardinal;
+    requested_value = (int) value->v.cardinal;
 
   if (requested_value == current_value)
     return;
 
   if (requested_value == _NET_WM_BYPASS_COMPOSITOR_HINT_ON)
-    meta_verbose ("Request to bypass compositor for window %s.\n", window->desc);
+    meta_verbose ("Request to bypass compositor for window %s.\n",
+                  window->desc);
   else if (requested_value == _NET_WM_BYPASS_COMPOSITOR_HINT_OFF)
-    meta_verbose ("Request to don't bypass compositor for window %s.\n", window->desc);
+    meta_verbose ("Request to don't bypass compositor for window %s.\n",
+                  window->desc);
   else if (requested_value != _NET_WM_BYPASS_COMPOSITOR_HINT_AUTO)
     return;
 
@@ -1772,16 +1817,17 @@ reload_window_opacity (MetaWindow    *window,
   guint8 opacity = 0xFF;
 
   if (value->type != META_PROP_VALUE_INVALID)
-    opacity = (guint8)((gfloat)value->v.cardinal * 255.0 / ((gfloat)0xffffffff));
+    opacity =
+      (guint8) ((gfloat) value->v.cardinal * 255.0 / ((gfloat) 0xffffffff));
 
   meta_window_set_opacity (window, opacity);
 }
 
 #define RELOAD_STRING(var_name, propname) \
   static void                                       \
-  reload_ ## var_name (MetaWindow    *window,       \
-                       MetaPropValue *value,        \
-                       gboolean       initial)      \
+  reload_ ## var_name (MetaWindow * window,       \
+                       MetaPropValue * value,        \
+                       gboolean initial)      \
   {                                                 \
     g_free (window->var_name);                      \
                                                     \
@@ -1793,12 +1839,12 @@ reload_window_opacity (MetaWindow    *window,
     g_object_notify (G_OBJECT (window), propname);  \
   }
 
-RELOAD_STRING (gtk_unique_bus_name,         "gtk-unique-bus-name")
-RELOAD_STRING (gtk_application_id,          "gtk-application-id")
+RELOAD_STRING (gtk_unique_bus_name, "gtk-unique-bus-name")
+RELOAD_STRING (gtk_application_id, "gtk-application-id")
 RELOAD_STRING (gtk_application_object_path, "gtk-application-object-path")
-RELOAD_STRING (gtk_window_object_path,      "gtk-window-object-path")
-RELOAD_STRING (gtk_app_menu_object_path,    "gtk-app-menu-object-path")
-RELOAD_STRING (gtk_menubar_object_path,     "gtk-menubar-object-path")
+RELOAD_STRING (gtk_window_object_path, "gtk-window-object-path")
+RELOAD_STRING (gtk_app_menu_object_path, "gtk-app-menu-object-path")
+RELOAD_STRING (gtk_menubar_object_path, "gtk-menubar-object-path")
 
 #undef RELOAD_STRING
 
@@ -1835,50 +1881,90 @@ meta_x11_display_init_window_prop_hooks (MetaX11Display *x11_display)
    *  - NET_WM_WINDOW_TYPE: can be used to do appropriate handling
    *    for different types of override-redirect windows.
    */
-  MetaWindowPropHooks hooks[] = {
-    { x11_display->atom_WM_CLIENT_MACHINE, META_PROP_VALUE_STRING,   reload_wm_client_machine, LOAD_INIT | 
INCLUDE_OR },
-    { x11_display->atom__NET_WM_NAME,      META_PROP_VALUE_UTF8,     reload_net_wm_name,       LOAD_INIT | 
INCLUDE_OR },
-    { XA_WM_CLASS,                         META_PROP_VALUE_CLASS_HINT, reload_wm_class,        LOAD_INIT | 
INCLUDE_OR },
-    { x11_display->atom__NET_WM_PID,       META_PROP_VALUE_CARDINAL, reload_net_wm_pid,        LOAD_INIT | 
INCLUDE_OR },
-    { XA_WM_NAME,                          META_PROP_VALUE_TEXT_PROPERTY, reload_wm_name,      LOAD_INIT | 
INCLUDE_OR },
-    { x11_display->atom__MUTTER_HINTS,     META_PROP_VALUE_TEXT_PROPERTY, reload_mutter_hints, LOAD_INIT | 
INCLUDE_OR },
-    { x11_display->atom__NET_WM_OPAQUE_REGION, META_PROP_VALUE_CARDINAL_LIST, reload_opaque_region, 
LOAD_INIT | INCLUDE_OR },
-    { x11_display->atom__NET_WM_DESKTOP,   META_PROP_VALUE_CARDINAL, reload_net_wm_desktop,    LOAD_INIT | 
INIT_ONLY },
-    { x11_display->atom__NET_STARTUP_ID,   META_PROP_VALUE_UTF8,     reload_net_startup_id,    LOAD_INIT },
-    { x11_display->atom__NET_WM_SYNC_REQUEST_COUNTER, META_PROP_VALUE_SYNC_COUNTER_LIST, 
reload_update_counter, LOAD_INIT | INCLUDE_OR },
-    { XA_WM_NORMAL_HINTS,                  META_PROP_VALUE_SIZE_HINTS, reload_normal_hints,    LOAD_INIT },
-    { x11_display->atom_WM_PROTOCOLS,      META_PROP_VALUE_ATOM_LIST, reload_wm_protocols,     LOAD_INIT },
-    { XA_WM_HINTS,                         META_PROP_VALUE_WM_HINTS,  reload_wm_hints,         LOAD_INIT },
-    { x11_display->atom__NET_WM_USER_TIME, META_PROP_VALUE_CARDINAL, reload_net_wm_user_time,  LOAD_INIT },
-    { x11_display->atom__NET_WM_STATE,     META_PROP_VALUE_ATOM_LIST, reload_net_wm_state,     LOAD_INIT | 
INIT_ONLY },
-    { x11_display->atom__MOTIF_WM_HINTS,   META_PROP_VALUE_MOTIF_HINTS, reload_mwm_hints,      LOAD_INIT },
-    { XA_WM_TRANSIENT_FOR,                 META_PROP_VALUE_WINDOW,    reload_transient_for,    LOAD_INIT },
-    { x11_display->atom__GTK_THEME_VARIANT, META_PROP_VALUE_UTF8,     reload_gtk_theme_variant, LOAD_INIT },
-    { x11_display->atom__GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED, META_PROP_VALUE_CARDINAL,     
reload_gtk_hide_titlebar_when_maximized, LOAD_INIT },
-    { x11_display->atom__GTK_APPLICATION_ID,               META_PROP_VALUE_UTF8,         
reload_gtk_application_id,               LOAD_INIT },
-    { x11_display->atom__GTK_UNIQUE_BUS_NAME,              META_PROP_VALUE_UTF8,         
reload_gtk_unique_bus_name,              LOAD_INIT },
-    { x11_display->atom__GTK_APPLICATION_OBJECT_PATH,      META_PROP_VALUE_UTF8,         
reload_gtk_application_object_path,      LOAD_INIT },
-    { x11_display->atom__GTK_WINDOW_OBJECT_PATH,           META_PROP_VALUE_UTF8,         
reload_gtk_window_object_path,           LOAD_INIT },
-    { x11_display->atom__GTK_APP_MENU_OBJECT_PATH,         META_PROP_VALUE_UTF8,         
reload_gtk_app_menu_object_path,         LOAD_INIT },
-    { x11_display->atom__GTK_MENUBAR_OBJECT_PATH,          META_PROP_VALUE_UTF8,         
reload_gtk_menubar_object_path,          LOAD_INIT },
-    { x11_display->atom__GTK_FRAME_EXTENTS,                
META_PROP_VALUE_CARDINAL_LIST,reload_gtk_frame_extents,                LOAD_INIT },
-    { x11_display->atom__NET_WM_USER_TIME_WINDOW, META_PROP_VALUE_WINDOW, reload_net_wm_user_time_window, 
LOAD_INIT },
-    { x11_display->atom__NET_WM_ICON,      META_PROP_VALUE_INVALID,  reload_net_wm_icon,  NONE },
-    { x11_display->atom__KWM_WIN_ICON,     META_PROP_VALUE_INVALID,  reload_kwm_win_icon, NONE },
-    { x11_display->atom__NET_WM_ICON_GEOMETRY, META_PROP_VALUE_CARDINAL_LIST, reload_icon_geometry, 
LOAD_INIT },
-    { x11_display->atom_WM_CLIENT_LEADER,  META_PROP_VALUE_INVALID, complain_about_broken_client, NONE },
-    { x11_display->atom_SM_CLIENT_ID,      META_PROP_VALUE_INVALID, complain_about_broken_client, NONE },
-    { x11_display->atom_WM_WINDOW_ROLE,    META_PROP_VALUE_STRING, reload_wm_window_role, LOAD_INIT | 
FORCE_INIT },
-    { x11_display->atom__NET_WM_WINDOW_TYPE, META_PROP_VALUE_ATOM_LIST, reload_net_wm_window_type, LOAD_INIT 
| INCLUDE_OR | FORCE_INIT },
-    { x11_display->atom__NET_WM_STRUT,         META_PROP_VALUE_INVALID, reload_struts, NONE },
-    { x11_display->atom__NET_WM_STRUT_PARTIAL, META_PROP_VALUE_INVALID, reload_struts, NONE },
-    { x11_display->atom__NET_WM_BYPASS_COMPOSITOR, META_PROP_VALUE_CARDINAL,  reload_bypass_compositor, 
LOAD_INIT | INCLUDE_OR },
-    { x11_display->atom__NET_WM_WINDOW_OPACITY, META_PROP_VALUE_CARDINAL, reload_window_opacity, LOAD_INIT | 
INCLUDE_OR },
+  MetaWindowPropHooks hooks[] =
+  {
+    { x11_display->atom_WM_CLIENT_MACHINE, META_PROP_VALUE_STRING,
+      reload_wm_client_machine, LOAD_INIT | INCLUDE_OR },
+    { x11_display->atom__NET_WM_NAME, META_PROP_VALUE_UTF8, reload_net_wm_name,
+      LOAD_INIT | INCLUDE_OR },
+    { XA_WM_CLASS, META_PROP_VALUE_CLASS_HINT, reload_wm_class,
+      LOAD_INIT | INCLUDE_OR },
+    { x11_display->atom__NET_WM_PID, META_PROP_VALUE_CARDINAL,
+      reload_net_wm_pid, LOAD_INIT | INCLUDE_OR },
+    { XA_WM_NAME, META_PROP_VALUE_TEXT_PROPERTY, reload_wm_name,
+      LOAD_INIT | INCLUDE_OR },
+    { x11_display->atom__MUTTER_HINTS, META_PROP_VALUE_TEXT_PROPERTY,
+      reload_mutter_hints, LOAD_INIT | INCLUDE_OR },
+    { x11_display->atom__NET_WM_OPAQUE_REGION, META_PROP_VALUE_CARDINAL_LIST,
+      reload_opaque_region, LOAD_INIT | INCLUDE_OR },
+    { x11_display->atom__NET_WM_DESKTOP, META_PROP_VALUE_CARDINAL,
+      reload_net_wm_desktop, LOAD_INIT | INIT_ONLY },
+    { x11_display->atom__NET_STARTUP_ID, META_PROP_VALUE_UTF8,
+      reload_net_startup_id, LOAD_INIT },
+    { x11_display->atom__NET_WM_SYNC_REQUEST_COUNTER,
+      META_PROP_VALUE_SYNC_COUNTER_LIST, reload_update_counter,
+      LOAD_INIT | INCLUDE_OR },
+    { XA_WM_NORMAL_HINTS, META_PROP_VALUE_SIZE_HINTS, reload_normal_hints,
+      LOAD_INIT },
+    { x11_display->atom_WM_PROTOCOLS, META_PROP_VALUE_ATOM_LIST,
+      reload_wm_protocols, LOAD_INIT },
+    { XA_WM_HINTS, META_PROP_VALUE_WM_HINTS, reload_wm_hints, LOAD_INIT },
+    { x11_display->atom__NET_WM_USER_TIME, META_PROP_VALUE_CARDINAL,
+      reload_net_wm_user_time, LOAD_INIT },
+    { x11_display->atom__NET_WM_STATE, META_PROP_VALUE_ATOM_LIST,
+      reload_net_wm_state, LOAD_INIT | INIT_ONLY },
+    { x11_display->atom__MOTIF_WM_HINTS, META_PROP_VALUE_MOTIF_HINTS,
+      reload_mwm_hints, LOAD_INIT },
+    { XA_WM_TRANSIENT_FOR, META_PROP_VALUE_WINDOW, reload_transient_for,
+      LOAD_INIT },
+    { x11_display->atom__GTK_THEME_VARIANT, META_PROP_VALUE_UTF8,
+      reload_gtk_theme_variant, LOAD_INIT },
+    { x11_display->atom__GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED,
+      META_PROP_VALUE_CARDINAL, reload_gtk_hide_titlebar_when_maximized,
+      LOAD_INIT },
+    { x11_display->atom__GTK_APPLICATION_ID, META_PROP_VALUE_UTF8,
+      reload_gtk_application_id, LOAD_INIT },
+    { x11_display->atom__GTK_UNIQUE_BUS_NAME, META_PROP_VALUE_UTF8,
+      reload_gtk_unique_bus_name, LOAD_INIT },
+    { x11_display->atom__GTK_APPLICATION_OBJECT_PATH, META_PROP_VALUE_UTF8,
+      reload_gtk_application_object_path, LOAD_INIT },
+    { x11_display->atom__GTK_WINDOW_OBJECT_PATH, META_PROP_VALUE_UTF8,
+      reload_gtk_window_object_path, LOAD_INIT },
+    { x11_display->atom__GTK_APP_MENU_OBJECT_PATH, META_PROP_VALUE_UTF8,
+      reload_gtk_app_menu_object_path, LOAD_INIT },
+    { x11_display->atom__GTK_MENUBAR_OBJECT_PATH, META_PROP_VALUE_UTF8,
+      reload_gtk_menubar_object_path, LOAD_INIT },
+    { x11_display->atom__GTK_FRAME_EXTENTS, META_PROP_VALUE_CARDINAL_LIST,
+      reload_gtk_frame_extents, LOAD_INIT },
+    { x11_display->atom__NET_WM_USER_TIME_WINDOW, META_PROP_VALUE_WINDOW,
+      reload_net_wm_user_time_window, LOAD_INIT },
+    { x11_display->atom__NET_WM_ICON, META_PROP_VALUE_INVALID,
+      reload_net_wm_icon, NONE },
+    { x11_display->atom__KWM_WIN_ICON, META_PROP_VALUE_INVALID,
+      reload_kwm_win_icon, NONE },
+    { x11_display->atom__NET_WM_ICON_GEOMETRY, META_PROP_VALUE_CARDINAL_LIST,
+      reload_icon_geometry, LOAD_INIT },
+    { x11_display->atom_WM_CLIENT_LEADER, META_PROP_VALUE_INVALID,
+      complain_about_broken_client, NONE },
+    { x11_display->atom_SM_CLIENT_ID, META_PROP_VALUE_INVALID,
+      complain_about_broken_client, NONE },
+    { x11_display->atom_WM_WINDOW_ROLE, META_PROP_VALUE_STRING,
+      reload_wm_window_role, LOAD_INIT | FORCE_INIT },
+    { x11_display->atom__NET_WM_WINDOW_TYPE, META_PROP_VALUE_ATOM_LIST,
+      reload_net_wm_window_type, LOAD_INIT | INCLUDE_OR | FORCE_INIT },
+    { x11_display->atom__NET_WM_STRUT, META_PROP_VALUE_INVALID, reload_struts,
+      NONE },
+    { x11_display->atom__NET_WM_STRUT_PARTIAL, META_PROP_VALUE_INVALID,
+      reload_struts, NONE },
+    { x11_display->atom__NET_WM_BYPASS_COMPOSITOR, META_PROP_VALUE_CARDINAL,
+      reload_bypass_compositor, LOAD_INIT | INCLUDE_OR },
+    { x11_display->atom__NET_WM_WINDOW_OPACITY, META_PROP_VALUE_CARDINAL,
+      reload_window_opacity, LOAD_INIT | INCLUDE_OR },
     { 0 },
   };
 
   MetaWindowPropHooks *table = g_memdup (hooks, sizeof (hooks)),
-    *cursor = table;
+                      *cursor = table;
 
   g_assert (x11_display->prop_hooks == NULL);
 
@@ -1887,8 +1973,10 @@ meta_x11_display_init_window_prop_hooks (MetaX11Display *x11_display)
 
   while (cursor->property)
     {
-      /* Doing initial loading doesn't make sense if we just want notification */
-      g_assert (!((cursor->flags & LOAD_INIT) && cursor->type == META_PROP_VALUE_INVALID));
+      /* Doing initial loading doesn't make sense if we just want notification
+       * */
+      g_assert (!((cursor->flags & LOAD_INIT) &&
+                  cursor->type == META_PROP_VALUE_INVALID));
 
       /* Forcing initialization doesn't make sense if not loading initially */
       g_assert ((cursor->flags & LOAD_INIT) || !(cursor->flags & FORCE_INIT));
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
index 792528825..16e9c438f 100644
--- a/src/x11/window-x11.c
+++ b/src/x11/window-x11.c
@@ -83,12 +83,12 @@ send_icccm_message (MetaWindow *window,
    * ICCCM Client Messages - Section 4.2.8 of the ICCCM dictates that all
    * client messages will have the following form:
    *
-   *     event type    ClientMessage
-   *     message type  _XA_WM_PROTOCOLS
-   *     window                tmp->w
-   *     format                32
-   *     data[0]               message atom
-   *     data[1]               time stamp
+   *     event type ClientMessage
+   *     message type _XA_WM_PROTOCOLS
+   *     window   tmp->w
+   *     format   32
+   *     data[0]    message atom
+   *     data[1]    time stamp
    */
 
   XClientMessageEvent ev;
@@ -103,7 +103,7 @@ send_icccm_message (MetaWindow *window,
 
   meta_x11_error_trap_push (x11_display);
   XSendEvent (x11_display->xdisplay,
-              window->xwindow, False, 0, (XEvent*) &ev);
+              window->xwindow, False, 0, (XEvent *) &ev);
   meta_x11_error_trap_pop (x11_display);
 }
 
@@ -169,7 +169,8 @@ update_sm_hints (MetaWindow *window)
       window->xclient_leader = leader;
 
       if (meta_prop_get_latin1_string (window->display->x11_display, leader,
-                                       window->display->x11_display->atom_SM_CLIENT_ID,
+                                       window->display->x11_display->
+                                       atom_SM_CLIENT_ID,
                                        &str))
         {
           window->sm_client_id = g_strdup (str);
@@ -188,13 +189,16 @@ update_sm_hints (MetaWindow *window)
           char *str;
 
           str = NULL;
-          if (meta_prop_get_latin1_string (window->display->x11_display, window->xwindow,
-                                           window->display->x11_display->atom_SM_CLIENT_ID,
+          if (meta_prop_get_latin1_string (window->display->x11_display,
+                                           window->xwindow,
+                                           window->display->x11_display->
+                                           atom_SM_CLIENT_ID,
                                            &str))
             {
               if (window->sm_client_id == NULL) /* first time through */
-                meta_warning ("Window %s sets SM_CLIENT_ID on itself, instead of on the WM_CLIENT_LEADER 
window as specified in the ICCCM.\n",
-                              window->desc);
+                meta_warning (
+                  "Window %s sets SM_CLIENT_ID on itself, instead of on the WM_CLIENT_LEADER window as 
specified in the ICCCM.\n",
+                  window->desc);
 
               window->sm_client_id = g_strdup (str);
               meta_XFree (str);
@@ -212,7 +216,8 @@ send_configure_notify (MetaWindow *window)
 {
   MetaX11Display *x11_display = window->display->x11_display;
   MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
-  MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
+  MetaWindowX11Private *priv =
+    meta_window_x11_get_instance_private (window_x11);
   XEvent event;
 
   g_assert (!window->override_redirect);
@@ -266,13 +271,14 @@ send_configure_notify (MetaWindow *window)
 }
 
 static void
-adjust_for_gravity (MetaWindow        *window,
-                    gboolean           coords_assume_border,
-                    int                gravity,
-                    MetaRectangle     *rect)
+adjust_for_gravity (MetaWindow    *window,
+                    gboolean       coords_assume_border,
+                    int            gravity,
+                    MetaRectangle *rect)
 {
   MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
-  MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
+  MetaWindowX11Private *priv =
+    meta_window_x11_get_instance_private (window_x11);
   int ref_x, ref_y;
   int bw;
   int child_x, child_y;
@@ -381,7 +387,7 @@ adjust_for_gravity (MetaWindow        *window,
 }
 
 static void
-meta_window_apply_session_info (MetaWindow *window,
+meta_window_apply_session_info (MetaWindow                  *window,
                                 const MetaWindowSessionInfo *info)
 {
   if (info->stack_position_set)
@@ -428,7 +434,7 @@ meta_window_apply_session_info (MetaWindow *window,
               window->saved_rect.width = info->saved_rect.width;
               window->saved_rect.height = info->saved_rect.height;
             }
-       }
+        }
     }
 
   if (info->on_all_workspaces_set)
@@ -450,12 +456,15 @@ meta_window_apply_session_info (MetaWindow *window,
       tmp = info->workspace_indices;
       while (tmp != NULL)
         {
-          MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
+          MetaWorkspaceManager *workspace_manager =
+            window->display->workspace_manager;
           MetaWorkspace *space;
 
           space =
             meta_workspace_manager_get_workspace_by_index (workspace_manager,
-                                                           GPOINTER_TO_INT (tmp->data));
+                                                           GPOINTER_TO_INT (tmp
+                                                                            ->
+                                                                            data));
 
           if (space)
             spaces = g_slist_prepend (spaces, space);
@@ -495,8 +504,10 @@ meta_window_apply_session_info (MetaWindow *window,
       rect.x = info->rect.x;
       rect.y = info->rect.y;
 
-      rect.width = window->size_hints.base_width + info->rect.width * window->size_hints.width_inc;
-      rect.height = window->size_hints.base_height + info->rect.height * window->size_hints.height_inc;
+      rect.width = window->size_hints.base_width + info->rect.width *
+                   window->size_hints.width_inc;
+      rect.height = window->size_hints.base_height + info->rect.height *
+                    window->size_hints.height_inc;
 
       /* Force old gravity, ignoring anything now set */
       window->size_hints.win_gravity = info->gravity;
@@ -515,7 +526,8 @@ meta_window_x11_manage (MetaWindow *window)
 {
   MetaDisplay *display = window->display;
   MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
-  MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
+  MetaWindowX11Private *priv =
+    meta_window_x11_get_instance_private (window_x11);
 
   meta_icon_cache_init (&priv->icon_cache);
 
@@ -570,7 +582,8 @@ meta_window_x11_manage (MetaWindow *window)
       rect.width = window->size_hints.width;
       rect.height = window->size_hints.height;
 
-      flags = META_MOVE_RESIZE_CONFIGURE_REQUEST | META_MOVE_RESIZE_MOVE_ACTION | 
META_MOVE_RESIZE_RESIZE_ACTION;
+      flags = META_MOVE_RESIZE_CONFIGURE_REQUEST |
+              META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION;
 
       adjust_for_gravity (window, TRUE, gravity, &rect);
       meta_window_client_rect_to_frame_rect (window, &rect, &rect);
@@ -586,7 +599,8 @@ meta_window_x11_unmanage (MetaWindow *window)
 {
   MetaX11Display *x11_display = window->display->x11_display;
   MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
-  MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
+  MetaWindowX11Private *priv =
+    meta_window_x11_get_instance_private (window_x11);
 
   meta_x11_error_trap_push (x11_display);
 
@@ -703,7 +717,8 @@ meta_window_x11_delete (MetaWindow *window,
       meta_topic (META_DEBUG_WINDOW_OPS,
                   "Deleting %s with delete_window request\n",
                   window->desc);
-      send_icccm_message (window, x11_display->atom_WM_DELETE_WINDOW, timestamp);
+      send_icccm_message (window, x11_display->atom_WM_DELETE_WINDOW,
+                          timestamp);
     }
   else
     {
@@ -738,7 +753,8 @@ request_take_focus (MetaWindow *window,
   meta_topic (META_DEBUG_FOCUS, "WM_TAKE_FOCUS(%s, %u)\n",
               window->desc, timestamp);
 
-  send_icccm_message (window, display->x11_display->atom_WM_TAKE_FOCUS, timestamp);
+  send_icccm_message (window, display->x11_display->atom_WM_TAKE_FOCUS,
+                      timestamp);
 }
 
 static void
@@ -795,8 +811,9 @@ meta_window_x11_focus (MetaWindow *window,
                */
               if (window->display->focus_window != NULL &&
                   window->display->focus_window->unmanaging)
-                meta_x11_display_focus_the_no_focus_window (window->display->x11_display,
-                                                            timestamp);
+                meta_x11_display_focus_the_no_focus_window (
+                  window->display->x11_display,
+                  timestamp);
             }
 
           request_take_focus (window, timestamp);
@@ -809,7 +826,8 @@ meta_window_get_client_root_coords (MetaWindow    *window,
                                     MetaRectangle *rect)
 {
   MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
-  MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
+  MetaWindowX11Private *priv =
+    meta_window_x11_get_instance_private (window_x11);
 
   *rect = priv->client_rect;
 
@@ -824,7 +842,8 @@ static void
 meta_window_refresh_resize_popup (MetaWindow *window)
 {
   MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
-  MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
+  MetaWindowX11Private *priv =
+    meta_window_x11_get_instance_private (window_x11);
 
   if (priv->showing_resize_popup)
     {
@@ -841,7 +860,8 @@ meta_window_refresh_resize_popup (MetaWindow *window)
       if (window->size_hints.height_inc > 0)
         display_h /= window->size_hints.height_inc;
 
-      meta_display_show_resize_popup (window->display, TRUE, &rect, display_w, display_h);
+      meta_display_show_resize_popup (window->display, TRUE, &rect, display_w,
+                                      display_h);
     }
   else
     {
@@ -854,7 +874,8 @@ meta_window_x11_grab_op_began (MetaWindow *window,
                                MetaGrabOp  op)
 {
   MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
-  MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
+  MetaWindowX11Private *priv =
+    meta_window_x11_get_instance_private (window_x11);
 
   if (meta_grab_op_is_resizing (op))
     {
@@ -876,7 +897,8 @@ meta_window_x11_grab_op_ended (MetaWindow *window,
                                MetaGrabOp  op)
 {
   MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
-  MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
+  MetaWindowX11Private *priv =
+    meta_window_x11_get_instance_private (window_x11);
 
   if (priv->showing_resize_popup)
     {
@@ -907,14 +929,14 @@ update_net_frame_extents (MetaWindow *window)
 
   meta_topic (META_DEBUG_GEOMETRY,
               "Setting _NET_FRAME_EXTENTS on managed window 0x%lx "
- "to left = %lu, right = %lu, top = %lu, bottom = %lu\n",
+              "to left = %lu, right = %lu, top = %lu, bottom = %lu\n",
               window->xwindow, data[0], data[1], data[2], data[3]);
 
   meta_x11_error_trap_push (x11_display);
   XChangeProperty (x11_display->xdisplay, window->xwindow,
                    x11_display->atom__NET_FRAME_EXTENTS,
                    XA_CARDINAL,
-                   32, PropModeReplace, (guchar*) data, 4);
+                   32, PropModeReplace, (guchar *) data, 4);
   meta_x11_error_trap_pop (x11_display);
 }
 
@@ -991,7 +1013,7 @@ update_gtk_edge_constraints (MetaWindow *window)
                    window->xwindow,
                    x11_display->atom__GTK_EDGE_CONSTRAINTS,
                    XA_CARDINAL, 32, PropModeReplace,
-                   (guchar*) data, 1);
+                   (guchar *) data, 1);
   meta_x11_error_trap_pop (x11_display);
 }
 
@@ -1055,7 +1077,7 @@ send_sync_request (MetaWindow *window)
    * want to use _roundtrip, though?
    */
   ev.data.l[1] = meta_display_get_current_time (window->display);
-  ev.data.l[2] = wait_serial & G_GUINT64_CONSTANT(0xffffffff);
+  ev.data.l[2] = wait_serial & G_GUINT64_CONSTANT (0xffffffff);
   ev.data.l[3] = wait_serial >> 32;
   ev.data.l[4] = window->extended_sync_request_counter ? 1 : 0;
 
@@ -1063,7 +1085,7 @@ send_sync_request (MetaWindow *window)
    * inside an error_trap_push()/pop() pair.
    */
   XSendEvent (x11_display->xdisplay,
-             window->xwindow, False, 0, (XEvent*) &ev);
+              window->xwindow, False, 0, (XEvent *) &ev);
 
   /* We give the window 1 sec to respond to _NET_WM_SYNC_REQUEST;
    * if this time expires, we consider the window unresponsive
@@ -1111,7 +1133,7 @@ meta_window_x11_current_workspace_changed (MetaWindow *window)
   XChangeProperty (x11_display->xdisplay, window->xwindow,
                    x11_display->atom__NET_WM_DESKTOP,
                    XA_CARDINAL,
-                   32, PropModeReplace, (guchar*) data, 1);
+                   32, PropModeReplace, (guchar *) data, 1);
   meta_x11_error_trap_pop (x11_display);
 }
 
@@ -1124,7 +1146,8 @@ meta_window_x11_move_resize_internal (MetaWindow                *window,
                                       MetaMoveResizeResultFlags *result)
 {
   MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
-  MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
+  MetaWindowX11Private *priv =
+    meta_window_x11_get_instance_private (window_x11);
   MetaFrameBorders borders;
   MetaRectangle client_rect;
   int size_dx, size_dy;
@@ -1155,12 +1178,14 @@ meta_window_x11_move_resize_internal (MetaWindow                *window,
       int new_x, new_y;
 
       /* Compute new frame size */
-      new_w = window->rect.width + borders.invisible.left + borders.invisible.right;
+      new_w = window->rect.width + borders.invisible.left +
+              borders.invisible.right;
 
       if (window->shaded)
         new_h = borders.total.top + borders.total.bottom;
       else
-        new_h = window->rect.height + borders.invisible.top + borders.invisible.bottom;
+        new_h = window->rect.height + borders.invisible.top +
+                borders.invisible.bottom;
 
       if (new_w != window->frame->rect.width ||
           new_h != window->frame->rect.height)
@@ -1184,7 +1209,8 @@ meta_window_x11_move_resize_internal (MetaWindow                *window,
     }
 
   /* Calculate the new client rect */
-  meta_window_frame_rect_to_client_rect (window, &constrained_rect, &client_rect);
+  meta_window_frame_rect_to_client_rect (window, &constrained_rect,
+                                         &client_rect);
 
   /* The above client_rect is in root window coordinates. The
    * values we need to pass to XConfigureWindow are in parent
@@ -1213,7 +1239,7 @@ meta_window_x11_move_resize_internal (MetaWindow                *window,
     }
 
   /* If frame extents have changed, fill in other frame fields and
-     change frame's extents property. */
+   *  change frame's extents property. */
   if (window->frame &&
       (window->frame->child_x != borders.total.left ||
        window->frame->child_y != borders.total.top ||
@@ -1296,7 +1322,8 @@ meta_window_x11_move_resize_internal (MetaWindow                *window,
     configure_frame_first = size_dx + size_dy >= 0;
 
   if (configure_frame_first && window->frame)
-    frame_shape_changed = meta_frame_sync_to_window (window->frame, need_resize_frame);
+    frame_shape_changed = meta_frame_sync_to_window (window->frame,
+                                                     need_resize_frame);
 
   values.border_width = 0;
   values.x = client_rect.x;
@@ -1335,7 +1362,8 @@ meta_window_x11_move_resize_internal (MetaWindow                *window,
     }
 
   if (!configure_frame_first && window->frame)
-    frame_shape_changed = meta_frame_sync_to_window (window->frame, need_resize_frame);
+    frame_shape_changed = meta_frame_sync_to_window (window->frame,
+                                                     need_resize_frame);
 
   if (window->frame)
     window->buffer_rect = window->frame->rect;
@@ -1379,7 +1407,8 @@ meta_window_x11_update_struts (MetaWindow *window)
 
   if (meta_prop_get_cardinal_list (window->display->x11_display,
                                    window->xwindow,
-                                   window->display->x11_display->atom__NET_WM_STRUT_PARTIAL,
+                                   window->display->x11_display->
+                                   atom__NET_WM_STRUT_PARTIAL,
                                    &struts, &nitems))
     {
       if (nitems != 12)
@@ -1390,7 +1419,7 @@ meta_window_x11_update_struts (MetaWindow *window)
         {
           /* Pull out the strut info for each side in the hint */
           int i;
-          for (i=0; i<4; i++)
+          for (i = 0; i < 4; i++)
             {
               MetaStrut *temp;
               int thickness, strut_begin, strut_end;
@@ -1398,8 +1427,8 @@ meta_window_x11_update_struts (MetaWindow *window)
               thickness = struts[i];
               if (thickness == 0)
                 continue;
-              strut_begin = struts[4+(i*2)];
-              strut_end   = struts[4+(i*2)+1];
+              strut_begin = struts[4 + (i * 2)];
+              strut_end = struts[4 + (i * 2) + 1];
 
               temp = g_new0 (MetaStrut, 1);
               temp->side = 1 << i; /* See MetaSide def.  Matches nicely, eh? */
@@ -1408,20 +1437,20 @@ meta_window_x11_update_struts (MetaWindow *window)
               switch (temp->side)
                 {
                 case META_SIDE_RIGHT:
-                  temp->rect.x = BOX_RIGHT(temp->rect) - thickness;
-                  /* Intentionally fall through without breaking */
+                  temp->rect.x = BOX_RIGHT (temp->rect) - thickness;
+                /* Intentionally fall through without breaking */
                 case META_SIDE_LEFT:
-                  temp->rect.width  = thickness;
-                  temp->rect.y      = strut_begin;
+                  temp->rect.width = thickness;
+                  temp->rect.y = strut_begin;
                   temp->rect.height = strut_end - strut_begin + 1;
                   break;
                 case META_SIDE_BOTTOM:
-                  temp->rect.y = BOX_BOTTOM(temp->rect) - thickness;
-                  /* Intentionally fall through without breaking */
+                  temp->rect.y = BOX_BOTTOM (temp->rect) - thickness;
+                /* Intentionally fall through without breaking */
                 case META_SIDE_TOP:
                   temp->rect.height = thickness;
-                  temp->rect.x      = strut_begin;
-                  temp->rect.width  = strut_end - strut_begin + 1;
+                  temp->rect.x = strut_begin;
+                  temp->rect.width = strut_end - strut_begin + 1;
                   break;
                 default:
                   g_assert_not_reached ();
@@ -1446,7 +1475,8 @@ meta_window_x11_update_struts (MetaWindow *window)
   if (!new_struts &&
       meta_prop_get_cardinal_list (window->display->x11_display,
                                    window->xwindow,
-                                   window->display->x11_display->atom__NET_WM_STRUT,
+                                   window->display->x11_display->
+                                   atom__NET_WM_STRUT,
                                    &struts, &nitems))
     {
       if (nitems != 4)
@@ -1456,7 +1486,7 @@ meta_window_x11_update_struts (MetaWindow *window)
         {
           /* Pull out the strut info for each side in the hint */
           int i;
-          for (i=0; i<4; i++)
+          for (i = 0; i < 4; i++)
             {
               MetaStrut *temp;
               int thickness;
@@ -1472,14 +1502,14 @@ meta_window_x11_update_struts (MetaWindow *window)
               switch (temp->side)
                 {
                 case META_SIDE_RIGHT:
-                  temp->rect.x = BOX_RIGHT(temp->rect) - thickness;
-                  /* Intentionally fall through without breaking */
+                  temp->rect.x = BOX_RIGHT (temp->rect) - thickness;
+                /* Intentionally fall through without breaking */
                 case META_SIDE_LEFT:
-                  temp->rect.width  = thickness;
+                  temp->rect.width = thickness;
                   break;
                 case META_SIDE_BOTTOM:
-                  temp->rect.y = BOX_BOTTOM(temp->rect) - thickness;
-                  /* Intentionally fall through without breaking */
+                  temp->rect.y = BOX_BOTTOM (temp->rect) - thickness;
+                /* Intentionally fall through without breaking */
                 case META_SIDE_TOP:
                   temp->rect.height = thickness;
                   break;
@@ -1507,8 +1537,8 @@ meta_window_x11_update_struts (MetaWindow *window)
   new_iter = new_struts;
   while (old_iter && new_iter)
     {
-      MetaStrut *old_strut = (MetaStrut*) old_iter->data;
-      MetaStrut *new_strut = (MetaStrut*) new_iter->data;
+      MetaStrut *old_strut = (MetaStrut *) old_iter->data;
+      MetaStrut *new_strut = (MetaStrut *) new_iter->data;
 
       if (old_strut->side != new_strut->side ||
           !meta_rectangle_equal (&old_strut->rect, &new_strut->rect))
@@ -1531,7 +1561,8 @@ meta_window_x11_get_default_skip_hints (MetaWindow *window,
                                         gboolean   *skip_pager_out)
 {
   MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
-  MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
+  MetaWindowX11Private *priv =
+    meta_window_x11_get_instance_private (window_x11);
 
   *skip_taskbar_out = priv->wm_state_skip_taskbar;
   *skip_pager_out = priv->wm_state_skip_pager;
@@ -1543,7 +1574,8 @@ meta_window_x11_update_icon (MetaWindow       *window,
                              cairo_surface_t **mini_icon)
 {
   MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
-  MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
+  MetaWindowX11Private *priv =
+    meta_window_x11_get_instance_private (window_x11);
 
   return meta_read_icons (window->display->x11_display,
                           window->xwindow,
@@ -1557,8 +1589,8 @@ meta_window_x11_update_icon (MetaWindow       *window,
 }
 
 static void
-meta_window_x11_update_main_monitor (MetaWindow                   *window,
-                                     MetaWindowUpdateMonitorFlags  flags)
+meta_window_x11_update_main_monitor (MetaWindow                  *window,
+                                     MetaWindowUpdateMonitorFlags flags)
 {
   window->monitor = meta_window_calculate_main_logical_monitor (window);
 }
@@ -1659,7 +1691,8 @@ meta_window_x11_class_init (MetaWindowX11Class *klass)
   window_class->focus = meta_window_x11_focus;
   window_class->grab_op_began = meta_window_x11_grab_op_began;
   window_class->grab_op_ended = meta_window_x11_grab_op_ended;
-  window_class->current_workspace_changed = meta_window_x11_current_workspace_changed;
+  window_class->current_workspace_changed =
+    meta_window_x11_current_workspace_changed;
   window_class->move_resize_internal = meta_window_x11_move_resize_internal;
   window_class->update_struts = meta_window_x11_update_struts;
   window_class->get_default_skip_hints = meta_window_x11_get_default_skip_hints;
@@ -1667,7 +1700,8 @@ meta_window_x11_class_init (MetaWindowX11Class *klass)
   window_class->update_main_monitor = meta_window_x11_update_main_monitor;
   window_class->main_monitor_changed = meta_window_x11_main_monitor_changed;
   window_class->get_client_pid = meta_window_x11_get_client_pid;
-  window_class->force_restore_shortcuts = meta_window_x11_force_restore_shortcuts;
+  window_class->force_restore_shortcuts =
+    meta_window_x11_force_restore_shortcuts;
   window_class->shortcuts_inhibited = meta_window_x11_shortcuts_inhibited;
   window_class->is_stackable = meta_window_x11_is_stackable;
   window_class->are_updates_frozen = meta_window_x11_are_updates_frozen;
@@ -1678,7 +1712,8 @@ meta_window_x11_set_net_wm_state (MetaWindow *window)
 {
   MetaX11Display *x11_display = window->display->x11_display;
   MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
-  MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
+  MetaWindowX11Private *priv =
+    meta_window_x11_get_instance_private (window_x11);
   int i;
   unsigned long data[13];
 
@@ -1755,7 +1790,7 @@ meta_window_x11_set_net_wm_state (MetaWindow *window)
   XChangeProperty (x11_display->xdisplay, window->xwindow,
                    x11_display->atom__NET_WM_STATE,
                    XA_ATOM,
-                   32, PropModeReplace, (guchar*) data, i);
+                   32, PropModeReplace, (guchar *) data, i);
   meta_x11_error_trap_pop (x11_display);
 
   if (window->fullscreen)
@@ -1763,17 +1798,21 @@ meta_window_x11_set_net_wm_state (MetaWindow *window)
       if (meta_window_has_fullscreen_monitors (window))
         {
           data[0] =
-            meta_x11_display_logical_monitor_to_xinerama_index (window->display->x11_display,
-                                                                window->fullscreen_monitors.top);
+            meta_x11_display_logical_monitor_to_xinerama_index (
+              window->display->x11_display,
+              window->fullscreen_monitors.top);
           data[1] =
-            meta_x11_display_logical_monitor_to_xinerama_index (window->display->x11_display,
-                                                                window->fullscreen_monitors.bottom);
+            meta_x11_display_logical_monitor_to_xinerama_index (
+              window->display->x11_display,
+              window->fullscreen_monitors.bottom);
           data[2] =
-            meta_x11_display_logical_monitor_to_xinerama_index (window->display->x11_display,
-                                                                window->fullscreen_monitors.left);
+            meta_x11_display_logical_monitor_to_xinerama_index (
+              window->display->x11_display,
+              window->fullscreen_monitors.left);
           data[3] =
-            meta_x11_display_logical_monitor_to_xinerama_index (window->display->x11_display,
-                                                                window->fullscreen_monitors.right);
+            meta_x11_display_logical_monitor_to_xinerama_index (
+              window->display->x11_display,
+              window->fullscreen_monitors.right);
 
           meta_verbose ("Setting _NET_WM_FULLSCREEN_MONITORS\n");
           meta_x11_error_trap_push (x11_display);
@@ -1781,7 +1820,7 @@ meta_window_x11_set_net_wm_state (MetaWindow *window)
                            window->xwindow,
                            x11_display->atom__NET_WM_FULLSCREEN_MONITORS,
                            XA_CARDINAL, 32, PropModeReplace,
-                           (guchar*) data, 4);
+                           (guchar *) data, 4);
           meta_x11_error_trap_pop (x11_display);
         }
       else
@@ -1801,12 +1840,12 @@ meta_window_x11_set_net_wm_state (MetaWindow *window)
 
 static cairo_region_t *
 region_create_from_x_rectangles (const XRectangle *rects,
-                                 int n_rects)
+                                 int               n_rects)
 {
   int i;
   cairo_rectangle_int_t *cairo_rects = g_newa (cairo_rectangle_int_t, n_rects);
 
-  for (i = 0; i < n_rects; i ++)
+  for (i = 0; i < n_rects; i++)
     {
       cairo_rects[i].x = rects[i].x;
       cairo_rects[i].y = rects[i].y;
@@ -1859,12 +1898,13 @@ meta_window_x11_update_input_region (MetaWindow *window)
   MetaX11Display *x11_display = window->display->x11_display;
   cairo_region_t *region = NULL;
   MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
-  MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
+  MetaWindowX11Private *priv =
+    meta_window_x11_get_instance_private (window_x11);
 
   /* Decorated windows don't have an input region, because
-     we don't shape the frame to match the client windows
-     (so the events are blocked by the frame anyway)
-  */
+   *  we don't shape the frame to match the client windows
+   *  (so the events are blocked by the frame anyway)
+   */
   if (window->decorated)
     {
       if (window->input_region)
@@ -1972,7 +2012,8 @@ meta_window_x11_update_shape_region (MetaWindow *window)
 {
   MetaX11Display *x11_display = window->display->x11_display;
   MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
-  MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
+  MetaWindowX11Private *priv =
+    meta_window_x11_get_instance_private (window_x11);
   cairo_region_t *region = NULL;
 
   if (META_X11_DISPLAY_HAS_SHAPE (x11_display))
@@ -2031,7 +2072,9 @@ meta_window_x11_update_shape_region (MetaWindow *window)
        * to the client area. Detect these cases, and throw out the
        * bounding region in this case for decorated windows. */
       if (window->decorated &&
-          cairo_region_contains_rectangle (region, &client_area) == CAIRO_REGION_OVERLAP_IN)
+          cairo_region_contains_rectangle (region,
+                                           &client_area) ==
+          CAIRO_REGION_OVERLAP_IN)
         g_clear_pointer (&region, cairo_region_destroy);
     }
 
@@ -2134,10 +2177,10 @@ meta_window_move_resize_request (MetaWindow *window,
   else
     {
       meta_topic (META_DEBUG_GEOMETRY,
-                 "Not allowing position change for window %s PPosition 0x%lx USPosition 0x%lx type %u\n",
-                 window->desc, window->size_hints.flags & PPosition,
-                 window->size_hints.flags & USPosition,
-                 window->type);
+                  "Not allowing position change for window %s PPosition 0x%lx USPosition 0x%lx type %u\n",
+                  window->desc, window->size_hints.flags & PPosition,
+                  window->size_hints.flags & USPosition,
+                  window->type);
     }
 
   width = window->rect.width;
@@ -2204,20 +2247,21 @@ meta_window_move_resize_request (MetaWindow *window,
            * if there are no struts making the workarea smaller than
            * the monitor.
            */
-          if (meta_prefs_get_force_fullscreen() &&
+          if (meta_prefs_get_force_fullscreen () &&
               !window->hide_titlebar_when_maximized &&
-              (window->decorated || !meta_window_is_client_decorated (window)) &&
+              (window->decorated ||
+               !meta_window_is_client_decorated (window)) &&
               meta_rectangle_equal (&rect, &monitor_rect) &&
               window->has_fullscreen_func &&
               !window->fullscreen)
             {
               /*
-              meta_topic (META_DEBUG_GEOMETRY,
-              */
+               *  meta_topic (META_DEBUG_GEOMETRY,
+               */
               meta_warning (
-                           "Treating resize request of legacy application %s as a "
-                           "fullscreen request\n",
-                           window->desc);
+                "Treating resize request of legacy application %s as a "
+                "fullscreen request\n",
+                window->desc);
               meta_window_make_fullscreen_internal (window);
             }
         }
@@ -2233,25 +2277,25 @@ restack_window (MetaWindow *window,
                 MetaWindow *sibling,
                 int         direction)
 {
- switch (direction)
-   {
-   case Above:
-     if (sibling)
-       meta_window_stack_just_above (window, sibling);
-     else
-       meta_window_raise (window);
-     break;
-   case Below:
-     if (sibling)
-       meta_window_stack_just_below (window, sibling);
-     else
-       meta_window_lower (window);
-     break;
-   case TopIf:
-   case BottomIf:
-   case Opposite:
-     break;
-   }
+  switch (direction)
+    {
+    case Above:
+      if (sibling)
+        meta_window_stack_just_above (window, sibling);
+      else
+        meta_window_raise (window);
+      break;
+    case Below:
+      if (sibling)
+        meta_window_stack_just_below (window, sibling);
+      else
+        meta_window_lower (window);
+      break;
+    case TopIf:
+    case BottomIf:
+    case Opposite:
+      break;
+    }
 }
 
 gboolean
@@ -2259,7 +2303,8 @@ meta_window_x11_configure_request (MetaWindow *window,
                                    XEvent     *event)
 {
   MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
-  MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
+  MetaWindowX11Private *priv =
+    meta_window_x11_get_instance_private (window_x11);
 
   /* Note that x, y is the corner of the window border,
    * and width, height is the size of the window inside
@@ -2270,13 +2315,13 @@ meta_window_x11_configure_request (MetaWindow *window,
   if (event->xconfigurerequest.value_mask & CWBorderWidth)
     priv->border_width = event->xconfigurerequest.border_width;
 
-  meta_window_move_resize_request(window,
-                                  event->xconfigurerequest.value_mask,
-                                  window->size_hints.win_gravity,
-                                  event->xconfigurerequest.x,
-                                  event->xconfigurerequest.y,
-                                  event->xconfigurerequest.width,
-                                  event->xconfigurerequest.height);
+  meta_window_move_resize_request (window,
+                                   event->xconfigurerequest.value_mask,
+                                   window->size_hints.win_gravity,
+                                   event->xconfigurerequest.x,
+                                   event->xconfigurerequest.y,
+                                   event->xconfigurerequest.width,
+                                   event->xconfigurerequest.height);
 
   /* Handle stacking. We only handle raises/lowers, mostly because
    * stack.c really can't deal with anything else.  I guess we'll fix
@@ -2315,7 +2360,7 @@ meta_window_x11_configure_request (MetaWindow *window,
                       active_window->desc,
                       active_window->net_wm_user_time);
           if (event->xconfigurerequest.detail == Above)
-            meta_window_set_demands_attention(window);
+            meta_window_set_demands_attention (window);
         }
       else
         {
@@ -2332,8 +2377,9 @@ meta_window_x11_configure_request (MetaWindow *window,
                 return TRUE;
 
               meta_topic (META_DEBUG_STACK,
-                      "xconfigure stacking request from window %s sibling %s stackmode %d\n",
-                      window->desc, sibling->desc, event->xconfigurerequest.detail);
+                          "xconfigure stacking request from window %s sibling %s stackmode %d\n",
+                          window->desc, sibling->desc,
+                          event->xconfigurerequest.detail);
             }
           restack_window (window, sibling, event->xconfigurerequest.detail);
         }
@@ -2350,8 +2396,9 @@ process_property_notify (MetaWindow     *window,
 
   if (meta_is_verbose ()) /* avoid looking up the name if we don't have to */
     {
-      char *property_name = XGetAtomName (window->display->x11_display->xdisplay,
-                                          event->atom);
+      char *property_name = XGetAtomName (
+        window->display->x11_display->xdisplay,
+        event->atom);
 
       meta_verbose ("Property notify on %s for %s\n",
                     window->desc, property_name);
@@ -2361,7 +2408,7 @@ process_property_notify (MetaWindow     *window,
   if (event->atom == window->display->x11_display->atom__NET_WM_USER_TIME &&
       window->user_time_window)
     {
-        xid = window->user_time_window;
+      xid = window->user_time_window;
     }
 
   meta_window_reload_property_from_xwindow (window, xid, event->atom, FALSE);
@@ -2392,7 +2439,8 @@ meta_window_x11_property_notify (MetaWindow *window,
 static int
 query_pressed_buttons (MetaWindow *window)
 {
-  MetaCursorTracker *tracker = meta_cursor_tracker_get_for_display (window->display);
+  MetaCursorTracker *tracker = meta_cursor_tracker_get_for_display (
+    window->display);
   ClutterModifierType mods;
   int button = 0;
 
@@ -2438,7 +2486,8 @@ meta_window_x11_client_message (MetaWindow *window,
 {
   MetaX11Display *x11_display = window->display->x11_display;
   MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
-  MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
+  MetaWindowX11Private *priv =
+    meta_window_x11_get_instance_private (window_x11);
   MetaDisplay *display;
 
   display = window->display;
@@ -2459,7 +2508,7 @@ meta_window_x11_client_message (MetaWindow *window,
       guint32 timestamp;
 
       if (event->xclient.data.l[0] != 0)
-       timestamp = event->xclient.data.l[0];
+        timestamp = event->xclient.data.l[0];
       else
         {
           meta_warning ("Receiving a NET_CLOSE_WINDOW message for %s without "
@@ -2477,7 +2526,8 @@ meta_window_x11_client_message (MetaWindow *window,
            x11_display->atom__NET_WM_DESKTOP)
     {
       int space;
-      MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
+      MetaWorkspaceManager *workspace_manager =
+        window->display->workspace_manager;
       MetaWorkspace *workspace;
 
       space = event->xclient.data.l[0];
@@ -2527,10 +2577,11 @@ meta_window_x11_client_message (MetaWindow *window,
           if (meta_x11_error_trap_pop_with_return (x11_display) != Success)
             str2 = NULL;
 
-          meta_verbose ("Request to change _NET_WM_STATE action %lu atom1: %s atom2: %s\n",
-                        action,
-                        str1 ? str1 : "(unknown)",
-                        str2 ? str2 : "(unknown)");
+          meta_verbose (
+            "Request to change _NET_WM_STATE action %lu atom1: %s atom2: %s\n",
+            action,
+            str1 ? str1 : "(unknown)",
+            str2 ? str2 : "(unknown)");
 
           meta_XFree (str1);
           meta_XFree (str2);
@@ -2562,7 +2613,8 @@ meta_window_x11_client_message (MetaWindow *window,
           gboolean make_fullscreen;
 
           make_fullscreen = (action == _NET_WM_STATE_ADD ||
-                             (action == _NET_WM_STATE_TOGGLE && !window->fullscreen));
+                             (action == _NET_WM_STATE_TOGGLE &&
+                              !window->fullscreen));
           if (make_fullscreen && window->has_fullscreen_func)
             meta_window_make_fullscreen (window);
           else
@@ -2611,7 +2663,7 @@ meta_window_x11_client_message (MetaWindow *window,
             (action == _NET_WM_STATE_TOGGLE && !priv->wm_state_modal);
 
           meta_window_x11_recalc_window_type (window);
-          meta_window_queue(window, META_QUEUE_MOVE_RESIZE);
+          meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
         }
 
       if (first == x11_display->atom__NET_WM_STATE_SKIP_PAGER ||
@@ -2640,7 +2692,8 @@ meta_window_x11_client_message (MetaWindow *window,
           second == x11_display->atom__NET_WM_STATE_ABOVE)
         {
           if ((action == _NET_WM_STATE_ADD) ||
-              (action == _NET_WM_STATE_TOGGLE && !window->wm_state_demands_attention))
+              (action == _NET_WM_STATE_TOGGLE &&
+               !window->wm_state_demands_attention))
             meta_window_make_above (window);
           else
             meta_window_unmake_above (window);
@@ -2661,17 +2714,19 @@ meta_window_x11_client_message (MetaWindow *window,
           second == x11_display->atom__NET_WM_STATE_DEMANDS_ATTENTION)
         {
           if ((action == _NET_WM_STATE_ADD) ||
-              (action == _NET_WM_STATE_TOGGLE && !window->wm_state_demands_attention))
+              (action == _NET_WM_STATE_TOGGLE &&
+               !window->wm_state_demands_attention))
             meta_window_set_demands_attention (window);
           else
             meta_window_unset_demands_attention (window);
         }
 
-       if (first == x11_display->atom__NET_WM_STATE_STICKY ||
+      if (first == x11_display->atom__NET_WM_STATE_STICKY ||
           second == x11_display->atom__NET_WM_STATE_STICKY)
         {
           if ((action == _NET_WM_STATE_ADD) ||
-              (action == _NET_WM_STATE_TOGGLE && !window->on_all_workspaces_requested))
+              (action == _NET_WM_STATE_TOGGLE &&
+               !window->on_all_workspaces_requested))
             meta_window_stick (window);
           else
             meta_window_unstick (window);
@@ -2766,16 +2821,17 @@ meta_window_x11_client_message (MetaWindow *window,
           meta_display_end_grab_op (window->display, timestamp);
         }
       else if (op != META_GRAB_OP_NONE &&
-          ((window->has_move_func && op == META_GRAB_OP_KEYBOARD_MOVING) ||
-           (window->has_resize_func && op == META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN)))
+               ((window->has_move_func && op == META_GRAB_OP_KEYBOARD_MOVING) ||
+                (window->has_resize_func &&
+                 op == META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN)))
         {
           meta_window_begin_grab_op (window, op, frame_action, timestamp);
         }
       else if (op != META_GRAB_OP_NONE &&
                ((window->has_move_func && op == META_GRAB_OP_MOVING) ||
-               (window->has_resize_func &&
-                (op != META_GRAB_OP_MOVING &&
-                 op != META_GRAB_OP_KEYBOARD_MOVING))))
+                (window->has_resize_func &&
+                 (op != META_GRAB_OP_MOVING &&
+                  op != META_GRAB_OP_KEYBOARD_MOVING))))
         {
           int button_mask;
 
@@ -2846,19 +2902,19 @@ meta_window_x11_client_message (MetaWindow *window,
       if (gravity == 0)
         gravity = window->size_hints.win_gravity;
 
-      meta_window_move_resize_request(window,
-                                      value_mask,
-                                      gravity,
-                                      event->xclient.data.l[1],  /* x */
-                                      event->xclient.data.l[2],  /* y */
-                                      event->xclient.data.l[3],  /* width */
-                                      event->xclient.data.l[4]); /* height */
+      meta_window_move_resize_request (window,
+                                       value_mask,
+                                       gravity,
+                                       event->xclient.data.l[1], /* x */
+                                       event->xclient.data.l[2], /* y */
+                                       event->xclient.data.l[3], /* width */
+                                       event->xclient.data.l[4]); /* height */
     }
   else if (event->xclient.message_type ==
            x11_display->atom__NET_ACTIVE_WINDOW)
     {
       MetaClientType source_indication;
-      guint32        timestamp;
+      guint32 timestamp;
 
       meta_verbose ("_NET_ACTIVE_WINDOW request for window '%s', activating\n",
                     window->desc);
@@ -2890,17 +2946,25 @@ meta_window_x11_client_message (MetaWindow *window,
                     window->desc);
 
       top =
-        meta_x11_display_xinerama_index_to_logical_monitor (window->display->x11_display,
-                                                            event->xclient.data.l[0]);
+        meta_x11_display_xinerama_index_to_logical_monitor (
+          window->display->x11_display,
+          event->xclient.data.l[
+            0]);
       bottom =
-        meta_x11_display_xinerama_index_to_logical_monitor (window->display->x11_display,
-                                                            event->xclient.data.l[1]);
+        meta_x11_display_xinerama_index_to_logical_monitor (
+          window->display->x11_display,
+          event->xclient.data.l[
+            1]);
       left =
-        meta_x11_display_xinerama_index_to_logical_monitor (window->display->x11_display,
-                                                            event->xclient.data.l[2]);
+        meta_x11_display_xinerama_index_to_logical_monitor (
+          window->display->x11_display,
+          event->xclient.data.l[
+            2]);
       right =
-        meta_x11_display_xinerama_index_to_logical_monitor (window->display->x11_display,
-                                                            event->xclient.data.l[3]);
+        meta_x11_display_xinerama_index_to_logical_monitor (
+          window->display->x11_display,
+          event->xclient.data.l[
+            3]);
       /* source_indication = event->xclient.data.l[4]; */
 
       meta_window_update_fullscreen_monitors (window, top, bottom, left, right);
@@ -2942,7 +3006,7 @@ set_wm_state_on_xwindow (MetaDisplay *display,
   XChangeProperty (display->x11_display->xdisplay, xwindow,
                    display->x11_display->atom_WM_STATE,
                    display->x11_display->atom_WM_STATE,
-                   32, PropModeReplace, (guchar*) data, 2);
+                   32, PropModeReplace, (guchar *) data, 2);
   meta_x11_error_trap_pop (display->x11_display);
 }
 
@@ -3017,19 +3081,26 @@ maybe_filter_xwindow (MetaDisplay       *display,
 
   if (filtered)
     {
-      /* We want to try and get the window managed by the next WM that come along,
-       * so we need to make sure that windows that are requested to be mapped while
-       * Mutter is running (!must_be_viewable), or windows already viewable at startup
-       * get a non-withdrawn WM_STATE property. Previously unmapped windows are left
+      /* We want to try and get the window managed by the next WM that come
+       * along,
+       * so we need to make sure that windows that are requested to be mapped
+       *while
+       * Mutter is running (!must_be_viewable), or windows already viewable at
+       *startup
+       * get a non-withdrawn WM_STATE property. Previously unmapped windows are
+       *left
        * with whatever WM_STATE property they had.
        */
       if (!must_be_viewable || attrs->map_state == IsViewable)
         {
           uint32_t old_state;
 
-          if (!meta_prop_get_cardinal_with_atom_type (display->x11_display, xwindow,
-                                                      display->x11_display->atom_WM_STATE,
-                                                      display->x11_display->atom_WM_STATE,
+          if (!meta_prop_get_cardinal_with_atom_type (display->x11_display,
+                                                      xwindow,
+                                                      display->x11_display->
+                                                      atom_WM_STATE,
+                                                      display->x11_display->
+                                                      atom_WM_STATE,
                                                       &old_state))
             old_state = WithdrawnState;
 
@@ -3071,20 +3142,22 @@ is_our_xwindow (MetaX11Display    *x11_display,
 
     if (META_IS_BACKEND_X11 (backend))
       {
-        if (xwindow == meta_backend_x11_get_xwindow (META_BACKEND_X11 (backend)))
+        if (xwindow ==
+            meta_backend_x11_get_xwindow (META_BACKEND_X11 (backend)))
           return TRUE;
       }
   }
 
   /* Any windows created via meta_create_offscreen_window */
-  if (attrs->override_redirect && attrs->x == -100 && attrs->y == -100 && attrs->width == 1 && attrs->height 
== 1)
+  if (attrs->override_redirect && attrs->x == -100 && attrs->y == -100 &&
+      attrs->width == 1 && attrs->height == 1)
     return TRUE;
 
   return FALSE;
 }
 
 #ifdef WITH_VERBOSE_MODE
-static const char*
+static const char *
 wm_state_to_string (int state)
 {
   switch (state)
@@ -3102,10 +3175,10 @@ wm_state_to_string (int state)
 #endif
 
 MetaWindow *
-meta_window_x11_new (MetaDisplay       *display,
-                     Window             xwindow,
-                     gboolean           must_be_viewable,
-                     MetaCompEffect     effect)
+meta_window_x11_new (MetaDisplay   *display,
+                     Window         xwindow,
+                     gboolean       must_be_viewable,
+                     MetaCompEffect effect)
 {
   MetaX11Display *x11_display = display->x11_display;
   XWindowAttributes attrs;
@@ -3123,8 +3196,8 @@ meta_window_x11_new (MetaDisplay       *display,
     }
 
   meta_x11_error_trap_push (x11_display); /* Push a trap over all of window
-                                       * creation, to reduce XSync() calls
-                                       */
+                                           * creation, to reduce XSync() calls
+                                           */
   /*
    * This function executes without any server grabs held. This means that
    * the window could have already gone away, or could go away at any point,
@@ -3175,7 +3248,9 @@ meta_window_x11_new (MetaDisplay       *display,
                                                    &state) &&
             (state == IconicState || state == NormalState)))
         {
-          meta_verbose ("Deciding not to manage unmapped or unviewable window 0x%lx\n", xwindow);
+          meta_verbose (
+            "Deciding not to manage unmapped or unviewable window 0x%lx\n",
+            xwindow);
           goto error;
         }
 
@@ -3203,7 +3278,8 @@ meta_window_x11_new (MetaDisplay       *display,
    * the event mask, not replace it. For windows from other clients,
    * attrs.your_event_mask will be empty at this point.
    */
-  XSelectInput (x11_display->xdisplay, xwindow, attrs.your_event_mask | event_mask);
+  XSelectInput (x11_display->xdisplay, xwindow,
+                attrs.your_event_mask | event_mask);
 
   {
     unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
@@ -3253,7 +3329,8 @@ meta_window_x11_new (MetaDisplay       *display,
                                     &attrs);
 
   MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
-  MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
+  MetaWindowX11Private *priv =
+    meta_window_x11_get_instance_private (window_x11);
 
   priv->border_width = attrs.border_width;
 
@@ -3277,41 +3354,45 @@ meta_window_x11_recalc_window_type (MetaWindow *window)
 {
   MetaX11Display *x11_display = window->display->x11_display;
   MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
-  MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
+  MetaWindowX11Private *priv =
+    meta_window_x11_get_instance_private (window_x11);
   MetaWindowType type;
 
   if (priv->type_atom != None)
     {
-      if (priv->type_atom  == x11_display->atom__NET_WM_WINDOW_TYPE_DESKTOP)
+      if (priv->type_atom == x11_display->atom__NET_WM_WINDOW_TYPE_DESKTOP)
         type = META_WINDOW_DESKTOP;
-      else if (priv->type_atom  == x11_display->atom__NET_WM_WINDOW_TYPE_DOCK)
+      else if (priv->type_atom == x11_display->atom__NET_WM_WINDOW_TYPE_DOCK)
         type = META_WINDOW_DOCK;
-      else if (priv->type_atom  == x11_display->atom__NET_WM_WINDOW_TYPE_TOOLBAR)
+      else if (priv->type_atom == x11_display->atom__NET_WM_WINDOW_TYPE_TOOLBAR)
         type = META_WINDOW_TOOLBAR;
-      else if (priv->type_atom  == x11_display->atom__NET_WM_WINDOW_TYPE_MENU)
+      else if (priv->type_atom == x11_display->atom__NET_WM_WINDOW_TYPE_MENU)
         type = META_WINDOW_MENU;
-      else if (priv->type_atom  == x11_display->atom__NET_WM_WINDOW_TYPE_UTILITY)
+      else if (priv->type_atom == x11_display->atom__NET_WM_WINDOW_TYPE_UTILITY)
         type = META_WINDOW_UTILITY;
-      else if (priv->type_atom  == x11_display->atom__NET_WM_WINDOW_TYPE_SPLASH)
+      else if (priv->type_atom == x11_display->atom__NET_WM_WINDOW_TYPE_SPLASH)
         type = META_WINDOW_SPLASHSCREEN;
-      else if (priv->type_atom  == x11_display->atom__NET_WM_WINDOW_TYPE_DIALOG)
+      else if (priv->type_atom == x11_display->atom__NET_WM_WINDOW_TYPE_DIALOG)
         type = META_WINDOW_DIALOG;
-      else if (priv->type_atom  == x11_display->atom__NET_WM_WINDOW_TYPE_NORMAL)
+      else if (priv->type_atom == x11_display->atom__NET_WM_WINDOW_TYPE_NORMAL)
         type = META_WINDOW_NORMAL;
       /* The below are *typically* override-redirect windows, but the spec does
        * not disallow using them for managed windows.
        */
-      else if (priv->type_atom  == x11_display->atom__NET_WM_WINDOW_TYPE_DROPDOWN_MENU)
+      else if (priv->type_atom ==
+               x11_display->atom__NET_WM_WINDOW_TYPE_DROPDOWN_MENU)
         type = META_WINDOW_DROPDOWN_MENU;
-      else if (priv->type_atom  == x11_display->atom__NET_WM_WINDOW_TYPE_POPUP_MENU)
+      else if (priv->type_atom ==
+               x11_display->atom__NET_WM_WINDOW_TYPE_POPUP_MENU)
         type = META_WINDOW_POPUP_MENU;
-      else if (priv->type_atom  == x11_display->atom__NET_WM_WINDOW_TYPE_TOOLTIP)
+      else if (priv->type_atom == x11_display->atom__NET_WM_WINDOW_TYPE_TOOLTIP)
         type = META_WINDOW_TOOLTIP;
-      else if (priv->type_atom  == x11_display->atom__NET_WM_WINDOW_TYPE_NOTIFICATION)
+      else if (priv->type_atom ==
+               x11_display->atom__NET_WM_WINDOW_TYPE_NOTIFICATION)
         type = META_WINDOW_NOTIFICATION;
-      else if (priv->type_atom  == x11_display->atom__NET_WM_WINDOW_TYPE_COMBO)
+      else if (priv->type_atom == x11_display->atom__NET_WM_WINDOW_TYPE_COMBO)
         type = META_WINDOW_COMBO;
-      else if (priv->type_atom  == x11_display->atom__NET_WM_WINDOW_TYPE_DND)
+      else if (priv->type_atom == x11_display->atom__NET_WM_WINDOW_TYPE_DND)
         type = META_WINDOW_DND;
       else
         {
@@ -3398,7 +3479,8 @@ meta_window_x11_configure_notify (MetaWindow      *window,
                                   XConfigureEvent *event)
 {
   MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
-  MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
+  MetaWindowX11Private *priv =
+    meta_window_x11_get_instance_private (window_x11);
 
   g_assert (window->override_redirect);
   g_assert (window->frame == NULL);
@@ -3422,7 +3504,8 @@ meta_window_x11_configure_notify (MetaWindow      *window,
   if (!event->override_redirect && !event->send_event)
     meta_warning ("Unhandled change of windows override redirect status\n");
 
-  meta_compositor_sync_window_geometry (window->display->compositor, window, FALSE);
+  meta_compositor_sync_window_geometry (window->display->compositor, window,
+                                        FALSE);
 }
 
 void
@@ -3492,7 +3575,7 @@ meta_window_x11_set_allowed_actions_hint (MetaWindow *window)
   XChangeProperty (x11_display->xdisplay, window->xwindow,
                    x11_display->atom__NET_WM_ALLOWED_ACTIONS,
                    XA_ATOM,
-                   32, PropModeReplace, (guchar*) data, i);
+                   32, PropModeReplace, (guchar *) data, i);
   meta_x11_error_trap_pop (x11_display);
 #undef MAX_N_ACTIONS
 }
@@ -3516,9 +3599,9 @@ meta_window_x11_create_sync_request_alarm (MetaWindow *window)
    */
   if (window->extended_sync_request_counter)
     {
-      if (!XSyncQueryCounter(x11_display->xdisplay,
-                             window->sync_request_counter,
-                             &init))
+      if (!XSyncQueryCounter (x11_display->xdisplay,
+                              window->sync_request_counter,
+                              &init))
         {
           meta_x11_error_trap_pop_with_return (x11_display);
           window->sync_request_counter = None;
@@ -3526,7 +3609,7 @@ meta_window_x11_create_sync_request_alarm (MetaWindow *window)
         }
 
       window->sync_request_serial =
-        XSyncValueLow32 (init) + ((gint64)XSyncValueHigh32 (init) << 32);
+        XSyncValueLow32 (init) + ((gint64) XSyncValueHigh32 (init) << 32);
     }
   else
     {
@@ -3560,7 +3643,8 @@ meta_window_x11_create_sync_request_alarm (MetaWindow *window)
                                                  &values);
 
   if (meta_x11_error_trap_pop_with_return (x11_display) == Success)
-    meta_x11_display_register_sync_alarm (x11_display, &window->sync_request_alarm, window);
+    meta_x11_display_register_sync_alarm (x11_display,
+                                          &window->sync_request_alarm, window);
   else
     {
       window->sync_request_alarm = None;
@@ -3576,7 +3660,8 @@ meta_window_x11_destroy_sync_request_alarm (MetaWindow *window)
   if (window->sync_request_alarm != None)
     {
       /* Has to be unregistered _before_ clearing the structure field */
-      meta_x11_display_unregister_sync_alarm (x11_display, window->sync_request_alarm);
+      meta_x11_display_unregister_sync_alarm (x11_display,
+                                              window->sync_request_alarm);
       XSyncDestroyAlarm (x11_display->xdisplay,
                          window->sync_request_alarm);
       window->sync_request_alarm = None;
diff --git a/src/x11/xprops.c b/src/x11/xprops.c
index 296cf7cf7..aab20b2c1 100644
--- a/src/x11/xprops.c
+++ b/src/x11/xprops.c
@@ -26,56 +26,56 @@
  */
 
 /***********************************************************
-Copyright 1988 by Wyse Technology, Inc., San Jose, Ca,
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-
-                        All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL AND WYSE DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-EVENT SHALL DIGITAL OR WYSE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-
-******************************************************************/
+ *  Copyright 1988 by Wyse Technology, Inc., San Jose, Ca,
+ *  Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
+ *
+ *                       All Rights Reserved
+ *
+ *  Permission to use, copy, modify, and distribute this software and its
+ *  documentation for any purpose and without fee is hereby granted,
+ *  provided that the above copyright notice appear in all copies and that
+ *  both that copyright notice and this permission notice appear in
+ *  supporting documentation, and that the name Digital not be
+ *  used in advertising or publicity pertaining to distribution of the
+ *  software without specific, written prior permission.
+ *
+ *  DIGITAL AND WYSE DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ *  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ *  EVENT SHALL DIGITAL OR WYSE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ *  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ *  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ *  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ *  PERFORMANCE OF THIS SOFTWARE.
+ *
+ ******************************************************************/
 
 /*
-
-Copyright 1987, 1988, 1998  The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
+ *
+ *  Copyright 1987, 1988, 1998  The Open Group
+ *
+ *  Permission to use, copy, modify, distribute, and sell this software and its
+ *  documentation for any purpose is hereby granted without fee, provided that
+ *  the above copyright notice appear in all copies and that both that
+ *  copyright notice and this permission notice appear in supporting
+ *  documentation.
+ *
+ *  The above copyright notice and this permission notice shall be included
+ *  in all copies or substantial portions of the Software.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ *  IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ *  OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ *  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *  OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *  Except as contained in this notice, the name of The Open Group shall
+ *  not be used in advertising or otherwise to promote the sale, use or
+ *  other dealings in this Software without prior written authorization
+ *  from The Open Group.
+ *
+ */
 
 
 #include "config.h"
@@ -97,13 +97,13 @@ from The Open Group.
 typedef struct
 {
   MetaX11Display *x11_display;
-  Window          xwindow;
-  Atom            xatom;
-  Atom            type;
-  int             format;
-  unsigned long   n_items;
-  unsigned long   bytes_after;
-  unsigned char  *prop;
+  Window xwindow;
+  Atom xatom;
+  Atom type;
+  int format;
+  unsigned long n_items;
+  unsigned long bytes_after;
+  unsigned char *prop;
 } GetPropertyResults;
 
 static gboolean
@@ -156,14 +156,15 @@ validate_or_free_results (GetPropertyResults *results,
   if (res_name == NULL)
     res_name = "unknown";
 
-  meta_warning ("Window 0x%lx has property %s\nthat was expected to have type %s format %d\nand actually has 
type %s format %d n_items %d.\nThis is most likely an application bug, not a window manager bug.\nThe window 
has title=\"%s\" class=\"%s\" name=\"%s\"\n",
-                results->xwindow,
-                prop_name ? prop_name : "(bad atom)",
-                expected_name ? expected_name : "(bad atom)",
-                expected_format,
-                type_name ? type_name : "(bad atom)",
-                results->format, (int) results->n_items,
-                title, res_class, res_name);
+  meta_warning (
+    "Window 0x%lx has property %s\nthat was expected to have type %s format %d\nand actually has type %s 
format %d n_items %d.\nThis is most likely an application bug, not a window manager bug.\nThe window has 
title=\"%s\" class=\"%s\" name=\"%s\"\n",
+    results->xwindow,
+    prop_name ? prop_name : "(bad atom)",
+    expected_name ? expected_name : "(bad atom)",
+    expected_format,
+    type_name ? type_name : "(bad atom)",
+    results->format, (int) results->n_items,
+    title, res_class, res_name);
 
   if (type_name)
     XFree (type_name);
@@ -190,9 +191,9 @@ async_get_property (xcb_connection_t *xcb_conn, Window xwindow,
 }
 
 static gboolean
-async_get_property_finish (xcb_connection_t          *xcb_conn,
-                           xcb_get_property_cookie_t  cookie,
-                           GetPropertyResults        *results)
+async_get_property_finish (xcb_connection_t         *xcb_conn,
+                           xcb_get_property_cookie_t cookie,
+                           GetPropertyResults       *results)
 {
   xcb_get_property_reply_t *reply;
   xcb_generic_error_t *error;
@@ -257,7 +258,7 @@ atom_list_from_results (GetPropertyResults *results,
   if (!validate_or_free_results (results, 32, XA_ATOM, FALSE))
     return FALSE;
 
-  *atoms_p = (uint32_t*) results->prop;
+  *atoms_p = (uint32_t *) results->prop;
   *n_atoms_p = results->n_items;
   results->prop = NULL;
 
@@ -324,8 +325,8 @@ motif_hints_from_results (GetPropertyResults *results,
       return FALSE;
     }
 
-  memcpy(*hints_p, results->prop, MIN (sizeof (MotifWmHints),
-                                       results->n_items * sizeof (uint32_t)));
+  memcpy (*hints_p, results->prop, MIN (sizeof (MotifWmHints),
+                                        results->n_items * sizeof (uint32_t)));
 
   g_free (results->prop);
   results->prop = NULL;
@@ -395,7 +396,7 @@ utf8_string_from_results (GetPropertyResults *results,
     return FALSE;
 
   if (results->n_items > 0 &&
-      !g_utf8_validate ((gchar *)results->prop, results->n_items, NULL))
+      !g_utf8_validate ((gchar *) results->prop, results->n_items, NULL))
     {
       char *name;
 
@@ -454,9 +455,9 @@ utf8_list_from_results (GetPropertyResults *results,
    * by XGetWindowProperty
    */
 
-  retval = g_new0 (char*, n_strings + 1);
+  retval = g_new0 (char *, n_strings + 1);
 
-  p = (char *)results->prop;
+  p = (char *) results->prop;
   i = 0;
   while (i < n_strings)
     {
@@ -467,8 +468,9 @@ utf8_list_from_results (GetPropertyResults *results,
           meta_x11_error_trap_push (results->x11_display);
           name = XGetAtomName (results->x11_display->xdisplay, results->xatom);
           meta_x11_error_trap_pop (results->x11_display);
-          meta_warning ("Property %s on window 0x%lx contained invalid UTF-8 for item %d in the list\n",
-                        name, results->xwindow, i);
+          meta_warning (
+            "Property %s on window 0x%lx contained invalid UTF-8 for item %d in the list\n",
+            name, results->xwindow, i);
           meta_XFree (name);
           g_free (results->prop);
           results->prop = NULL;
@@ -494,11 +496,11 @@ utf8_list_from_results (GetPropertyResults *results,
 
 /* returns g_malloc not Xmalloc memory */
 gboolean
-meta_prop_get_utf8_list (MetaX11Display   *x11_display,
-                         Window            xwindow,
-                         Atom              xatom,
-                         char           ***str_p,
-                         int              *n_str_p)
+meta_prop_get_utf8_list (MetaX11Display *x11_display,
+                         Window          xwindow,
+                         Atom            xatom,
+                         char         ***str_p,
+                         int            *n_str_p)
 {
   GetPropertyResults results;
 
@@ -515,14 +517,14 @@ meta_prop_get_utf8_list (MetaX11Display   *x11_display,
 void
 meta_prop_set_utf8_string_hint (MetaX11Display *x11_display,
                                 Window          xwindow,
-                                Atom           atom,
-                                const char    *val)
+                                Atom            atom,
+                                const char     *val)
 {
   meta_x11_error_trap_push (x11_display);
   XChangeProperty (x11_display->xdisplay,
                    xwindow, atom,
                    x11_display->atom_UTF8_STRING,
-                   8, PropModeReplace, (guchar*) val, strlen (val));
+                   8, PropModeReplace, (guchar *) val, strlen (val));
   meta_x11_error_trap_pop (x11_display);
 }
 
@@ -634,7 +636,7 @@ meta_prop_get_cardinal_with_atom_type (MetaX11Display *x11_display,
 }
 
 static char *
-text_property_to_utf8 (Display *xdisplay,
+text_property_to_utf8 (Display             *xdisplay,
                        const XTextProperty *prop)
 {
   char *ret = NULL;
@@ -644,7 +646,8 @@ text_property_to_utf8 (Display *xdisplay,
   int res;
 
   res = XmbTextPropertyToTextList (xdisplay, prop, &local_list, &count);
-  if (res == XNoMemory || res == XLocaleNotSupported || res == XConverterNotFound)
+  if (res == XNoMemory || res == XLocaleNotSupported ||
+      res == XConverterNotFound)
     goto out;
 
   if (count == 0)
@@ -655,7 +658,7 @@ text_property_to_utf8 (Display *xdisplay,
   else
     ret = g_convert (local_list[0], -1, "UTF-8", charset, NULL, NULL, NULL);
 
- out:
+out:
   XFreeStringList (local_list);
   return ret;
 }
@@ -709,7 +712,7 @@ wm_hints_from_results (GetPropertyResults *results,
 
   hints = calloc (1, sizeof (XWMHints));
 
-  raw = (xPropWMHints*) results->prop;
+  raw = (xPropWMHints *) results->prop;
 
   hints->flags = raw->flags;
   hints->input = (raw->input ? True : False);
@@ -748,30 +751,30 @@ class_hint_from_results (GetPropertyResults *results,
     return FALSE;
 
   len_name = strlen ((char *) results->prop);
-  if (! (class_hint->res_name = malloc (len_name+1)))
+  if (!(class_hint->res_name = malloc (len_name + 1)))
     {
       g_free (results->prop);
       results->prop = NULL;
       return FALSE;
     }
 
-  strcpy (class_hint->res_name, (char *)results->prop);
+  strcpy (class_hint->res_name, (char *) results->prop);
 
   if (len_name == (int) results->n_items)
     len_name--;
 
-  len_class = strlen ((char *)results->prop + len_name + 1);
+  len_class = strlen ((char *) results->prop + len_name + 1);
 
-  if (! (class_hint->res_class = malloc(len_class+1)))
+  if (!(class_hint->res_class = malloc (len_class + 1)))
     {
-      XFree(class_hint->res_name);
+      XFree (class_hint->res_name);
       class_hint->res_name = NULL;
       g_free (results->prop);
       results->prop = NULL;
       return FALSE;
     }
 
-  strcpy (class_hint->res_class, (char *)results->prop + len_name + 1);
+  strcpy (class_hint->res_class, (char *) results->prop + len_name + 1);
 
   g_free (results->prop);
   results->prop = NULL;
@@ -800,7 +803,7 @@ size_hints_from_results (GetPropertyResults *results,
       return FALSE;
     }
 
-  raw = (xPropSizeHints*) results->prop;
+  raw = (xPropSizeHints *) results->prop;
 
   hints = malloc (sizeof (XSizeHints));
 
@@ -809,11 +812,11 @@ size_hints_from_results (GetPropertyResults *results,
   hints->y = raw->y;
   hints->width = raw->width;
   hints->height = raw->height;
-  hints->min_width  = raw->minWidth;
+  hints->min_width = raw->minWidth;
   hints->min_height = raw->minHeight;
-  hints->max_width  = raw->maxWidth;
+  hints->max_width = raw->maxWidth;
   hints->max_height = raw->maxHeight;
-  hints->width_inc  = raw->widthInc;
+  hints->width_inc = raw->widthInc;
   hints->height_inc = raw->heightInc;
   hints->min_aspect.x = raw->minAspectX;
   hints->min_aspect.y = raw->minAspectY;
@@ -829,7 +832,7 @@ size_hints_from_results (GetPropertyResults *results,
       *flags_p |= (PBaseSize | PWinGravity);
     }
 
-  hints->flags &= (*flags_p);  /* get rid of unwanted bits */
+  hints->flags &= (*flags_p);   /* get rid of unwanted bits */
 
   g_free (results->prop);
   results->prop = NULL;
@@ -839,7 +842,7 @@ size_hints_from_results (GetPropertyResults *results,
   return TRUE;
 }
 
-static char*
+static char *
 latin1_to_utf8 (const char *text)
 {
   GString *str;
@@ -890,7 +893,8 @@ meta_prop_get_values (MetaX11Display *x11_display,
                * property notify on an atom we don't care about.
                */
               if (values[i].atom != None)
-                meta_bug ("META_PROP_VALUE_INVALID requested in %s\n", G_STRFUNC);
+                meta_bug ("META_PROP_VALUE_INVALID requested in %s\n",
+                          G_STRFUNC);
               break;
             case META_PROP_VALUE_UTF8_LIST:
             case META_PROP_VALUE_UTF8:
@@ -927,13 +931,14 @@ meta_prop_get_values (MetaX11Display *x11_display,
               break;
             case META_PROP_VALUE_SYNC_COUNTER:
             case META_PROP_VALUE_SYNC_COUNTER_LIST:
-             values[i].required_type = XA_CARDINAL;
+              values[i].required_type = XA_CARDINAL;
               break;
             }
         }
 
       if (values[i].atom != None)
-        tasks[i] = async_get_property (xcb_conn, xwindow, values[i].atom, values[i].required_type);
+        tasks[i] = async_get_property (xcb_conn, xwindow, values[i].atom,
+                                       values[i].required_type);
       ++i;
     }
 
@@ -1015,7 +1020,8 @@ meta_prop_get_values (MetaX11Display *x11_display,
         case META_PROP_VALUE_CARDINAL_LIST:
           if (!cardinal_list_from_results (&results,
                                            &values[i].v.cardinal_list.cardinals,
-                                           &values[i].v.cardinal_list.n_cardinals))
+                                           &values[i].v.cardinal_list.
+                                           n_cardinals))
             values[i].type = META_PROP_VALUE_INVALID;
           break;
         case META_PROP_VALUE_CARDINAL:
@@ -1066,7 +1072,7 @@ meta_prop_get_values (MetaX11Display *x11_display,
           break;
         }
 
-    next:
+next:
       ++i;
     }
 



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