mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
panelMenu: Interact to touch events
No sequence checks are done, these UI elements promptly trigger a grab that will cancel ongoing touches and redirect later ones somewhere else, so that works as a barrier to multi-toggling. https://bugzilla.gnome.org/show_bug.cgi?id=733633
This commit is contained in:
parent
da26a9daf8
commit
e545ec59b9
1 changed files with 6 additions and 5 deletions
|
|
@ -100,7 +100,7 @@ const Button = new Lang.Class({
|
|||
accessible_name: nameText ? nameText : "",
|
||||
accessible_role: Atk.Role.MENU });
|
||||
|
||||
this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress));
|
||||
this.actor.connect('event', Lang.bind(this, this._onEvent));
|
||||
this.actor.connect('key-press-event', Lang.bind(this, this._onSourceKeyPress));
|
||||
this.actor.connect('notify::visible', Lang.bind(this, this._onVisibilityChanged));
|
||||
|
||||
|
|
@ -131,11 +131,12 @@ const Button = new Lang.Class({
|
|||
}
|
||||
},
|
||||
|
||||
_onButtonPress: function(actor, event) {
|
||||
if (!this.menu)
|
||||
return Clutter.EVENT_PROPAGATE;
|
||||
_onEvent: function(actor, event) {
|
||||
if (this.menu &&
|
||||
(event.type() == Clutter.EventType.TOUCH_BEGIN ||
|
||||
event.type() == Clutter.EventType.BUTTON_PRESS))
|
||||
this.menu.toggle();
|
||||
|
||||
this.menu.toggle();
|
||||
return Clutter.EVENT_PROPAGATE;
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue