[polari/wip/fmuellner/window-experiments: 6/24] app: Use window-removed vfunc for shutdown preparation
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/fmuellner/window-experiments: 6/24] app: Use window-removed vfunc for shutdown preparation
- Date: Mon, 18 Jul 2016 20:04:10 +0000 (UTC)
commit afdf43069723e3f3c18fe292bdf90023cd3b387f
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Jul 14 18:06:48 2016 +0200
app: Use window-removed vfunc for shutdown preparation
It's nicer to not mix this with the mostly unrelated window creation,
and the vfunc will be a lot easier to adapt when we allow multiple
windows.
src/application.js | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index bd1a089..64dc106 100644
--- a/src/application.js
+++ b/src/application.js
@@ -146,12 +146,6 @@ const Application = new Lang.Class({
vfunc_activate: function() {
if (!this._window) {
this._window = new MainWindow.MainWindow({ application: this });
- this._window.connect('destroy', Lang.bind(this,
- function() {
- for (let id in this._pendingRequests)
- this._pendingRequests[id].cancellable.cancel();
- this.emit('prepare-shutdown');
- }));
if (!this._startHidden)
this._window.present();
@@ -161,6 +155,14 @@ const Application = new Lang.Class({
}
},
+ vfunc_window_removed: function(window) {
+ this.parent(window);
+
+ for (let id in this._pendingRequests)
+ this._pendingRequests[id].cancellable.cancel();
+ this.emit('prepare-shutdown');
+ },
+
vfunc_open: function(files) {
this.activate();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]