layout: Track which barriers have been hit

For barriers like the hot corner which are made up of multiple axis
barriers, make sure that all the barriers have been left before
resetting the barrier.
This commit is contained in:
Jasper St. Pierre 2015-04-28 17:36:53 -07:00
parent f044e29526
commit 8a8abf12f9

View File

@ -1316,8 +1316,11 @@ const PressureBarrier = new Lang.Class({
}, },
_onBarrierLeft: function(barrier, event) { _onBarrierLeft: function(barrier, event) {
this._reset(); barrier._isHit = false;
this._isTriggered = false; if (this._barriers.every(function(b) { return !b._isHit; })) {
this._reset();
this._isTriggered = false;
}
}, },
_trigger: function() { _trigger: function() {
@ -1327,6 +1330,8 @@ const PressureBarrier = new Lang.Class({
}, },
_onBarrierHit: function(barrier, event) { _onBarrierHit: function(barrier, event) {
barrier._isHit = true;
// If we've triggered the barrier, wait until the pointer has the // If we've triggered the barrier, wait until the pointer has the
// left the barrier hitbox until we trigger it again. // left the barrier hitbox until we trigger it again.
if (this._isTriggered) if (this._isTriggered)