Skip to content

Commit

Permalink
application: fix fallout from GtkApplication port
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
cosimoc committed Aug 8, 2012
1 parent e4a53fe commit effc35d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 1 addition & 5 deletions src/js/ui/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const Application = new Lang.Class({
},

Close: function() {
this.quit();
this._mainWindow.close();
},

ShowFile : function(uri, xid, closeIfAlreadyShown) {
Expand All @@ -101,9 +101,5 @@ const Application = new Lang.Class({
}
this._mainWindow.setParent(xid);
this._mainWindow.setFile(file);
},

quit : function() {
Gtk.main_quit();
}
});
5 changes: 3 additions & 2 deletions src/js/ui/mainWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -650,7 +651,7 @@ MainWindow.prototype = {
if (this._renderer.clear)
this._renderer.clear();

this._application.quit();
this._gtkWindow.destroy();
},

/**************************************************************************
Expand Down

0 comments on commit effc35d

Please sign in to comment.