Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed incompatibility with window navigator extension

  • Loading branch information...
commit fd822798c6e65f60dc1b1c4ee9b86302d4a0e8b2 1 parent 3089908
Anže Pečar authored
Showing with 10 additions and 9 deletions.
  1. +10 −9 extension.js
19 extension.js
View
@@ -20,7 +20,7 @@ function injectToFunction(parent, name, func) {
return origin;
}
-let workViewInjections, connectedSignals;
+let workViewInjections, connectedSignals, _keyPressEventId;
function resetState() {
workViewInjections = { };
@@ -30,14 +30,14 @@ function resetState() {
function enable() {
resetState();
- WorkspacesView.WorkspacesView.prototype._onKeyPress = function(s, o) {
+ WorkspacesView.WorkspacesView.prototype._wn_onKeyPress = function(s, o) {
- if(o.get_key_symbol() == Clutter.KEY_Down || o.get_key_symbol() == Clutter.KEY_Left){
+ if(o.get_key_symbol() == Clutter.KEY_Down || o.get_key_symbol() == Clutter.KEY_Right){
let workspace = this._workspaces[(global.screen.get_active_workspace_index()+1)%this._workspaces.length];
if (workspace !== undefined)
workspace.metaWorkspace.activate(global.get_current_time());
}
- if(o.get_key_symbol() == Clutter.KEY_Up || o.get_key_symbol() == Clutter.KEY_Right){
+ if(o.get_key_symbol() == Clutter.KEY_Up || o.get_key_symbol() == Clutter.KEY_Left){
let index = global.screen.get_active_workspace_index()-1;
if (index < 0) index = this._workspaces.length-1;
let workspace = this._workspaces[index];
@@ -50,15 +50,16 @@ function enable() {
return false;
}
- workViewInjections['_onKeyPress'] = undefined;
+ workViewInjections['_wn_onKeyPress'] = undefined;
workViewInjections['_init'] = injectToFunction(WorkspacesView.WorkspacesView.prototype, '_init', function(width, height, x, y, workspaces) {
- this._keyPressEventId = global.stage.connect('key-press-event', Lang.bind(this, this._onKeyPress));
- connectedSignals.push({ obj: global.stage, id: this._keyPressEventId });
+ _keyPressEventId = global.stage.connect('key-press-event', Lang.bind(this, this._wn_onKeyPress));
+
+ connectedSignals.push({ obj: global.stage, id: _keyPressEventId });
});
workViewInjections['_onDestroy'] = injectToFunction(WorkspacesView.WorkspacesView.prototype, '_onDestroy', function() {
- global.stage.disconnect(this._keyPressEventId);
+ global.stage.disconnect(_keyPressEventId);
connectedSignals = [ ];
});
}
@@ -72,7 +73,7 @@ function removeInjection(object, injection, name) {
function disable() {
-for (i in workViewInjections)
+ for (i in workViewInjections)
removeInjection(WorkspacesView.WorkspacesView.prototype, workViewInjections, i);
for each (i in connectedSignals)
Please sign in to comment.
Something went wrong with that request. Please try again.