[gnome-shell/wip/jimmac/dash-icon-spacing: 16/72] workspacesView: Snap horizontally when dragging windows
- From: Jakub Steiner <jimmac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/jimmac/dash-icon-spacing: 16/72] workspacesView: Snap horizontally when dragging windows
- Date: Tue, 2 Feb 2021 11:58:18 +0000 (UTC)
commit 233d166c774886d8a5ceb64f83bf21859eaa97dc
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue Dec 29 18:51:03 2020 -0300
workspacesView: Snap horizontally when dragging windows
So that all workspaces are visible simultaneously, which allows
moving application windows between workspaces.
js/ui/workspacesView.js | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
---
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index 8b99c93ed0..dcd62bcbf6 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -566,11 +566,30 @@ class WorkspacesDisplay extends St.Widget {
_windowDragBegin() {
this._inWindowDrag = true;
+
+ const snapTransition = this._snapAdjustment.get_transition('value');
+ this._previousSnapAxis = snapTransition
+ ? snapTransition.get_interval().peek_final_value()
+ : this._snapAdjustment.value;
+ this._snapAdjustment.ease(Clutter.Orientation.HORIZONTAL, {
+ duration: ANIMATION_TIME,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ });
+
this._updateSwipeTracker();
}
_windowDragEnd() {
this._inWindowDrag = false;
+
+ const snapAxis = this._previousSnapAxis;
+ delete this._previousSnapAxis;
+
+ this._snapAdjustment.ease(snapAxis, {
+ duration: ANIMATION_TIME,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ });
+
this._updateSwipeTracker();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]