[gnome-shell] workspace: Only show the close buttons for windows that can close



commit e16c16b3efcfab291fe72736091fd22336394c1a
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Apr 26 11:32:40 2013 -0400

    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 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index 6395208..bf5d277 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]