From 059cd660672950fd7d894c51402e5fb309e7f99f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Sun, 7 Jan 2018 08:34:50 +0100 Subject: [PATCH] liveAltTab: Add live previews of scratch windows Make a clone of pseudo focused scratch windows which gets pushed to the top (Can't use raise as it would mutate the stack level). --- liveAltTab.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/liveAltTab.js b/liveAltTab.js index 1c44931..c759e03 100644 --- a/liveAltTab.js +++ b/liveAltTab.js @@ -174,6 +174,18 @@ var LiveAltTab = Lang.Class({ let from = this._switcherList.windows[this._selectedIndex]; let to = this._switcherList.windows[num]; + this.clone && this.clone.destroy(); + // Show pseudo focused scratch windows + if (Scratch.isScratchWindow(to)) { + let actor = to.get_compositor_private(); + let clone = new Clutter.Clone({source: actor}); + clone.position = actor.position; + this.clone = clone; + Main.uiGroup.add_child(clone); + // Raise the switcherpopup to the top + Main.uiGroup.set_child_above_sibling(this.actor, clone); + } + let fromIndex = from.get_workspace().workspace_index; let toIndex = to.get_workspace().workspace_index; if (toIndex !== fromIndex) {