[gnome-shell/wip/carlosg/no-event-source: 13/19] keyboard: Query stage for target actor instead of event.get_source()
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/carlosg/no-event-source: 13/19] keyboard: Query stage for target actor instead of event.get_source()
- Date: Fri, 4 Mar 2022 12:27:38 +0000 (UTC)
commit 678e34d371c449a84aaa41fe700556d7eca61458
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Feb 25 13:09:17 2022 +0100
keyboard: Query stage for target actor instead of event.get_source()
Events are going to stop containing the destinatary, so stop using this
API. Querying the stage is equivalent and ensured to be up-to-date.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2216>
js/ui/keyboard.js | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index 6ee82a3028..69afc08b16 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -259,8 +259,10 @@ var LanguageSelectionPopup = class extends PopupMenu.PopupMenu {
}
_onCapturedEvent(actor, event) {
- if (event.get_source() == this.actor ||
- this.actor.contains(event.get_source()))
+ const targetActor = global.stage.get_event_actor(event);
+
+ if (targetActor === this.actor ||
+ this.actor.contains(targetActor))
return Clutter.EVENT_PROPAGATE;
if (event.type() == Clutter.EventType.BUTTON_RELEASE || event.type() == Clutter.EventType.TOUCH_END)
@@ -407,9 +409,10 @@ var Key = GObject.registerClass({
let type = event.type();
let press = type == Clutter.EventType.BUTTON_PRESS || type == Clutter.EventType.TOUCH_BEGIN;
let release = type == Clutter.EventType.BUTTON_RELEASE || type == Clutter.EventType.TOUCH_END;
+ const targetActor = global.stage.get_event_actor(event);
- if (event.get_source() == this._boxPointer.bin ||
- this._boxPointer.bin.contains(event.get_source()))
+ if (targetActor === this._boxPointer.bin ||
+ this._boxPointer.bin.contains(targetActor))
return Clutter.EVENT_PROPAGATE;
if (press)
@@ -1296,7 +1299,7 @@ var KeyboardManager = class KeyBoardManager {
if (!this._keyboard)
return false;
- let actor = event.get_source();
+ const actor = global.stage.get_event_actor(event);
return Main.layoutManager.keyboardBox.contains(actor) ||
!!actor._extendedKeys || !!actor.extendedKey;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]