From c35f0ace05c8ea56ac01ddd1e9bb24e993e6ec5b Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 18 2020 17:40:25 +0000 Subject: import mutter-3.28.3-30.el7 --- diff --git a/SOURCES/0001-clutter-actor-Don-t-emit-the-parent-set-signal-on-de.patch b/SOURCES/0001-clutter-actor-Don-t-emit-the-parent-set-signal-on-de.patch new file mode 100644 index 0000000..c845f2f --- /dev/null +++ b/SOURCES/0001-clutter-actor-Don-t-emit-the-parent-set-signal-on-de.patch @@ -0,0 +1,92 @@ +From be7ac5afa6227484b997a1770dab01a42ea2a035 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= +Date: Tue, 10 Sep 2019 03:19:58 +0200 +Subject: [PATCH 1/2] clutter/actor: Don't emit the parent-set signal on + destruction + +Clutter actors unset their parent on dispose, after emitting the ::destroy +signal, however this could cause ::parent-set signal emission. Since we +assume that after the destruction has been completed the actor isn't valid +anymore, and that during the destroy phase we do all the signal / source +disconnections, this might create unwanted behaviors, as in the signal +callbacks we always assume that the actor isn't in disposed yet. + +To avoid this, don't emit ::parent-set signal if the actor is being +destroyed. + +Update the actor-destroy test to verify this behavior. + +https://gitlab.gnome.org/GNOME/mutter/merge_requests/769 +(cherry picked from commit f376a318ba90fc29d3d661df4f55698459f31cfa) +--- + clutter/clutter/clutter-actor.c | 3 ++- + clutter/tests/conform/actor-destroy.c | 16 ++++++++++++++++ + 2 files changed, 18 insertions(+), 1 deletion(-) + +diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c +index 7111d824d3..0e531eea52 100644 +--- a/clutter/clutter/clutter-actor.c ++++ b/clutter/clutter/clutter-actor.c +@@ -4315,7 +4315,8 @@ clutter_actor_remove_child_internal (ClutterActor *self, + } + + /* clutter_actor_reparent() will emit ::parent-set for us */ +- if (emit_parent_set && !CLUTTER_ACTOR_IN_REPARENT (child)) ++ if (emit_parent_set && !CLUTTER_ACTOR_IN_REPARENT (child) && ++ !CLUTTER_ACTOR_IN_DESTRUCTION (child)) + g_signal_emit (child, actor_signals[PARENT_SET], 0, self); + + /* if the child was mapped then we need to relayout ourselves to account +diff --git a/clutter/tests/conform/actor-destroy.c b/clutter/tests/conform/actor-destroy.c +index 03092a0108..14ad1a25c8 100644 +--- a/clutter/tests/conform/actor-destroy.c ++++ b/clutter/tests/conform/actor-destroy.c +@@ -159,15 +159,28 @@ on_destroy (ClutterActor *actor, + { + gboolean *destroy_called = data; + ++ g_assert_true (CLUTTER_IS_ACTOR (clutter_actor_get_parent (actor))); ++ + *destroy_called = TRUE; + } + ++static void ++on_parent_set (ClutterActor *actor, ++ ClutterActor *old_parent, ++ gpointer data) ++{ ++ gboolean *parent_set_called = data; ++ ++ *parent_set_called = TRUE; ++} ++ + static void + actor_destruction (void) + { + ClutterActor *test = g_object_new (TEST_TYPE_DESTROY, NULL); + ClutterActor *child = clutter_rectangle_new (); + gboolean destroy_called = FALSE; ++ gboolean parent_set_called = FALSE; + + g_object_ref_sink (test); + +@@ -179,6 +192,8 @@ actor_destruction (void) + + clutter_actor_set_name (child, "Child"); + clutter_container_add_actor (CLUTTER_CONTAINER (test), child); ++ g_signal_connect (child, "parent-set", G_CALLBACK (on_parent_set), ++ &parent_set_called); + g_signal_connect (child, "destroy", G_CALLBACK (on_destroy), &destroy_called); + + if (g_test_verbose ()) +@@ -186,6 +201,7 @@ actor_destruction (void) + + clutter_actor_destroy (test); + g_assert (destroy_called); ++ g_assert_false (parent_set_called); + g_assert_null (child); + g_assert_null (test); + } +-- +2.28.0 + diff --git a/SOURCES/0001-idle-monitor-NULL-check-cached-InhibitedActions-prop.patch b/SOURCES/0001-idle-monitor-NULL-check-cached-InhibitedActions-prop.patch new file mode 100644 index 0000000..fd98419 --- /dev/null +++ b/SOURCES/0001-idle-monitor-NULL-check-cached-InhibitedActions-prop.patch @@ -0,0 +1,89 @@ +From fd5f67d2e3459168f9cf83648d5f7f91eccca61e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonas=20=C3=85dahl?= +Date: Thu, 14 Jun 2018 17:43:27 +0200 +Subject: [PATCH] idle-monitor: NULL check cached InhibitedActions property + variant + +We might not have a cached "InhibitedActions" property available for us, +so do as elsewhere in this file and NULL check before processing it. + +https://gitlab.gnome.org/GNOME/mutter/merge_requests/130 +--- + src/backends/meta-idle-monitor.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/src/backends/meta-idle-monitor.c b/src/backends/meta-idle-monitor.c +index c6e814468..6ce024001 100644 +--- a/src/backends/meta-idle-monitor.c ++++ b/src/backends/meta-idle-monitor.c +@@ -235,62 +235,65 @@ meta_idle_monitor_inhibited_actions_changed (GDBusProxy *session, + } + } + + static void + meta_idle_monitor_init (MetaIdleMonitor *monitor) + { + GVariant *v; + + monitor->watches = g_hash_table_new_full (NULL, NULL, NULL, free_watch); + monitor->last_event_time = g_get_monotonic_time (); + + /* Monitor inhibitors */ + monitor->session_proxy = + g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION, + G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS, + NULL, + "org.gnome.SessionManager", + "/org/gnome/SessionManager", + "org.gnome.SessionManager", + NULL, + NULL); + if (!monitor->session_proxy) + return; + + g_signal_connect (monitor->session_proxy, "g-properties-changed", + G_CALLBACK (meta_idle_monitor_inhibited_actions_changed), + monitor); + + v = g_dbus_proxy_get_cached_property (monitor->session_proxy, + "InhibitedActions"); +- monitor->inhibited = g_variant_get_uint32 (v) & GSM_INHIBITOR_FLAG_IDLE; +- g_variant_unref (v); ++ if (v) ++ { ++ monitor->inhibited = g_variant_get_uint32 (v) & GSM_INHIBITOR_FLAG_IDLE; ++ g_variant_unref (v); ++ } + } + + /** + * meta_idle_monitor_get_core: + * + * Returns: (transfer none): the #MetaIdleMonitor that tracks the server-global + * idletime for all devices. To track device-specific idletime, + * use meta_idle_monitor_get_for_device(). + */ + MetaIdleMonitor * + meta_idle_monitor_get_core (void) + { + MetaBackend *backend = meta_get_backend (); + return meta_backend_get_idle_monitor (backend, 0); + } + + /** + * meta_idle_monitor_get_for_device: + * @device_id: the device to get the idle time for. + * + * Returns: (transfer none): a new #MetaIdleMonitor that tracks the + * device-specific idletime for @device. To track server-global idletime + * for all devices, use meta_idle_monitor_get_core(). + */ + MetaIdleMonitor * + meta_idle_monitor_get_for_device (int device_id) + { + MetaBackend *backend = meta_get_backend (); + return meta_backend_get_idle_monitor (backend, device_id); + } +-- +2.28.0 + diff --git a/SOURCES/0002-clutter-actor-Don-t-emit-property-changes-after-dest.patch b/SOURCES/0002-clutter-actor-Don-t-emit-property-changes-after-dest.patch new file mode 100644 index 0000000..96c83d7 --- /dev/null +++ b/SOURCES/0002-clutter-actor-Don-t-emit-property-changes-after-dest.patch @@ -0,0 +1,85 @@ +From e10d6a7994dcdd9faa913444857bbe96b32528f5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= +Date: Tue, 10 Sep 2019 03:34:09 +0200 +Subject: [PATCH 2/2] clutter/actor: Don't emit property changes after + ::destroy + +Clutter actors might emit property changes in dispose, while unparenting. +However we assume that the ::destroy signal is the last one we emit for an +actor, and that starting from this moment the object is not valid anymore, +and so we don't expect any signal emission from it. + +To avoid this, freeze the object notifications on an actor during its +disposition, just before the ::destroy signal emission. + +Update the actor-destroy test to verify this behavior. + +https://gitlab.gnome.org/GNOME/mutter/merge_requests/769 +(cherry picked from commit 105a3f757a31299ed4eaafa0615e1fcd0b4ffeec) +--- + clutter/clutter/clutter-actor.c | 3 +++ + clutter/tests/conform/actor-destroy.c | 13 +++++++++++++ + 2 files changed, 16 insertions(+) + +diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c +index 0e531eea52..e381352e72 100644 +--- a/clutter/clutter/clutter-actor.c ++++ b/clutter/clutter/clutter-actor.c +@@ -5933,6 +5933,9 @@ clutter_actor_dispose (GObject *object) + object->ref_count, + g_type_name (G_OBJECT_TYPE (self))); + ++ /* Stop the emission of any property change */ ++ g_object_freeze_notify (object); ++ + g_signal_emit (self, actor_signals[DESTROY], 0); + + /* avoid recursing when called from clutter_actor_destroy() */ +diff --git a/clutter/tests/conform/actor-destroy.c b/clutter/tests/conform/actor-destroy.c +index 14ad1a25c8..0f648cf6c8 100644 +--- a/clutter/tests/conform/actor-destroy.c ++++ b/clutter/tests/conform/actor-destroy.c +@@ -174,6 +174,16 @@ on_parent_set (ClutterActor *actor, + *parent_set_called = TRUE; + } + ++static void ++on_notify (ClutterActor *actor, ++ ClutterActor *old_parent, ++ gpointer data) ++{ ++ gboolean *property_changed = data; ++ ++ *property_changed = TRUE; ++} ++ + static void + actor_destruction (void) + { +@@ -181,6 +191,7 @@ actor_destruction (void) + ClutterActor *child = clutter_rectangle_new (); + gboolean destroy_called = FALSE; + gboolean parent_set_called = FALSE; ++ gboolean property_changed = FALSE; + + g_object_ref_sink (test); + +@@ -194,6 +205,7 @@ actor_destruction (void) + clutter_container_add_actor (CLUTTER_CONTAINER (test), child); + g_signal_connect (child, "parent-set", G_CALLBACK (on_parent_set), + &parent_set_called); ++ g_signal_connect (child, "notify", G_CALLBACK (on_notify), &property_changed); + g_signal_connect (child, "destroy", G_CALLBACK (on_destroy), &destroy_called); + + if (g_test_verbose ()) +@@ -202,6 +214,7 @@ actor_destruction (void) + clutter_actor_destroy (test); + g_assert (destroy_called); + g_assert_false (parent_set_called); ++ g_assert_false (property_changed); + g_assert_null (child); + g_assert_null (test); + } +-- +2.28.0 + diff --git a/SPECS/mutter.spec b/SPECS/mutter.spec index a323819..a6810cf 100644 --- a/SPECS/mutter.spec +++ b/SPECS/mutter.spec @@ -10,7 +10,7 @@ Name: mutter Version: 3.28.3 -Release: 28%{?dist} +Release: 30%{?dist} Summary: Window and compositing manager based on Clutter License: GPLv2+ @@ -168,6 +168,12 @@ Patch502: 0002-barriers-Fix-leak-in-meta_barrier_destroy.patch Patch503: 0003-barriers-Free-backend-implementation-at-dispose-time.patch Patch504: 0004-src-Export-MetaWaylandX11-to-introspection.patch +# More Leak fixes +Patch601: 0001-clutter-actor-Don-t-emit-the-parent-set-signal-on-de.patch +Patch602: 0002-clutter-actor-Don-t-emit-property-changes-after-dest.patch + +Patch701: 0001-idle-monitor-NULL-check-cached-InhibitedActions-prop.patch + BuildRequires: chrpath BuildRequires: pango-devel BuildRequires: startup-notification-devel @@ -323,6 +329,10 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %{_libdir}/pkgconfig/* %changelog +* Thu Nov 12 2020 Jonas Ã…dahl ) - 3.28.3-30 +- Try to fix leaks even more and a log spew fix + Resolves: #1897063 + * Wed Oct 14 2020 Ray Strode - 3.28.3-28 - Try to fix leaks Resolves: #1717000