js: Avoid Clutter.get_current_event() in Clutter.Actor event vfuncs
We sometimes obtained the current event through the general machinery just so we could pass it along as a ClutterEvent instead of a specialized subtype. We now get that out of the box, so may avoid getting the current event which is just a cast of the same current event we already have. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2872>
This commit is contained in:
@ -143,7 +143,7 @@ export const PopupBaseMenuItem = GObject.registerClass({
|
||||
}
|
||||
|
||||
vfunc_key_press_event(event) {
|
||||
if (global.focus_manager.navigate_from_event(Clutter.get_current_event()))
|
||||
if (global.focus_manager.navigate_from_event(event))
|
||||
return Clutter.EVENT_STOP;
|
||||
|
||||
if (!this._activatable)
|
||||
@ -162,7 +162,7 @@ export const PopupBaseMenuItem = GObject.registerClass({
|
||||
|
||||
let symbol = event.get_key_symbol();
|
||||
if (symbol == Clutter.KEY_space || symbol == Clutter.KEY_Return) {
|
||||
this.activate(Clutter.get_current_event());
|
||||
this.activate(event);
|
||||
return Clutter.EVENT_STOP;
|
||||
}
|
||||
return Clutter.EVENT_PROPAGATE;
|
||||
|
Reference in New Issue
Block a user