| 4260 | * { RIGHT: 0, LEFT: 1, START: 2, END: 3 }; |
| 4261 | */ |
| 4262 | export 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 | |
| 4282 | export function animateDown(metaWindow) { |
| 4283 | let space = spaces.spaceOfWindow(metaWindow); |