diff --git a/js/ui/main.js b/js/ui/main.js index 1410d2856..265dbf9fd 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -145,6 +145,7 @@ function start() { windowAttentionHandler = new WindowAttentionHandler.WindowAttentionHandler(); telepathyClient = new TelepathyClient.Client(); + overview.init(); statusIconDispatcher.start(messageTray.actor); ctrlAltTabManager = new CtrlAltTab.CtrlAltTabManager(); diff --git a/js/ui/overview.js b/js/ui/overview.js index 5195df498..71c9bf6f8 100644 --- a/js/ui/overview.js +++ b/js/ui/overview.js @@ -129,8 +129,6 @@ Overview.prototype = { this._capturedEventId = 0; this._buttonPressId = 0; - this.shellInfo = new ShellInfo(); - this._workspacesDisplay = null; this.visible = false; // animating to overview, in overview, animating out @@ -152,6 +150,32 @@ Overview.prototype = { this._group.hide(); global.overlay_group.add_actor(this._group); + this._coverPane.hide(); + + // XDND + this._dragMonitor = { + dragMotion: Lang.bind(this, this._onDragMotion) + }; + + Main.xdndHandler.connect('drag-begin', Lang.bind(this, this._onDragBegin)); + Main.xdndHandler.connect('drag-end', Lang.bind(this, this._onDragEnd)); + + this._windowSwitchTimeoutId = 0; + this._windowSwitchTimestamp = 0; + this._lastActiveWorkspaceIndex = -1; + this._lastHoveredWindow = null; + this._needsFakePointerEvent = false; + + this.workspaces = null; + }, + + // The members we construct that are implemented in JS might + // want to access the overview as Main.overview to connect + // signal handlers and so forth. So we create them after + // construction in this init() method. + init: function() { + this.shellInfo = new ShellInfo(); + this.viewSelector = new ViewSelector.ViewSelector(); this._group.add_actor(this.viewSelector.actor); @@ -173,23 +197,6 @@ Overview.prototype = { this.dash.actor.add_constraint(this.viewSelector.constrainY); this.dash.actor.add_constraint(this.viewSelector.constrainHeight); - this._coverPane.hide(); - - // XDND - this._dragMonitor = { - dragMotion: Lang.bind(this, this._onDragMotion) - }; - - Main.xdndHandler.connect('drag-begin', Lang.bind(this, this._onDragBegin)); - Main.xdndHandler.connect('drag-end', Lang.bind(this, this._onDragEnd)); - - this._windowSwitchTimeoutId = 0; - this._windowSwitchTimestamp = 0; - this._lastActiveWorkspaceIndex = -1; - this._lastHoveredWindow = null; - this._needsFakePointerEvent = false; - - this.workspaces = null; }, _onDragBegin: function() {