Canceling SwitcherPopups (eg. alt-tab) using ESC leaks the keyrelease event (X11)
- run
xev -event keyboard
- start alt tabbing
- abort (ie. press Esc)
The xev window received a KeyRelease event for ESC.
This is quite annoying when eg. netflix are playing since it react to the keyrelease and quits the playing show :(
Tested in GNOME Shell 3.28.2
Delaying destroy until keyrelease fixes the problem:
diff --git a/js/ui/switcherPopup.js b/js/ui/switcherPopup.js
index a53b1e6e9..21fc2b70c 100644
--- a/js/ui/switcherPopup.js
+++ b/js/ui/switcherPopup.js
@@ -192,13 +192,18 @@ var SwitcherPopup = new Lang.Class({
if (this._keyPressHandler(keysym, action) != Clutter.EVENT_PROPAGATE)
return Clutter.EVENT_STOP;
- if (keysym == Clutter.Escape)
- this.destroy();
+ if (keysym == Clutter.Escape) {
+ this.destroyMe = true;
+ }
return Clutter.EVENT_STOP;
},
_keyReleaseEvent(actor, event) {
+ let keysym = event.get_key_symbol();
+ if (this.destroyMe === true)
+ this.destroy();
+
if (this._modifierMask) {
let [x, y, mods] = global.get_pointer();
let state = mods & this._modifierMask;
Edited by Andre Klapper