From a6d8c25494a3a9aabbbd0b21a77b2c4baebfa736 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 31 Jul 2014 17:26:47 +0200 Subject: [PATCH] panel: Avoid _onEvent() to be called twice Both Panel.ActivitiesButton and its parent class Panel.MenuButton would attempt to connect their own _onEvent() function to Clutter::event, which counterintuitively was connecting the child class' _onEvent() function twice. So, actually chain up on the signal handler, and don't connect twice to the signal. Both methods were calling this.menu.close(), so only do that on the parent class handler, since we're chaining up and doing the right thing now. https://bugzilla.gnome.org/show_bug.cgi?id=733840 --- js/ui/panel.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/js/ui/panel.js b/js/ui/panel.js index 10fe169c4..3c2ab6bef 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -571,7 +571,6 @@ 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('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() { @@ -609,12 +608,12 @@ const ActivitiesButton = new Lang.Class({ }, _onEvent: function(actor, event) { - if (event.type() == Clutter.EventType.TOUCH_END || - event.type() == Clutter.EventType.BUTTON_RELEASE) { + this.parent(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; },