[gnome-shell] endSessionDialog: don't process response until closed



commit b4b13b0cb92fdfd09bb47ac1c5137a240d6ca29a
Author: Ray Strode <rstrode redhat com>
Date:   Wed Feb 20 13:30:26 2013 -0500

    endSessionDialog: don't process response until closed
    
    Right now if a user logs out, they are thrown to the login screen
    imediately, without even seeing the dialog close.
    
    This commit fades the dialog out before processing the logout.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694296

 js/ui/endSessionDialog.js |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js
index 7d46144..b7850a4 100644
--- a/js/ui/endSessionDialog.js
+++ b/js/ui/endSessionDialog.js
@@ -379,7 +379,12 @@ const EndSessionDialog = new Lang.Class({
             let signal = dialogContent.confirmButtons[i].signal;
             let label = dialogContent.confirmButtons[i].label;
             buttons.push({ action: Lang.bind(this, function() {
-                                       this._confirm(signal);
+                                       this.close(true);
+                                       let signalId = this.connect('closed',
+                                                                   Lang.bind(this, function() {
+                                                                       this.disconnect(signalId);
+                                                                       this._confirm(signal);
+                                                                   }));
                                    }),
                            label: label });
         }
@@ -387,9 +392,11 @@ const EndSessionDialog = new Lang.Class({
         this.setButtons(buttons);
     },
 
-    close: function() {
+    close: function(skipSignal) {
         this.parent();
-        this._dbusImpl.emit_signal('Closed', null);
+
+        if (!skipSignal)
+            this._dbusImpl.emit_signal('Closed', null);
     },
 
     cancel: function() {


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