cf06837
diff --git a/meson.build b/meson.build
cf06837
index 79ad166..85156ad 100644
cf06837
--- a/meson.build
cf06837
+++ b/meson.build
cf06837
@@ -191,7 +191,7 @@ subdir('lib')
cf06837
 subdir('src')
cf06837
 subdir('daemon')
cf06837
 subdir('plugins/maskcorners')
cf06837
-subdir('plugins/pip')
cf06837
+#subdir('plugins/pip')
cf06837
 subdir('plugins/template')
cf06837
 subdir('plugins/zoom')
cf06837
 if get_option('documentation')
cf06837
diff --git a/src/Background/BackgroundManager.vala b/src/Background/BackgroundManager.vala
cf06837
index d437693..f84ba56 100644
cf06837
--- a/src/Background/BackgroundManager.vala
cf06837
+++ b/src/Background/BackgroundManager.vala
cf06837
@@ -104,11 +104,22 @@ namespace Gala {
cf06837
             }
cf06837
 
cf06837
             new_background_actor = create_background_actor ();
cf06837
+#if HAS_MUTTER338
cf06837
+            var new_content = (Meta.BackgroundContent)new_background_actor.content;
cf06837
+            var old_content = (Meta.BackgroundContent)background_actor.content;
cf06837
+            new_content.vignette_sharpness = old_content.vignette_sharpness;
cf06837
+            new_content.brightness = old_content.brightness;
cf06837
+#else
cf06837
             new_background_actor.vignette_sharpness = background_actor.vignette_sharpness;
cf06837
             new_background_actor.brightness = background_actor.brightness;
cf06837
+#endif
cf06837
             new_background_actor.visible = background_actor.visible;
cf06837
 
cf06837
+#if HAS_MUTTER338
cf06837
+            var background = new_content.background.get_data<unowned Background> ("delegate");
cf06837
+#else
cf06837
             var background = new_background_actor.background.get_data<unowned Background> ("delegate");
cf06837
+#endif
cf06837
 
cf06837
             if (background.is_loaded) {
cf06837
                 swap_background_actor ();
cf06837
@@ -137,7 +148,11 @@ namespace Gala {
cf06837
             var background_actor = new Meta.BackgroundActor (screen, monitor_index);
cf06837
 #endif
cf06837
 
cf06837
+#if HAS_MUTTER338
cf06837
+            ((Meta.BackgroundContent)background_actor.content).background = background.background;
cf06837
+#else
cf06837
             background_actor.background = background.background;
cf06837
+#endif
cf06837
 
cf06837
             insert_child_below (background_actor, null);
cf06837
 
cf06837
diff --git a/src/Background/SystemBackground.vala b/src/Background/SystemBackground.vala
cf06837
index ce54f35..f0c3b95 100644
cf06837
--- a/src/Background/SystemBackground.vala
cf06837
+++ b/src/Background/SystemBackground.vala
cf06837
@@ -64,7 +64,9 @@ namespace Gala {
cf06837
                 system_background.set_file (background_file, GDesktop.BackgroundStyle.WALLPAPER);
cf06837
             }
cf06837
 
cf06837
-#if HAS_MUTTER332
cf06837
+#if HAS_MUTTER338
cf06837
+            ((Meta.BackgroundContent)background_actor.content).background = system_background;
cf06837
+#elif HAS_MUTTER332
cf06837
             background_actor.background = system_background;
cf06837
 #else
cf06837
             background = system_background;
cf06837
diff --git a/src/ScreenshotManager.vala b/src/ScreenshotManager.vala
cf06837
index 4eb9d74..d8031af 100644
cf06837
--- a/src/ScreenshotManager.vala
cf06837
+++ b/src/ScreenshotManager.vala
cf06837
@@ -300,6 +300,21 @@ namespace Gala {
cf06837
 
cf06837
         Cairo.ImageSurface take_screenshot (int x, int y, int width, int height, bool include_cursor) {
cf06837
             Cairo.ImageSurface image;
cf06837
+#if HAS_MUTTER338
cf06837
+            int image_width, image_height;
cf06837
+            float scale;
cf06837
+
cf06837
+            wm.stage.get_capture_final_size ({x, y, width, height}, out image_width, out image_height, out scale);
cf06837
+
cf06837
+            image = new Cairo.ImageSurface (Cairo.Format.ARGB32, image_width, image_height);
cf06837
+
cf06837
+            var paint_flags = Clutter.PaintFlag.NO_CURSORS;
cf06837
+            if (include_cursor) {
cf06837
+                paint_flags |= Clutter.PaintFlag.FORCE_CURSORS;
cf06837
+            }
cf06837
+
cf06837
+            wm.stage.paint_to_buffer ({x, y, width, height}, scale, image.get_data (), image.get_stride (), Cogl.PixelFormat.ARGB_8888, paint_flags);
cf06837
+#else
cf06837
             Clutter.Capture[] captures;
cf06837
             wm.stage.capture (false, {x, y, width, height}, out captures);
cf06837
 
cf06837
@@ -315,6 +330,7 @@ namespace Gala {
cf06837
             }
cf06837
 
cf06837
             image.mark_dirty ();
cf06837
+#endif
cf06837
             return image;
cf06837
         }
cf06837
 
cf06837
diff --git a/src/Widgets/WindowClone.vala b/src/Widgets/WindowClone.vala
cf06837
index 11d71ed..f8c1d5b 100644
cf06837
--- a/src/Widgets/WindowClone.vala
cf06837
+++ b/src/Widgets/WindowClone.vala
cf06837
@@ -361,7 +361,7 @@ namespace Gala {
cf06837
             foreach (var child in get_children ()) {
cf06837
                 if (child != clone && child != active_shape)
cf06837
 #if HAS_MUTTER338
cf06837
-                    child.allocate_preferred_size ();
cf06837
+                    child.allocate_preferred_size (child.x, child.y);
cf06837
 #else
cf06837
                     child.allocate_preferred_size (flags);
cf06837
 #endif
cf06837
diff --git a/src/Widgets/WorkspaceClone.vala b/src/Widgets/WorkspaceClone.vala
cf06837
index 452dbd6..b69778d 100644
cf06837
--- a/src/Widgets/WorkspaceClone.vala
cf06837
+++ b/src/Widgets/WorkspaceClone.vala
cf06837
@@ -54,7 +54,25 @@ namespace Gala {
cf06837
             add_effect (effect);
cf06837
         }
cf06837
 
cf06837
-#if HAS_MUTTER336
cf06837
+#if HAS_MUTTER338
cf06837
+        public override void paint (Clutter.PaintContext context) {
cf06837
+            base.paint (context);
cf06837
+
cf06837
+            unowned Cogl.Framebuffer fb = context.get_framebuffer ();
cf06837
+
cf06837
+            pipeline.set_color4ub (0, 0, 0, 100);
cf06837
+            fb.push_rectangle_clip (0, 0, width, height);
cf06837
+            fb.draw_rectangle (pipeline, 0, 0, width, height);
cf06837
+            fb.pop_clip ();
cf06837
+
cf06837
+            var color = Cogl.Color.from_4ub (255, 255, 255, 25);
cf06837
+            color.premultiply ();
cf06837
+            pipeline.set_color (color);
cf06837
+            fb.push_rectangle_clip (0.5f, 0.5f, width - 1, height - 1);
cf06837
+            fb.draw_rectangle (pipeline, 0.5f, 0.5f, width - 1, height - 1);
cf06837
+            fb.pop_clip ();
cf06837
+        }
cf06837
+#elif HAS_MUTTER336
cf06837
         public override void paint (Clutter.PaintContext context) {
cf06837
             base.paint (context);
cf06837
 
cf06837
diff --git a/src/WindowManager.vala b/src/WindowManager.vala
cf06837
index 527e47b..2edd277 100644
cf06837
--- a/src/WindowManager.vala
cf06837
+++ b/src/WindowManager.vala
cf06837
@@ -95,7 +95,7 @@ namespace Gala {
cf06837
         private GLib.Settings animations_settings;
cf06837
         private GLib.Settings behavior_settings;
cf06837
 
cf06837
-        public WindowManagerGala () {
cf06837
+        construct {
cf06837
             info = Meta.PluginInfo () {name = "Gala", version = Config.VERSION, author = "Gala Developers",
cf06837
                 license = "GPLv3", description = "A nice elementary window manager"};
cf06837
 
cf06837
@@ -109,9 +109,7 @@ namespace Gala {
cf06837
             Meta.Prefs.override_preference_schema ("edge-tiling", Config.SCHEMA + ".behavior");
cf06837
             Meta.Prefs.override_preference_schema ("enable-animations", Config.SCHEMA + ".animations");
cf06837
 #endif
cf06837
-        }
cf06837
 
cf06837
-        construct {
cf06837
             animations_settings = new GLib.Settings (Config.SCHEMA + ".animations");
cf06837
             animations_settings.bind ("enable-animations", this, "enable-animations", GLib.SettingsBindFlags.GET);
cf06837
             behavior_settings = new GLib.Settings (Config.SCHEMA + ".behavior");
cf06837
@@ -119,7 +117,7 @@ namespace Gala {
cf06837
         }
cf06837
 
cf06837
         public override void start () {
cf06837
-            Meta.Util.later_add (Meta.LaterType.BEFORE_REDRAW, show_stage);
cf06837
+            show_stage ();
cf06837
 
cf06837
             Bus.watch_name (BusType.SESSION, DAEMON_DBUS_NAME, BusNameWatcherFlags.NONE, daemon_appeared, lost_daemon);
cf06837
 
cf06837
@@ -193,7 +191,10 @@ namespace Gala {
cf06837
             var color = background_settings.get_string ("primary-color");
cf06837
             stage.background_color = Clutter.Color.from_string (color);
cf06837
 
cf06837
-            WorkspaceManager.init (this);
cf06837
+            Meta.Util.later_add (Meta.LaterType.BEFORE_REDRAW, () => {
cf06837
+                WorkspaceManager.init (this);
cf06837
+                return false;
cf06837
+            });
cf06837
 
cf06837
             /* our layer structure, copied from gnome-shell (from bottom to top):
cf06837
              * stage
cf06837
diff --git a/vapi/Clutter-7.metadata b/vapi/Clutter-7.metadata
cf06837
index 71e2926..00b0869 100644
cf06837
--- a/vapi/Clutter-7.metadata
cf06837
+++ b/vapi/Clutter-7.metadata
cf06837
@@ -62,6 +62,10 @@ Container
cf06837
 Stage.read_pixels
cf06837
 	.width default=-1
cf06837
 	.height default=-1
cf06837
+Stage.get_capture_final_size
cf06837
+	.width out
cf06837
+	.height out
cf06837
+	.scale out
cf06837
 Text
cf06837
 	.position_to_coords.line_height default=null
cf06837
 
cf06837
diff --git a/vapi/libmutter.vapi b/vapi/libmutter.vapi
cf06837
index b96cb10..d3e1a69 100644
cf06837
--- a/vapi/libmutter.vapi
cf06837
+++ b/vapi/libmutter.vapi
cf06837
@@ -224,7 +224,7 @@ namespace Meta {
cf06837
 		[NoAccessorMethod]
cf06837
 		public int monitor { get; construct; }
cf06837
 	}
cf06837
-	[CCode (cheader_filename = "meta/main.h", type_id = "meta_background_content_get_type ()")]
cf06837
+	[CCode (cheader_filename = "meta/meta-background-content.h", type_id = "meta_background_content_get_type ()")]
cf06837
 	public class BackgroundContent : GLib.Object, Clutter.Content {
cf06837
 		[CCode (has_construct_function = false, type = "ClutterContent*")]
cf06837
 		public BackgroundContent (Meta.Display display, int monitor);
cf06837
diff --git a/vapi/mutter-clutter.vapi b/vapi/mutter-clutter.vapi
cf06837
index 097c285..958fd9d 100644
cf06837
--- a/vapi/mutter-clutter.vapi
cf06837
+++ b/vapi/mutter-clutter.vapi
cf06837
@@ -7918,7 +7918,7 @@ namespace Clutter {
cf06837
 #endif
cf06837
 #if HAS_MUTTER336
cf06837
 		public unowned Clutter.Actor get_actor_at_pos (Clutter.PickMode pick_mode, float x, float y);
cf06837
-		public bool get_capture_final_size (Cairo.RectangleInt rect, int width, int height, float scale);
cf06837
+		public bool get_capture_final_size (Cairo.RectangleInt rect, out int width, out int height, out float scale);
cf06837
 #else
cf06837
 		public unowned Clutter.Actor get_actor_at_pos (Clutter.PickMode pick_mode, int x, int y);
cf06837
 #endif
cf06837
@@ -7969,7 +7969,7 @@ namespace Clutter {
cf06837
 		public bool get_user_resizable ();
cf06837
 #endif
cf06837
 #if HAS_MUTTER338
cf06837
-		public bool paint_to_buffer (Cairo.RectangleInt rect, float scale, uint8 data, int stride, Cogl.PixelFormat format, Clutter.PaintFlag paint_flags) throws GLib.Error;
cf06837
+		public bool paint_to_buffer (Cairo.RectangleInt rect, float scale, [CCode (array_length = false)] uint8[] data, int stride, Cogl.PixelFormat format, Clutter.PaintFlag paint_flags) throws GLib.Error;
cf06837
 		public void paint_to_framebuffer (Cogl.Framebuffer framebuffer, Cairo.RectangleInt rect, float scale, Clutter.PaintFlag paint_flags);
cf06837
 #else
cf06837
 		[Version (since = "0.4")]