[gnome-shell/wip/carlosg/no-event-source: 3/8] popupMenu: Query stage for target actor instead of event.get_source()
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/carlosg/no-event-source: 3/8] popupMenu: Query stage for target actor instead of event.get_source()
- Date: Wed, 2 Mar 2022 10:19:08 +0000 (UTC)
commit 2e0fffc176dba319662b844efc53d16db5094611
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Feb 25 13:09:33 2022 +0100
popupMenu: 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.
js/ui/popupMenu.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index 81ba02ce23..4b51a7a9c8 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -1396,6 +1396,8 @@ var PopupMenuManager = class {
_onCapturedEvent(actor, event) {
let menu = actor._delegate;
+ const targetActor = global.stage.get_event_actor(event);
+
if (event.type() === Clutter.EventType.KEY_PRESS) {
let symbol = event.get_key_symbol();
if (symbol === Clutter.KEY_Down &&
@@ -1408,13 +1410,13 @@ var PopupMenuManager = class {
}
} else if (event.type() === Clutter.EventType.ENTER &&
(event.get_flags() & Clutter.EventFlags.GRAB_NOTIFY) === 0) {
- let hoveredMenu = this._findMenuForSource(event.get_source());
+ let hoveredMenu = this._findMenuForSource(targetActor);
if (hoveredMenu && hoveredMenu !== menu)
this._changeMenu(hoveredMenu);
} else if ((event.type() === Clutter.EventType.BUTTON_PRESS ||
event.type() === Clutter.EventType.TOUCH_BEGIN) &&
- !actor.contains(event.get_source())) {
+ !actor.contains(targetActor)) {
menu.close(BoxPointer.PopupAnimation.FULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]