diff --git a/js/ui/workspace.js b/js/ui/workspace.js index 5af6fbec7..354a2608f 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -214,10 +214,10 @@ var WindowPreview = GObject.registerClass({ 'size-changed': {}, }, }, class WindowPreview extends St.Widget { - _init(realWindow, workspace) { - this.realWindow = realWindow; - this.metaWindow = realWindow.meta_window; + _init(metaWindow, workspace) { + this.metaWindow = metaWindow; this.metaWindow._delegate = this; + this.realWindow = metaWindow.get_compositor_private(); this._workspace = workspace; super._init({ @@ -1167,7 +1167,7 @@ class Workspace extends St.Widget { this._windows = []; for (let i = 0; i < windows.length; i++) { if (this._isOverviewWindow(windows[i])) - this._addWindowClone(windows[i].get_compositor_private(), true); + this._addWindowClone(windows[i], true); } // Track window changes @@ -1534,7 +1534,7 @@ class Workspace extends St.Widget { return; } - let clone = this._addWindowClone(win, false); + let clone = this._addWindowClone(metaWin, false); if (metaWin._overviewHint) { let x = metaWin._overviewHint.x - this.x; @@ -1812,20 +1812,20 @@ class Workspace extends St.Widget { } // Create a clone of a (non-desktop) window and add it to the window list - _addWindowClone(win, positioned) { - let clone = new WindowPreview(win, this); + _addWindowClone(metaWindow, positioned) { + let clone = new WindowPreview(metaWindow, this); clone.positioned = positioned; clone.connect('selected', this._onCloneSelected.bind(this)); clone.connect('drag-begin', () => { - Main.overview.beginWindowDrag(clone.metaWindow); + Main.overview.beginWindowDrag(metaWindow); }); clone.connect('drag-cancelled', () => { - Main.overview.cancelledWindowDrag(clone.metaWindow); + Main.overview.cancelledWindowDrag(metaWindow); }); clone.connect('drag-end', () => { - Main.overview.endWindowDrag(clone.metaWindow); + Main.overview.endWindowDrag(metaWindow); }); clone.connect('size-changed', () => { this._recalculateWindowPositions(WindowPositionFlags.NONE); @@ -1841,7 +1841,7 @@ class Workspace extends St.Widget { }); }); clone.connect('destroy', () => { - this._removeWindowClone(clone.metaWindow); + this._removeWindowClone(metaWindow); }); this.add_child(clone);