diff --git a/utils.js b/utils.js index 8ef7945..41a458a 100644 --- a/utils.js +++ b/utils.js @@ -283,6 +283,14 @@ var getWorkspaceCount = function() { return DisplayWrapper.getWorkspaceManager().n_workspaces; }; +var checkIfWindowHasTransient = function(window) { + let hasTransient; + + window.foreach_transient(t => !(hasTransient = true)); + + return hasTransient; +}; + var findIndex = function(array, predicate) { if (Array.prototype.findIndex) { return array.findIndex(predicate); diff --git a/windowPreview.js b/windowPreview.js index c6d0610..d20a002 100644 --- a/windowPreview.js +++ b/windowPreview.js @@ -597,6 +597,7 @@ var Preview = Utils.defineClass({ }); this.window = null; + this._needsCloseButton = true; this.cloneWidth = this.cloneHeight = 0; this._panelWrapper = panelWrapper; this._previewMenu = previewMenu; @@ -702,6 +703,7 @@ var Preview = Utils.defineClass({ this._removeWindowSignals(); this.window = window; + this._needsCloseButton = window.can_close() && !Utils.checkIfWindowHasTransient(window); this._updateHeader(); }, @@ -853,7 +855,9 @@ var Preview = Utils.defineClass({ }, _hideOrShowCloseButton: function(hide) { - Tweener.addTween(this._closeButtonBin, getTweenOpts({ opacity: hide ? 0 : 255 })); + if (this._needsCloseButton) { + Tweener.addTween(this._closeButtonBin, getTweenOpts({ opacity: hide ? 0 : 255 })); + } }, _getBackgroundColor: function(offset, alpha) {