[gnome-shell] panel: Make the "Activities" button react to touch events
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] panel: Make the "Activities" button react to touch events
- Date: Thu, 24 Jul 2014 17:40:06 +0000 (UTC)
commit 38d05a8285a59a63a056d028fa4f29b664137ed2
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Jul 22 12:32:39 2014 +0200
panel: Make the "Activities" button react to touch events
https://bugzilla.gnome.org/show_bug.cgi?id=733633
js/ui/panel.js | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 6e546b0..10fe169 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;
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]