From f2ca53b9e0442f6ce3100b20b5f0bdc195c4475d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 17 Aug 2022 16:30:53 +0200 Subject: [PATCH] layout: Destroy non-adopted uiGroup actors Move back actors that were adopted from mutter (window_group, top_window_group, the feedback group) from the uiGroup to the stage, and then destroy the uiGroup. This will tear down more or less all of GNOME Shells actors gracefully. Part-of: --- js/ui/layout.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/js/ui/layout.js b/js/ui/layout.js index 69bf14891..6be7cd041 100644 --- a/js/ui/layout.js +++ b/js/ui/layout.js @@ -221,6 +221,20 @@ var LayoutManager = GObject.registerClass({ global.stage.remove_actor(global.window_group); this.uiGroup.add_actor(global.window_group); + global.connect('shutdown', () => { + const adoptedUiGroupActors = [ + global.window_group, + global.top_window_group, + Meta.get_feedback_group_for_display(global.display), + ]; + + for (let adoptedActor of adoptedUiGroupActors) { + this.uiGroup.remove_actor(adoptedActor); + global.stage.add_actor(adoptedActor); + } + + this.uiGroup.destroy(); + }); // Using addChrome() to add actors to uiGroup will position actors // underneath the top_window_group.