popupMenu: dismiss the menu on touch events

No sequence checks are done, just any touch outside will dismiss the popup.

https://bugzilla.gnome.org/show_bug.cgi?id=733633
This commit is contained in:
Carlos Garnacho 2014-07-22 12:27:05 +02:00
parent a2f263dcbb
commit da26a9daf8

View File

@ -106,6 +106,7 @@ const PopupBaseMenuItem = new Lang.Class({
if (this._activatable) {
this.actor.connect('button-release-event', Lang.bind(this, this._onButtonReleaseEvent));
this.actor.connect('touch-event', Lang.bind(this, this._onTouchEvent));
this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPressEvent));
}
if (params.reactive && params.hover)
@ -132,6 +133,14 @@ const PopupBaseMenuItem = new Lang.Class({
return Clutter.EVENT_STOP;
},
_onTouchEvent: function (actor, event) {
if (event.type() == Clutter.EventType.TOUCH_END) {
this.activate(event);
return Clutter.EVENT_STOP;
}
return Clutter.EVENT_PROPAGATE;
},
_onKeyPressEvent: function (actor, event) {
let symbol = event.get_key_symbol();