ITADN

2D grid navigation (spaces)

#2601Pull Requestmikkelricky 创建于 2025-04-13
M
mikkelrickycommented
Adds 2D grid navigation to yabai (cf. https://github.com/koekeishiya/yabai/issues/2602). The basic idea is to pretend that the spaces in the linear (1 dimensional) list that macOS provides are arranged in a grid where we can move “north”, “east”, “south” and “west”. This basically amounts to computing an offset to where the “north” space, say, is in the linear list (it's “3 spaces to the left” if we assume that the grid has 3 columns). I've added some crude documentation on this in [wiki/grid-spaces.md](https://github.com/koekeishiya/yabai/blob/f7fac2ff8a895564be99338219792012287f457e/wiki/grid-spaces.md). I'm in no way an expert C programmer, so any suggestions on improvements or rewriting – and comments in general – will be much appreciated. I've been using 2D grid navigation in yabai for quite some time and it works perfectly for my needs. I don't use yabai for anything else that switching between spaces, but I don't expect my code changes to affect or break any other parts of yabai.
合并状态:未合并 4 条评论