From 38d05a8285a59a63a056d028fa4f29b664137ed2 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Tue, 22 Jul 2014 12:32:39 +0200
Subject: [PATCH] panel: Make the "Activities" button react to touch events

https://bugzilla.gnome.org/show_bug.cgi?id=733633
---
 js/ui/panel.js | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/js/ui/panel.js b/js/ui/panel.js
index 6e546b062..10fe169c4 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -571,7 +571,7 @@ const ActivitiesButton = new Lang.Class({
         this.actor.label_actor = this._label;
 
         this.actor.connect('captured-event', Lang.bind(this, this._onCapturedEvent));
-        this.actor.connect_after('button-release-event', Lang.bind(this, this._onButtonRelease));
+        this.actor.connect_after('event', Lang.bind(this, this._onEvent));
         this.actor.connect_after('key-release-event', Lang.bind(this, this._onKeyRelease));
 
         Main.overview.connect('showing', Lang.bind(this, function() {
@@ -600,16 +600,21 @@ const ActivitiesButton = new Lang.Class({
     },
 
     _onCapturedEvent: function(actor, event) {
-        if (event.type() == Clutter.EventType.BUTTON_PRESS) {
+        if (event.type() == Clutter.EventType.BUTTON_PRESS ||
+            event.type() == Clutter.EventType.TOUCH_BEGIN) {
             if (!Main.overview.shouldToggleByCornerOrButton())
                 return Clutter.EVENT_STOP;
         }
         return Clutter.EVENT_PROPAGATE;
     },
 
-    _onButtonRelease: function() {
-        Main.overview.toggle();
-        this.menu.close();
+    _onEvent: function(actor, event) {
+        if (event.type() == Clutter.EventType.TOUCH_END ||
+            event.type() == Clutter.EventType.BUTTON_RELEASE) {
+
+            Main.overview.toggle();
+            this.menu.close();
+        }
         return Clutter.EVENT_PROPAGATE;
     },