[sushi] application: fix fallout from GtkApplication port
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sushi] application: fix fallout from GtkApplication port
- Date: Wed, 8 Aug 2012 12:48:54 +0000 (UTC)
commit effc35d37b08342ede47e115a0bac19af38fbe80
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Aug 8 14:39:06 2012 +0200
application: fix fallout from GtkApplication port
- we need to set the application to the window we create, or we'll quit
immediately
- Gtk.main_quit() doesn't work anymore with GtkApplication.run(); we
need to destroy the windows we create instead
src/js/ui/application.js | 6 +-----
src/js/ui/mainWindow.js | 5 +++--
2 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/src/js/ui/application.js b/src/js/ui/application.js
index a15df13..94024df 100644
--- a/src/js/ui/application.js
+++ b/src/js/ui/application.js
@@ -88,7 +88,7 @@ const Application = new Lang.Class({
},
Close: function() {
- this.quit();
+ this._mainWindow.close();
},
ShowFile : function(uri, xid, closeIfAlreadyShown) {
@@ -101,9 +101,5 @@ const Application = new Lang.Class({
}
this._mainWindow.setParent(xid);
this._mainWindow.setFile(file);
- },
-
- quit : function() {
- Gtk.main_quit();
}
});
diff --git a/src/js/ui/mainWindow.js b/src/js/ui/mainWindow.js
index a7dcf4b..a65d0ba 100644
--- a/src/js/ui/mainWindow.js
+++ b/src/js/ui/mainWindow.js
@@ -85,7 +85,8 @@ MainWindow.prototype = {
skipPagerHint: true,
skipTaskbarHint: true,
windowPosition: Gtk.WindowPosition.CENTER,
- gravity: Gdk.Gravity.CENTER });
+ gravity: Gdk.Gravity.CENTER,
+ application: this._application });
let screen = Gdk.Screen.get_default();
this._gtkWindow.set_visual(screen.get_rgba_visual());
@@ -650,7 +651,7 @@ MainWindow.prototype = {
if (this._renderer.clear)
this._renderer.clear();
- this._application.quit();
+ this._gtkWindow.destroy();
},
/**************************************************************************
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]