Skip to content

Instantly share code, notes, and snippets.

@Tireg
Created November 4, 2019 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tireg/40a88ef867e978644ef3024d3d28ec55 to your computer and use it in GitHub Desktop.
Save Tireg/40a88ef867e978644ef3024d3d28ec55 to your computer and use it in GitHub Desktop.
Fix use of derived MetaBackgroundActor for elementary/gala (Mutter 3.32)
diff --git a/src/Background/SystemBackground.vala b/src/Background/SystemBackground.vala
index 4ca70ab..18210be 100644
--- a/src/Background/SystemBackground.vala
+++ b/src/Background/SystemBackground.vala
@@ -17,7 +17,7 @@
namespace Gala
{
-#if HAS_MUTTER334
+#if HAS_MUTTER332
public class SystemBackground : GLib.Object
#else
public class SystemBackground : Meta.BackgroundActor
@@ -26,7 +26,7 @@ namespace Gala
const Clutter.Color DEFAULT_BACKGROUND_COLOR = { 0x2e, 0x34, 0x36, 0xff };
static Meta.Background? system_background = null;
-#if HAS_MUTTER334
+#if HAS_MUTTER332
public Meta.BackgroundActor background_actor { get; construct; }
#endif
@@ -35,7 +35,7 @@ namespace Gala
#if HAS_MUTTER330
public SystemBackground (Meta.Display display)
{
-#if HAS_MUTTER334
+#if HAS_MUTTER332
Object (background_actor: new Meta.BackgroundActor (display, 0));
#else
Object (meta_display: display, monitor: 0);
@@ -57,7 +57,7 @@ namespace Gala
}
if (system_background == null) {
-#if HAS_MUTTER334
+#if HAS_MUTTER332
system_background = new Meta.Background (background_actor.meta_display);
#elif HAS_MUTTER330
system_background = new Meta.Background (meta_display);
@@ -68,7 +68,7 @@ namespace Gala
system_background.set_file (background_file, GDesktop.BackgroundStyle.WALLPAPER);
}
-#if HAS_MUTTER334
+#if HAS_MUTTER332
background_actor.background = system_background;
#else
background = system_background;
diff --git a/src/WindowManager.vala b/src/WindowManager.vala
index fde78d1..f40976e 100644
--- a/src/WindowManager.vala
+++ b/src/WindowManager.vala
@@ -209,7 +209,7 @@ namespace Gala
var system_background = new SystemBackground (screen);
#endif
-#if HAS_MUTTER334
+#if HAS_MUTTER332
system_background.background_actor.add_constraint (new Clutter.BindConstraint (stage,
Clutter.BindCoordinate.ALL, 0));
stage.insert_child_below (system_background.background_actor, null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment