workspace: Only show the close buttons for windows that can close

https://bugzilla.gnome.org/show_bug.cgi?id=699269
This commit is contained in:
Jasper St. Pierre 2013-04-26 11:32:40 -04:00
parent 1eeeead78f
commit e16c16b3ef

View File

@ -453,6 +453,10 @@ const WindowOverlay = new Lang.Class({
metaWindow.delete(global.get_current_time()); metaWindow.delete(global.get_current_time());
}, },
_windowCanClose: function() {
return this._windowClone.metaWindow.can_close();
},
_onWindowAdded: function(workspace, win) { _onWindowAdded: function(workspace, win) {
let metaWindow = this._windowClone.metaWindow; let metaWindow = this._windowClone.metaWindow;
@ -488,12 +492,14 @@ const WindowOverlay = new Lang.Class({
_animateVisible: function() { _animateVisible: function() {
this._parentActor.raise_top(); this._parentActor.raise_top();
if (this._windowCanClose()) {
this.closeButton.show(); this.closeButton.show();
this.closeButton.opacity = 0; this.closeButton.opacity = 0;
Tweener.addTween(this.closeButton, Tweener.addTween(this.closeButton,
{ opacity: 255, { opacity: 255,
time: CLOSE_BUTTON_FADE_TIME, time: CLOSE_BUTTON_FADE_TIME,
transition: 'easeOutQuad' }); transition: 'easeOutQuad' });
}
this.border.show(); this.border.show();
this.border.opacity = 0; this.border.opacity = 0;