[polari] mainWindow: Fix state saving



commit 3a259e1474f22e82ae2afab7bc7d32a99b55fa50
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Aug 1 23:35:38 2016 +0200

    mainWindow: Fix state saving
    
    The 'app.quit' action is implemented by calling destroy() on the window
    rather than close(). As a result, the ::delete-event we currently use
    for state saving won't be emitted in that case. We clearly want to
    always save the state when the window is closed, not just when the
    user or window manager requests that the window is closed, so use
    the ::destroy event instead.

 src/mainWindow.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index cd4da8a..a343475 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -188,7 +188,7 @@ const MainWindow = new Lang.Class({
 
         this.connect('window-state-event', Lang.bind(this, this._onWindowStateEvent));
         this.connect('size-allocate', Lang.bind(this, this._onSizeAllocate));
-        this.connect('delete-event', Lang.bind(this, this._onDelete));
+        this.connect('destroy', Lang.bind(this, this._onDestroy));
 
         let size = this._settings.get_value('window-size').deep_unpack();
         if (size.length == 2)
@@ -220,7 +220,7 @@ const MainWindow = new Lang.Class({
             this._currentSize = this.get_size(this);
     },
 
-    _onDelete: function(widget, event) {
+    _onDestroy: function(widget) {
         this._settings.set_boolean ('window-maximized', this._isMaximized);
         this._settings.set_value('window-size',
                                  GLib.Variant.new('ai', this._currentSize));


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