MCPcopy
hub / github.com/paperwm/PaperWM / selectSequenceSpace

Method selectSequenceSpace

tiling.js:2865–2947  ·  view source on GitHub ↗
(direction, move, fromAllMonitors = false)

Source from the content-addressed store, hash-verified

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;

Callers 6

constructorMethod · 0.80
selectDownSpaceFunction · 0.80
selectUpSpaceFunction · 0.80
moveDownSpaceFunction · 0.80
moveUpSpaceFunction · 0.80
_onEventMethod · 0.80

Calls 7

_getOrderedSpacesMethod · 0.95
initWorkspaceSequenceMethod · 0.95
takeWindowFunction · 0.85
indexOfMethod · 0.80
setMonitorMethod · 0.80
showMethod · 0.45

Tested by

no test coverage detected