fixup! navigator: Rewrite the keybind handler

This commit is contained in:
Tor Hedin Brønner
2019-03-30 16:55:10 +01:00
parent 6b9459dc3b
commit b7e1ed1781
+3 -12
View File
@@ -101,9 +101,6 @@ var ActionDispatcher = class {
let keysym = event.get_key_symbol();
let action = global.display.get_keybinding_action(event.get_key_code(), event.get_state());
if (this._keyPressHandler(keysym, action) != Clutter.EVENT_PROPAGATE)
return Clutter.EVENT_STOP;
// Popping the modal on keypress doesn't work properly, as the release
// event will leak to the active window. To work around this we initate
// visual destruction on key-press and signal to the release handler
@@ -112,8 +109,11 @@ var ActionDispatcher = class {
if (keysym == Clutter.Escape || keysym == Clutter.Tab) {
this.navigator.destroy();
this._destroy = true;
return Clutter.EVENT_STOP;
}
this._doAction(action);
return Clutter.EVENT_STOP;
}
@@ -134,15 +134,6 @@ var ActionDispatcher = class {
return Clutter.EVENT_STOP;
}
_keyPressHandler(keysym, action) {
if (keysym !== Clutter.KEY_Escape && this._doAction(action)) {
return Clutter.EVENT_STOP;
} else {
return Clutter.EVENT_PROPAGATE;
}
}
_doAction(mutterActionId) {
let action = Keybindings.byId(mutterActionId);