panel: Don't chain up to non-existent parent vfunc

Just as with c35b4cede5, there's no
default vfunc implemented by any parent which causes gjs to crash when
trying to call it.

So return EVENT_STOP if the key press successfully toggled the button,
and EVENT_PROPAGATE otherwise.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/830
This commit is contained in:
Jonas Dreßler 2019-11-04 11:18:25 +01:00
parent 88bcaafe86
commit c1ae634174

View File

@ -480,15 +480,15 @@ class ActivitiesButton extends PanelMenu.Button {
} }
vfunc_key_release_event(keyEvent) { vfunc_key_release_event(keyEvent) {
let ret = super.vfunc_key_release_event(keyEvent); let symbol = keyEvent.keyval;
if (ret == Clutter.EVENT_PROPAGATE) { if (symbol == Clutter.KEY_Return || symbol == Clutter.KEY_space) {
let symbol = keyEvent.keyval; if (Main.overview.shouldToggleByCornerOrButton()) {
if (symbol == Clutter.KEY_Return || symbol == Clutter.KEY_space) { Main.overview.toggle();
if (Main.overview.shouldToggleByCornerOrButton()) return Clutter.EVENT_STOP;
Main.overview.toggle();
} }
} }
return ret;
return Clutter.EVENT_PROPAGATE;
} }
_xdndToggleOverview() { _xdndToggleOverview() {