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