Blame SOURCES/0001-backend-Clean-up-renderer-after-clutter-backendm.patch

f7d48e
From ff4dc8cc8274dc5f6ed11515e05a341e4e2cec28 Mon Sep 17 00:00:00 2001
f7d48e
From: Ray Strode <rstrode@redhat.com>
f7d48e
Date: Thu, 12 Aug 2021 14:13:23 -0400
f7d48e
Subject: [PATCH] backend: Clean up renderer after clutter backendm
f7d48e
f7d48e
commit c4a73e795020722eda3e2bec0c16d96f9f37333b added
f7d48e
code to cleanup the renderer when the meta backend is
f7d48e
disposed. Unfortunately, this introduced a crash when
f7d48e
the window manager is replaced.
f7d48e
f7d48e
This is because cleaning up the renderer involves talking
f7d48e
to the X server over a display connection that's closed
f7d48e
two lines higher as part of the clutter_backend_destroy
f7d48e
call.
f7d48e
f7d48e
This commit fixes the crash by swapping their order.
f7d48e
---
f7d48e
 src/backends/meta-backend.c | 2 +-
f7d48e
 1 file changed, 1 insertion(+), 1 deletion(-)
f7d48e
f7d48e
diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c
f7d48e
index ff84bfe6a..7e8b4ee95 100644
f7d48e
--- a/src/backends/meta-backend.c
f7d48e
+++ b/src/backends/meta-backend.c
f7d48e
@@ -216,63 +216,63 @@ meta_backend_dispose (GObject *object)
f7d48e
 
f7d48e
   if (priv->sleep_signal_id)
f7d48e
     {
f7d48e
       g_dbus_connection_signal_unsubscribe (priv->system_bus, priv->sleep_signal_id);
f7d48e
       priv->sleep_signal_id = 0;
f7d48e
     }
f7d48e
 
f7d48e
   if (priv->upower_watch_id)
f7d48e
     {
f7d48e
       g_bus_unwatch_name (priv->upower_watch_id);
f7d48e
       priv->upower_watch_id = 0;
f7d48e
     }
f7d48e
 
f7d48e
   g_cancellable_cancel (priv->cancellable);
f7d48e
   g_clear_object (&priv->cancellable);
f7d48e
   g_clear_object (&priv->system_bus);
f7d48e
   g_clear_object (&priv->upower_proxy);
f7d48e
 
f7d48e
   g_clear_handle_id (&priv->device_update_idle_id, g_source_remove);
f7d48e
 
f7d48e
   g_clear_pointer (&priv->device_monitors, g_hash_table_destroy);
f7d48e
 
f7d48e
   g_clear_object (&priv->settings);
f7d48e
 
f7d48e
 #ifdef HAVE_PROFILER
f7d48e
   g_clear_object (&priv->profiler);
f7d48e
 #endif
f7d48e
 
f7d48e
   g_clear_pointer (&priv->default_seat, clutter_seat_destroy);
f7d48e
   g_clear_pointer (&priv->stage, clutter_actor_destroy);
f7d48e
-  g_clear_pointer (&priv->clutter_backend, clutter_backend_destroy);
f7d48e
   g_clear_object (&priv->renderer);
f7d48e
   g_clear_list (&priv->gpus, g_object_unref);
f7d48e
+  g_clear_pointer (&priv->clutter_backend, clutter_backend_destroy);
f7d48e
 
f7d48e
   G_OBJECT_CLASS (meta_backend_parent_class)->dispose (object);
f7d48e
 }
f7d48e
 
f7d48e
 static void
f7d48e
 meta_backend_destroy (MetaBackend *backend)
f7d48e
 {
f7d48e
   g_object_run_dispose (G_OBJECT (backend));
f7d48e
   g_object_unref (backend);
f7d48e
 }
f7d48e
 
f7d48e
 static void
f7d48e
 meta_backend_sync_screen_size (MetaBackend *backend)
f7d48e
 {
f7d48e
   MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
f7d48e
   int width, height;
f7d48e
 
f7d48e
   meta_monitor_manager_get_screen_size (priv->monitor_manager, &width, &height);
f7d48e
 
f7d48e
   META_BACKEND_GET_CLASS (backend)->update_screen_size (backend, width, height);
f7d48e
 }
f7d48e
 
f7d48e
 static void
f7d48e
 reset_pointer_position (MetaBackend *backend)
f7d48e
 {
f7d48e
   MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
f7d48e
   MetaMonitorManager *monitor_manager = priv->monitor_manager;
f7d48e
   ClutterSeat *seat = clutter_backend_get_default_seat (priv->clutter_backend);
f7d48e
   MetaLogicalMonitor *primary;
f7d48e
 
f7d48e
-- 
f7d48e
2.31.1
f7d48e