[gnome-shell] layout: Remove _addBarrierEvent



commit e3eb4a20a53e19bede716a3006153b6cfe616f75
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Feb 14 21:22:49 2013 -0500

    layout: Remove _addBarrierEvent
    
    Moving it inline to when we get the event means that we can
    remove the duplicate call to _getDistanceAcrossBarrier.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=693854

 js/ui/layout.js |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/layout.js b/js/ui/layout.js
index cae7f81..f6443ed 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -1190,11 +1190,6 @@ const PressureBarrier = new Lang.Class({
         this._barrierEvents = this._barrierEvents.slice(firstNewEvent);
     },
 
-    _addBarrierEvent: function(event) {
-        this._barrierEvents.push(event);
-        this._currentPressure += this._getDistanceAcrossBarrier(event);
-    },
-
     _onBarrierLeft: function(barrier, event) {
         this._reset();
     },
@@ -1218,7 +1213,8 @@ const PressureBarrier = new Lang.Class({
         this._lastTime = event.time;
 
         this._trimBarrierEvents();
-        this._addBarrierEvent(event);
+        this._barrierEvents.push(event);
+        this._currentPressure += distance;
 
         if (this._currentPressure >= this._threshold) {
             this.emit('trigger');


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]