[gnome-shell/T27795: 121/138] screenShield: lift the shield if user clicks without dragging



commit dcc8ded827edba8d70fab5ff3fd683bfd81b0c22
Author: Roddy Shuler <roddy endlessm com>
Date:   Wed Jun 28 00:52:54 2017 -0700

    screenShield: lift the shield if user clicks without dragging
    
    Upon releasing the mouse, if there was no drag motion,
    lift the shield.  If there is any drag motion, only lift
    the shield if the original drag threshold was achieved.
    
    Many novice users are confused by the need to drag the shield open,
    so we make it as easy as possible at the expense that touchscreen
    users may unintentionally lift the shield with a stray screen touch.
    
    https://phabricator.endlessm.com/T17550

 js/ui/screenShield.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index a4c36a4e58..7bae43622c 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -759,6 +759,8 @@ var ScreenShield = class {
         if (this._isLocked)
             this._ensureUnlockDialog(false, false);
 
+        this._haveDragMotion = false;
+
         return true;
     }
 
@@ -771,13 +773,16 @@ var ScreenShield = class {
 
         this._lockScreenGroup.y = newY;
 
+        this._haveDragMotion = true;
+
         return true;
     }
 
     _onDragEnd(_action, _actor, _eventX, _eventY, _modifiers) {
         if (this._lockScreenState != MessageTray.State.HIDING)
             return;
-        if (this._lockScreenGroup.y < -(ARROW_DRAG_THRESHOLD * global.stage.height)) {
+        if ((this._lockScreenGroup.y < -(ARROW_DRAG_THRESHOLD * global.stage.height)) ||
+            !this._haveDragMotion) {
             // Complete motion automatically
             let [velocity_, velocityX_, velocityY] = this._dragAction.get_velocity(0);
             this._liftShield(true, -velocityY);


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