[geary] Don't prompt on delete_event if in the process of closing



commit e0a61172b3c451cd306918ea3ab024f2eade22a1
Author: Robert Schroll <rschroll gmail com>
Date:   Tue May 13 23:11:38 2014 -0700

    Don't prompt on delete_event if in the process of closing

 src/client/composer/composer-window.vala |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/client/composer/composer-window.vala b/src/client/composer/composer-window.vala
index d6de090..ca2302e 100644
--- a/src/client/composer/composer-window.vala
+++ b/src/client/composer/composer-window.vala
@@ -9,6 +9,8 @@ public class ComposerWindow : Gtk.Window, ComposerContainer {
 
     private const string DEFAULT_TITLE = _("New Message");
     
+    private bool closing = false;
+    
     public ComposerWindow(ComposerWidget composer) {
         Object(type: Gtk.WindowType.TOPLEVEL);
         
@@ -33,8 +35,14 @@ public class ComposerWindow : Gtk.Window, ComposerContainer {
         base.show_all();
     }
     
+    public new void close() {
+        closing = true;
+        base.close();
+    }
+    
     public override bool delete_event(Gdk.EventAny event) {
-        return !(((ComposerWidget) get_child()).should_close() == ComposerWidget.CloseStatus.DO_CLOSE);
+        return !(closing ||
+            ((ComposerWidget) get_child()).should_close() == ComposerWidget.CloseStatus.DO_CLOSE);
     }
     
     public void vanish() {


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