lookingGlass: Handle Esc in object inspector
Currently the main looking glass dialog handles Esc for both itself and the object inspector. However as the latter now takes its own Clutter.Grab, key events never reach the main dialog while the inspector is open. Fix this by handling the Esc key in the object inspector itself. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5356 Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2271>
This commit is contained in:
parent
56d0b6d831
commit
5a4c19a8cb
@ -486,6 +486,15 @@ class ObjInspector extends St.ScrollView {
|
||||
this._obj = null;
|
||||
}
|
||||
|
||||
vfunc_key_press_event(keyPressEvent) {
|
||||
const symbol = keyPressEvent.keyval;
|
||||
if (symbol === Clutter.KEY_Escape) {
|
||||
this.close();
|
||||
return Clutter.EVENT_STOP;
|
||||
}
|
||||
return super.vfunc_key_press_event(keyPressEvent);
|
||||
}
|
||||
|
||||
_onInsert() {
|
||||
let obj = this._obj;
|
||||
this.close();
|
||||
@ -1578,9 +1587,6 @@ class LookingGlass extends St.BoxLayout {
|
||||
vfunc_key_press_event(keyPressEvent) {
|
||||
let symbol = keyPressEvent.keyval;
|
||||
if (symbol == Clutter.KEY_Escape) {
|
||||
if (this._objInspector.visible)
|
||||
this._objInspector.close();
|
||||
else
|
||||
this.close();
|
||||
return Clutter.EVENT_STOP;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user