From bc6af4f1c84d83515d1b0cd4af1822fbfda9938d Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Sat, 9 Jul 2022 12:08:48 +0200 Subject: [PATCH] default-plugin: Kill workspace switch animation on shutdown The workspace switch animation moves the WindowActors out of the WindowGroup so if we shut down while the animation is playing the WindowActors will have queued a destroy but will be disposed only after the compositor is destroyed, leaving the WindowActor with a dangling pointer. Fix the issue by killing the workspace switch animation on shutdown. Part-of: --- src/compositor/plugins/default.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/compositor/plugins/default.c b/src/compositor/plugins/default.c index 5240e1711..45d88b862 100644 --- a/src/compositor/plugins/default.c +++ b/src/compositor/plugins/default.c @@ -470,12 +470,20 @@ init_keymap (MetaDefaultPlugin *self) x11_layout, x11_variant, x11_options); } +static void +prepare_shutdown (MetaBackend *backend, + MetaDefaultPlugin *plugin) +{ + kill_switch_workspace (META_PLUGIN (plugin)); +} + static void start (MetaPlugin *plugin) { MetaDefaultPlugin *self = META_DEFAULT_PLUGIN (plugin); MetaDisplay *display = meta_plugin_get_display (plugin); MetaMonitorManager *monitor_manager = meta_monitor_manager_get (); + MetaBackend *backend = meta_get_backend (); self->priv->background_group = meta_background_group_new (); clutter_actor_insert_child_below (meta_get_window_group_for_display (display), @@ -486,6 +494,10 @@ start (MetaPlugin *plugin) on_monitors_changed (monitor_manager, plugin); + g_signal_connect (backend, "prepare-shutdown", + G_CALLBACK (prepare_shutdown), + self); + if (meta_is_wayland_compositor ()) init_keymap (self);