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:
parent
a2f263dcbb
commit
da26a9daf8
@ -106,6 +106,7 @@ const PopupBaseMenuItem = new Lang.Class({
|
|||||||
|
|
||||||
if (this._activatable) {
|
if (this._activatable) {
|
||||||
this.actor.connect('button-release-event', Lang.bind(this, this._onButtonReleaseEvent));
|
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));
|
this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPressEvent));
|
||||||
}
|
}
|
||||||
if (params.reactive && params.hover)
|
if (params.reactive && params.hover)
|
||||||
@ -132,6 +133,14 @@ const PopupBaseMenuItem = new Lang.Class({
|
|||||||
return Clutter.EVENT_STOP;
|
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) {
|
_onKeyPressEvent: function (actor, event) {
|
||||||
let symbol = event.get_key_symbol();
|
let symbol = event.get_key_symbol();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user