Skip to content

Commit

Permalink
Overview: Close if the last window is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
germanfr authored and clefebvre committed Oct 17, 2018
1 parent 116d34f commit d306023
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion js/ui/workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ WindowClone.prototype = {
this.metaWindow = realWindow.meta_window;
this.metaWindow._delegate = this;
this.overlay = null;
this.closedFromOverview = false;

// Original position of the full-sized window
this.origX = 0;
Expand Down Expand Up @@ -146,6 +147,7 @@ WindowClone.prototype = {
this.emit('activated', global.get_current_time());
return true;
case 2:
this.closedFromOverview = true;
this.emit('closed', global.get_current_time());
return true;
case 3:
Expand Down Expand Up @@ -419,6 +421,8 @@ WindowOverlay.prototype = {
this._disconnectWindowAdded = 0;
};

this._windowClone.closedFromOverview = true;

metaWindow.delete(global.get_current_time());
},

Expand Down Expand Up @@ -890,8 +894,14 @@ WorkspaceMonitor.prototype = {
this._cursorX = x;
this._cursorY = y;

this._repositionWindowsId = Mainloop.timeout_add(750,
if (this.isEmpty()) {
if(clone.closedFromOverview)
Main.overview.hide();
} else {
this._repositionWindowsId = Mainloop.timeout_add(750,
this._delayedWindowRepositioning.bind(this));
}

},

_doAddWindow : function(metaWin) {
Expand Down

0 comments on commit d306023

Please sign in to comment.