From 00cc32d95a9f793a20e2ebdf56bd57e2807a30ac Mon Sep 17 00:00:00 2001 From: Marina Zhurakhinskaya Date: Fri, 7 Aug 2009 18:22:05 -0400 Subject: [PATCH] Ignore clicks on hot corner during transition It's both intuitive to go to the corner of the screen and click the activities button at the same time. Both actions bring up the overlay, but combined they cancel each other out. This commit makes clicking the hot corner not cancel the act of going to the hot corner. Based on a patch from Ray Strode. --- js/ui/overlay.js | 6 ++++++ js/ui/panel.js | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/js/ui/overlay.js b/js/ui/overlay.js index 894d3c6ba..14e69afe3 100644 --- a/js/ui/overlay.js +++ b/js/ui/overlay.js @@ -92,6 +92,7 @@ Overlay.prototype = { this._group._delegate = this; this.visible = false; + this.animationInProgress = false; this._hideInProgress = false; this._recalculateGridSizes(); @@ -242,6 +243,7 @@ Overlay.prototype = { return; this.visible = true; + this.animationInProgress = true; let global = Shell.Global.get(); let screenWidth = global.screen_width; @@ -309,6 +311,7 @@ Overlay.prototype = { let global = Shell.Global.get(); + this.animationInProgress = true; this._hideInProgress = true; if (this._activeDisplayPane != null) this._activeDisplayPane.close(); @@ -377,6 +380,8 @@ Overlay.prototype = { this._dash.actor.raise_top(); this._dash.actor.remove_clip(); + this.animationInProgress = false; + this.emit('shown'); }, @@ -393,6 +398,7 @@ Overlay.prototype = { this._group.hide(); this.visible = false; + this.animationInProgress = false; this._hideInProgress = false; Main.endModal(); diff --git a/js/ui/panel.js b/js/ui/panel.js index d8ac1ac6e..13d532052 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -83,8 +83,7 @@ Panel.prototype = { // In addition to being triggered by the mouse enter event, the hot corner // can be triggered by clicking on it. This is useful if the user wants to - // immediately undo the effect of triggering the hot corner once in the - // hot corner. + // undo the effect of triggering the hot corner once in the hot corner. hotCorner.connect('enter-event', Lang.bind(this, this._onHotCornerTriggered)); hotCorner.connect('button-release-event', @@ -220,7 +219,9 @@ Panel.prototype = { }, _onHotCornerTriggered : function() { - Main.overlay.toggle(); + if (!Main.overlay.animationInProgress) { + Main.overlay.toggle(); + } return false; } };