[gnome-shell/gbsneto/new-lock-screen-part2: 41/59] screenShield: Remove the drag action from the shield



commit 2679257e6d35bce56a3fa2395356630250b8c15d
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Nov 28 20:00:58 2019 -0300

    screenShield: Remove the drag action from the shield
    
    This is start of the end of the screen shield; start by
    removing the dragging action from it.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/872

 js/ui/screenShield.js | 61 ---------------------------------------------------
 1 file changed, 61 deletions(-)
---
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index 3d66a27374..0fdfa1114c 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -24,9 +24,6 @@ const LOCKDOWN_SCHEMA = 'org.gnome.desktop.lockdown';
 const DISABLE_LOCK_KEY = 'disable-lock-screen';
 
 const LOCKED_STATE_STR = 'screenShield.locked';
-// fraction of screen height the arrow must reach before completing
-// the slide up automatically
-var ARROW_DRAG_THRESHOLD = 0.1;
 
 // ScreenShield animation time
 // - STANDARD_FADE_TIME is used when the session goes idle
@@ -37,10 +34,6 @@ var STANDARD_FADE_TIME = 10000;
 var MANUAL_FADE_TIME = 300;
 var CURTAIN_SLIDE_TIME = 300;
 
-function clamp(value, min, max) {
-    return Math.max(min, Math.min(max, value));
-}
-
 /**
  * If you are setting org.gnome.desktop.session.idle-delay directly in dconf,
  * rather than through System Settings, you also need to set
@@ -68,12 +61,6 @@ var ScreenShield = class {
                                       this._onLockScreenScroll.bind(this));
         Main.ctrlAltTabManager.addGroup(this._lockScreenGroup, _("Lock"), 'changes-prevent-symbolic');
 
-        this._dragAction = new Clutter.GestureAction();
-        this._dragAction.connect('gesture-begin', this._onDragBegin.bind(this));
-        this._dragAction.connect('gesture-progress', this._onDragMotion.bind(this));
-        this._dragAction.connect('gesture-end', this._onDragEnd.bind(this));
-        this._lockScreenGroup.add_action(this._dragAction);
-
         this._lockDialogGroup = new St.Widget({ x_expand: true,
                                                 y_expand: true,
                                                 reactive: true,
@@ -286,54 +273,6 @@ var ScreenShield = class {
         }
     }
 
-    _onDragBegin() {
-        this._lockScreenGroup.remove_all_transitions();
-        this._lockScreenState = MessageTray.State.HIDING;
-
-        if (this._isLocked)
-            this._ensureUnlockDialog(false);
-
-        return true;
-    }
-
-    _onDragMotion() {
-        let [, origY] = this._dragAction.get_press_coords(0);
-        let [, currentY] = this._dragAction.get_motion_coords(0);
-
-        let newY = currentY - origY;
-        newY = clamp(newY, -global.stage.height, 0);
-
-        this._lockScreenGroup.translation_y = newY;
-
-        return true;
-    }
-
-    _onDragEnd(_action, _actor, _eventX, _eventY, _modifiers) {
-        if (this._lockScreenState != MessageTray.State.HIDING)
-            return;
-        if (this._lockScreenGroup.translation_y < -(ARROW_DRAG_THRESHOLD * global.stage.height)) {
-            // Complete motion automatically
-            let [velocity_, velocityX_, velocityY] = this._dragAction.get_velocity(0);
-            this._liftShield(-velocityY);
-        } else {
-            // restore the lock screen to its original place
-            // try to use the same speed as the normal animation
-            let h = global.stage.height;
-            let duration = MANUAL_FADE_TIME * -this._lockScreenGroup.translation_y / h;
-            this._lockScreenGroup.remove_all_transitions();
-            this._lockScreenGroup.ease({
-                translation_y: 0,
-                duration,
-                mode: Clutter.AnimationMode.EASE_IN_QUAD,
-                onComplete: () => {
-                    this._lockScreenState = MessageTray.State.SHOWN;
-                },
-            });
-
-            this._maybeCancelDialog();
-        }
-    }
-
     _onStatusChanged(status) {
         if (status != GnomeSession.PresenceStatus.IDLE)
             return;


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