(direction, move, fromAllMonitors = false)
| 2863 | } |
| 2864 | |
| 2865 | selectSequenceSpace(direction, move, fromAllMonitors = false) { |
| 2866 | // if in stack preview do not run sequence preview |
| 2867 | if (inPreview === PreviewMode.STACK) { |
| 2868 | return; |
| 2869 | } |
| 2870 | |
| 2871 | let currentSpace = this.activeSpace; |
| 2872 | let monitorSpaces; |
| 2873 | if (fromAllMonitors) { |
| 2874 | monitorSpaces = this._getOrderedSpacesFromAllMonitors(currentSpace.monitor); |
| 2875 | } else { |
| 2876 | monitorSpaces = this._getOrderedSpaces(currentSpace.monitor); |
| 2877 | } |
| 2878 | |
| 2879 | let from = monitorSpaces.indexOf(this.selectedSpace); |
| 2880 | let newSpace = this.selectedSpace; |
| 2881 | let to = from; |
| 2882 | |
| 2883 | if (move && this.selectedSpace.selectedWindow) { |
| 2884 | const navigator = Navigator.getNavigator(); |
| 2885 | if (!navigator._moving || |
| 2886 | (Array.isArray(navigator._moving) && navigator._moving.length === 0)) { |
| 2887 | takeWindow(this.selectedSpace.selectedWindow, |
| 2888 | this.selectedSpace, |
| 2889 | { navigator }); |
| 2890 | } |
| 2891 | } |
| 2892 | |
| 2893 | if (direction === Meta.MotionDirection.DOWN) { |
| 2894 | to = from + 1; |
| 2895 | } |
| 2896 | else { |
| 2897 | to = from - 1; |
| 2898 | } |
| 2899 | |
| 2900 | if (to < 0 || to >= monitorSpaces.length) { |
| 2901 | return; |
| 2902 | } |
| 2903 | |
| 2904 | if (to === from && Easer.isEasing(newSpace.actor)) { |
| 2905 | return; |
| 2906 | } |
| 2907 | |
| 2908 | if (!inPreview) { |
| 2909 | this.initWorkspaceSequence(); |
| 2910 | } |
| 2911 | |
| 2912 | newSpace = monitorSpaces[to]; |
| 2913 | this.selectedSpace = newSpace; |
| 2914 | |
| 2915 | // if active (source space) is panelMonitor update indicator |
| 2916 | if (currentSpace.monitor === Topbar.panelMonitor()) { |
| 2917 | Topbar.updateWorkspaceIndicator(newSpace.index); |
| 2918 | } |
| 2919 | |
| 2920 | const scale = 0.825; |
| 2921 | const padding_percentage = 4; |
| 2922 | let last = monitorSpaces.length - 1; |
no test coverage detected