[gnome-shell] workspace: Close windows using new layout manager API
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] workspace: Close windows using new layout manager API
- Date: Thu, 11 Jun 2020 18:58:08 +0000 (UTC)
commit 40123ae6da09d37d7afedf3eb1437308ced4559b
Author: Jonas Dreßler <verdre v0yd nl>
Date: Mon Jun 8 14:50:23 2020 +0200
workspace: Close windows using new layout manager API
Now that we have a new API to get all the windows and metaWindows from
our layout manager, implement the deleteAll() method of the window clone
using that API instead of looping through the children of the actor and
using the source of the ClutterClone.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1298
js/ui/workspace.js | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index c815ebec8b..ef34860da2 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -290,16 +290,15 @@ var WindowClone = GObject.registerClass({
}
deleteAll() {
+ const windows = this.layout_manager.getWindows();
+
// Delete all windows, starting from the bottom-most (most-modal) one
- let windows = this.get_children();
- for (let i = windows.length - 1; i >= 1; i--) {
- let realWindow = windows[i].source;
- let metaWindow = realWindow.meta_window;
+ for (const window of windows.reverse()) {
+ const metaWindow = this.layout_manager.getMetaWindow(window);
metaWindow.delete(global.get_current_time());
}
- this.metaWindow.delete(global.get_current_time());
this._closeRequested = true;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]