Permalink
Browse files

Bugfix: _init being called 2x, thanks to Ingenious

  • Loading branch information...
1 parent 7a7bbc7 commit 9ae55836afc917426679678b99adae3ca88b89ef @Smotko committed Jun 11, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 extension.js
View
@@ -60,9 +60,11 @@ function enable() {
workViewInjections['_wn_onKeyPress'] = undefined;
workViewInjections['_init'] = injectToFunction(WorkspacesView.WorkspacesView.prototype, '_init', function(width, height, x, y, workspaces) {
- _keyPressEventId = global.stage.connect('key-press-event', Lang.bind(this, this._wn_onKeyPress));
+ if(connectedSignals.length == 0) {
+ _keyPressEventId = global.stage.connect('key-press-event', Lang.bind(this, this._wn_onKeyPress));
- connectedSignals.push({ obj: global.stage, id: _keyPressEventId });
+ connectedSignals.push({ obj: global.stage, id: _keyPressEventId });
+ }
});
workViewInjections['_onDestroy'] = injectToFunction(WorkspacesView.WorkspacesView.prototype, '_onDestroy', function() {

0 comments on commit 9ae5583

Please sign in to comment.