commit:     002602af135042ef47020a2b22478f82c9e1031a
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 18 10:04:08 2023 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Mon Dec 18 10:19:11 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=002602af

x11-wm/mutter: Fix memory leak in fullscreen mode

Apply upstream patch to fix a leak when running apps in fullscreen.
It will be included in the next point release.

Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 .../mutter/files/mutter-45.2-fullscreen-leak.patch | 37 ++++++++++++++++++++++
 x11-wm/mutter/mutter-45.2.ebuild                   |  1 +
 2 files changed, 38 insertions(+)

diff --git a/x11-wm/mutter/files/mutter-45.2-fullscreen-leak.patch 
b/x11-wm/mutter/files/mutter-45.2-fullscreen-leak.patch
new file mode 100644
index 000000000000..adbd309c1b7c
--- /dev/null
+++ b/x11-wm/mutter/files/mutter-45.2-fullscreen-leak.patch
@@ -0,0 +1,37 @@
+From bedf8df88f41c34c9824dccba507c8e333dd9ba6 Mon Sep 17 00:00:00 2001
+From: Robert Balas <bl...@r14s.ch>
+Date: Mon, 4 Dec 2023 00:27:49 +0100
+Subject: [PATCH] clutter: Fix memory leak when running in fullscreen
+
+`clutter_stage_do_paint_view()` only gets called when leaving fullscreen
+and by that time enough calls to
+`clutter_actor_get_transformed_paint_volume()` can make the underlying
+GArray grow to a large size.
+
+To fix this, we call call the cleanup function in
+`clutter_stage_finish_layout()` to make it happen every frame.
+
+Co-authored-by: Sebastian Keller <skel...@gnome.org>
+
+Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3191
+Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3439>
+---
+ clutter/clutter/clutter-stage.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c
+index 55bb81c2b46..deb383fe216 100644
+--- a/clutter/clutter/clutter-stage.c
++++ b/clutter/clutter/clutter-stage.c
+@@ -970,6 +970,8 @@ clutter_stage_finish_layout (ClutterStage *stage)
+     }
+ 
+   g_warn_if_fail (!priv->actor_needs_immediate_relayout);
++
++  _clutter_stage_paint_volume_stack_free_all (stage);
+ }
+ 
+ void
+-- 
+GitLab
+

diff --git a/x11-wm/mutter/mutter-45.2.ebuild b/x11-wm/mutter/mutter-45.2.ebuild
index f6f42162b174..40a5b53d810c 100644
--- a/x11-wm/mutter/mutter-45.2.ebuild
+++ b/x11-wm/mutter/mutter-45.2.ebuild
@@ -141,6 +141,7 @@ BDEPEND="
 
 PATCHES=(
        "${FILESDIR}"/${PN}-43.0-Disable-anonymous-file-test.patch
+       "${FILESDIR}"/${P}-fullscreen-leak.patch
 )
 
 python_check_deps() {

Reply via email to