diff --git a/src/application.js b/src/application.js index 03e2e78913965664ae12f8b80438f03e3861ebf9..375633f675f6222d691717a1528be9c97650c1a7 100644 --- a/src/application.js +++ b/src/application.js @@ -212,7 +212,8 @@ const Application = new Lang.Class({ 'icons'])); let overlay = new Gtk.Overlay({ visible: true, can_focus: false }); notificationManager = new NotificationManager.NotificationManager(overlay); - this._mainWindow = new MainWindow.MainWindow(this, overlay); + this._mainWindow = new MainWindow.MainWindow({ application: this, + overlay: overlay }); this._mainWindow.connect('destroy', this._onWindowDestroy.bind(this)); }, diff --git a/src/mainWindow.js b/src/mainWindow.js index 89f2b12b2750dd36b08d014896ed72a735ce3f2a..1862d015dd9065445d9a9e6af952b11f92132d1c 100644 --- a/src/mainWindow.js +++ b/src/mainWindow.js @@ -58,16 +58,16 @@ const MainWindow = new Lang.Class({ 'layersButton', 'favoritesButton' ], - _init: function(app, overlay) { - this.parent(); + _init: function(params) { + this._overlay = params.overlay; + delete params.overlay; - this._configureId = 0; + this.parent(params); - this.application = app; - this._overlay = overlay; + this._configureId = 0; this.mapView = new MapView.MapView(); - overlay.add(this.mapView); + this._overlay.add(this.mapView); this.mapView.gotoUserLocation(false);