From 67afd7a6d82e300bae74b7539e6dfc3341f73a23 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 16 Oct 2015 18:03:30 +0200 Subject: [PATCH] popupMenu: Fix touch handling of PopupSubMenuMenuItem It overrides ::button-release-event in order to implement the hidden/shown toggling, it must do the same on TOUCH_END, otherwise menus stay shown on touch. https://bugzilla.gnome.org/show_bug.cgi?id=756748 --- js/ui/popupMenu.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 05f82b8ef..0090aa3b2 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -1146,6 +1146,16 @@ const PopupSubMenuMenuItem = new Lang.Class({ this.actor.remove_style_pseudo_class ('active'); this._setOpenState(!this._getOpenState()); return Clutter.EVENT_PROPAGATE; + }, + + _onTouchEvent: function(actor, event) { + if (event.type() == Clutter.EventType.TOUCH_END) { + // Since we override the parent, we need to manage what the parent does + // with the active style class + this.actor.remove_style_pseudo_class ('active'); + this._setOpenState(!this._getOpenState()); + } + return Clutter.EVENT_PROPAGATE; } });