mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
js: Mass move to Clutter.Event getter methods in Clutter.Actor vfuncs
These traditionally got the various ClutterEvent subtype structs as their argument, so it was not allowed to use ClutterEvent generic getter methods in these vfuncs. These methods used direct access to struct fields instead. This got spoiled with the move to make ClutterEvent opaque types, since these are no longer public structs so GNOME Shell most silently failed to fetch the expected values from event fields. But since they are not ClutterEvents either, the getters could not be used on them. Mutter is changing so that these vmethods all contain an alias to the one and only Clutter.Event type, thus lifting those barriers, and making it possible to use the ClutterEvent methods in these vfuncs. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2950 Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2872>
This commit is contained in:
parent
5e36a06835
commit
8423ba44fe
15 changed files with 114 additions and 107 deletions
|
|
@ -607,19 +607,19 @@ export const UnlockDialog = GObject.registerClass({
|
|||
this.connect('destroy', this._onDestroy.bind(this));
|
||||
}
|
||||
|
||||
vfunc_key_press_event(keyEvent) {
|
||||
vfunc_key_press_event(event) {
|
||||
if (this._activePage === this._promptBox ||
|
||||
(this._promptBox && this._promptBox.visible))
|
||||
return Clutter.EVENT_PROPAGATE;
|
||||
|
||||
const { keyval } = keyEvent;
|
||||
const keyval = event.get_key_symbol();
|
||||
if (keyval === Clutter.KEY_Shift_L ||
|
||||
keyval === Clutter.KEY_Shift_R ||
|
||||
keyval === Clutter.KEY_Shift_Lock ||
|
||||
keyval === Clutter.KEY_Caps_Lock)
|
||||
return Clutter.EVENT_PROPAGATE;
|
||||
|
||||
let unichar = keyEvent.unicode_value;
|
||||
let unichar = event.get_key_unicode();
|
||||
|
||||
this._showPrompt();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue