[gnome-shell/wip/exalm/gestures: 28/30] workspaceAnimation: Use window clones
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/exalm/gestures: 28/30] workspaceAnimation: Use window clones
- Date: Tue, 6 Aug 2019 11:40:06 +0000 (UTC)
commit c48a82ee54f603f7fcad62a76a9a269662d4b8ec
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Thu Jul 4 23:15:15 2019 +0500
workspaceAnimation: Use window clones
Instead of reparenting windows, clone them. This will allow to properly
support multi-monitor setups in subsequent commits.
Block window mapping animation while the animation is running to prevent
new windows appearing during the animation from being visible at the same
time as their clones.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/605
js/ui/workspaceAnimation.js | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/workspaceAnimation.js b/js/ui/workspaceAnimation.js
index d7fb8fb7e..85b69b884 100644
--- a/js/ui/workspaceAnimation.js
+++ b/js/ui/workspaceAnimation.js
@@ -48,12 +48,18 @@ class WorkspaceGroup extends Clutter.Actor {
windows = windows.filter(w => this._shouldShowWindow(w.meta_window));
for (let window of windows) {
- let record = { window: window,
- parent: window.get_parent() };
+ let clone = new Clutter.Clone({ source: window,
+ x: window.x,
+ y: window.y });
+
+ this.add_actor(clone);
+ window.hide();
- window.reparent(this);
+ let record = { window: window,
+ clone: clone };
record.windowDestroyId = window.connect('destroy', () => {
+ clone.destroy();
this._windows.splice(this._windows.indexOf(record), 1);
});
@@ -66,11 +72,11 @@ class WorkspaceGroup extends Clutter.Actor {
let w = this._windows[i];
w.window.disconnect(w.windowDestroyId);
- w.window.reparent(w.parent);
+ w.clone.destroy();
- if (w.window.get_meta_window().get_workspace() !=
+ if (w.window.get_meta_window().get_workspace() ==
global.workspace_manager.get_active_workspace())
- w.window.hide();
+ w.window.show();
}
this._windows = [];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]