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

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