diff --git a/js/ui/workspace.js b/js/ui/workspace.js index 66058b93d..cee9ae538 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -1209,14 +1209,18 @@ const Workspace = new Lang.Class({ return this._windows.length == 0; }, - setReservedSlot: function(clone) { - if (this._reservedSlot == clone) + setReservedSlot: function(metaWindow) { + if (this._reservedSlotWindow == metaWindow) return; - if (clone && this.containsMetaWindow(clone.metaWindow)) - clone = null; + if (!metaWindow || this.containsMetaWindow(metaWindow)) { + this._reservedSlotWindow = null; + this._reservedSlot = null; + } else { + this._reservedSlotWindow = metaWindow; + this._reservedSlot = this._windows[this._lookupIndex(metaWindow)]; + } - this._reservedSlot = clone; this._recalculateWindowPositions(WindowPositionFlags.ANIMATE); }, diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index 004ac81ae..9e75661f6 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -65,7 +65,7 @@ const WorkspacesViewBase = new Lang.Class({ _dragBegin: function(overview, clone) { this._inDrag = true; - this._setReservedSlot(clone); + this._setReservedSlot(clone.metaWindow); }, _dragEnd: function() { @@ -127,9 +127,9 @@ const WorkspacesView = new Lang.Class({ Lang.bind(this, this._activeWorkspaceChanged)); }, - _setReservedSlot: function(clone) { + _setReservedSlot: function(window) { for (let i = 0; i < this._workspaces.length; i++) - this._workspaces[i].setReservedSlot(clone); + this._workspaces[i].setReservedSlot(window); }, _syncFullGeometry: function() { @@ -366,8 +366,8 @@ const ExtraWorkspaceView = new Lang.Class({ this.actor.add_actor(this._workspace.actor); }, - _setReservedSlot: function(clone) { - this._workspace.setReservedSlot(clone); + _setReservedSlot: function(window) { + this._workspace.setReservedSlot(window); }, _syncFullGeometry: function() {