From e16c16b3efcfab291fe72736091fd22336394c1a Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 26 Apr 2013 11:32:40 -0400 Subject: [PATCH] workspace: Only show the close buttons for windows that can close https://bugzilla.gnome.org/show_bug.cgi?id=699269 --- js/ui/workspace.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/js/ui/workspace.js b/js/ui/workspace.js index 63952083e..bf5d277cf 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -453,6 +453,10 @@ const WindowOverlay = new Lang.Class({ metaWindow.delete(global.get_current_time()); }, + _windowCanClose: function() { + return this._windowClone.metaWindow.can_close(); + }, + _onWindowAdded: function(workspace, win) { let metaWindow = this._windowClone.metaWindow; @@ -488,12 +492,14 @@ const WindowOverlay = new Lang.Class({ _animateVisible: function() { this._parentActor.raise_top(); - this.closeButton.show(); - this.closeButton.opacity = 0; - Tweener.addTween(this.closeButton, - { opacity: 255, - time: CLOSE_BUTTON_FADE_TIME, - transition: 'easeOutQuad' }); + if (this._windowCanClose()) { + this.closeButton.show(); + this.closeButton.opacity = 0; + Tweener.addTween(this.closeButton, + { opacity: 255, + time: CLOSE_BUTTON_FADE_TIME, + transition: 'easeOutQuad' }); + } this.border.show(); this.border.opacity = 0;