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

Function getOpenWindowPositionIndex

tiling.js:4262–4280  ·  view source on GitHub ↗
(space)

Source from the content-addressed store, hash-verified

4260 * { RIGHT: 0, LEFT: 1, START: 2, END: 3 };
4261 */
4262export function getOpenWindowPositionIndex(space) {
4263 let index = -1; // init (-1 -> at beginning)
4264 if (space?.selectedWindow) {
4265 index = space.indexOf(space.selectedWindow);
4266 }
4267
4268 const pos = Settings.prefs.open_window_position;
4269 switch (pos) {
4270 case Settings.OpenWindowPositions.LEFT:
4271 return index;
4272 case Settings.OpenWindowPositions.START:
4273 return 0;
4274 case Settings.OpenWindowPositions.END:
4275 // get number of columns in space
4276 return space.length + 1;
4277 default:
4278 return index + 1;
4279 }
4280}
4281
4282export function animateDown(metaWindow) {
4283 let space = spaces.spaceOfWindow(metaWindow);

Callers 1

insertWindowFunction · 0.85

Calls 1

indexOfMethod · 0.80

Tested by

no test coverage detected