Skip to content

Commit

Permalink
gnome.mutter43: Apply fixes for GLib 2.76
Browse files Browse the repository at this point in the history
This is a downstream patch because the code path is gone in mutter 44.
We should give mutter 44 some try once gala supports it.

Fixes elementary/gala#1580
  • Loading branch information
bobby285271 committed Mar 25, 2023
1 parent 5697d92 commit 3aba8d8
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkgs/desktops/gnome/core/mutter/43/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ stdenv.mkDerivation (finalAttrs: {
url = "https://gitlab.gnome.org/GNOME/mutter/-/commit/285a5a4d54ca83b136b787ce5ebf1d774f9499d5.patch";
sha256 = "/npUE3idMSTVlFptsDpZmGWjZ/d2gqruVlJKq4eF4xU=";
})

# GLib 2.76 switches from using its own slice allocator to using the system malloc instead.
# This makes dragging window between workspace in multitasking view crashes Pantheon's Gala.
# Inspiration https://github.com/mate-desktop/mate-desktop/pull/538
# Backtrace https://github.com/elementary/gala/issues/1580
# Upstream report https://gitlab.gnome.org/GNOME/mutter/-/issues/2495
# The patch will not apply on 44.0+, make sure this is fixed when trying to clean this up.
./glib-2-76-gala-crash.patch
];

mesonFlags = [
Expand Down
25 changes: 25 additions & 0 deletions pkgs/desktops/gnome/core/mutter/43/glib-2-76-gala-crash.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index d34c8f59f..8835a6a33 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -12304,7 +12304,7 @@ clutter_actor_run_actions (ClutterActor *self,
ClutterEventPhase phase)
{
ClutterActorPrivate *priv;
- const GList *actions, *l;
+ const GList *actions, *l, *next;
gboolean retval = CLUTTER_EVENT_PROPAGATE;

priv = self->priv;
@@ -12313,9 +12313,10 @@ clutter_actor_run_actions (ClutterActor *self,

actions = _clutter_meta_group_peek_metas (priv->actions);

- for (l = actions; l; l = l->next)
+ for (l = actions; l; l = next)
{
ClutterAction *action = l->data;
+ next = l->next;
ClutterEventPhase action_phase;

action_phase = clutter_action_get_phase (action);

0 comments on commit 3aba8d8

Please sign in to comment.