[gnome-shell] popupMenu: Fix touch handling of PopupSubMenuMenuItem



commit 67afd7a6d82e300bae74b7539e6dfc3341f73a23
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Oct 16 18:03:30 2015 +0200

    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 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index 05f82b8..0090aa3 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;
     }
 });
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]