-
-
Notifications
You must be signed in to change notification settings - Fork 312
Open
Labels
problemNeither a bug, nor a feature requestNeither a bug, nor a feature request
Description
TreeNode
is a core data structure of AeroSpace and unfortunately it's mutable.
The proposal is to rewrite it to immutable single-linked persistent tree.
Motivation:
- Stability. The current logic for binding two
TreeNode
is fragile and sometimes leads to hard to debug crashes: AeroSpace crash when open Xcode windows #706 - Performance. Once we make AeroSpace multi-threaded to handle hanging apps (Delay/freeze when switching focus & workspace #131), instead of "drawing" the layout on main thread and sending requests to app-threads, it makes sense to pass the tree data structure to each app-thread so that it could draw its part of the tree, which effectively makes the drawing multi-threaded by number of apps. Multi-threading drawing will help to reduce threads context switching for cases when apps have several visible windows. Though the tree has to be traversed multiple times in multi-threaded drawing approach. Precise performance measurements needs to be done.
- It makes it possible to take snapshots of the tree on its every modification before windows start "dying out" when the screen is locked. It should help to fix this issue: Windows may randomly jump to the focused workspace #1216
- Features like
aerospace undo
become possible (though, it may be too far fetched, who would need such a feature?)
Related: #1257
zhuoqun-chen, regohiro, linw1995, wolveix, zhenpewu and 3 more
Metadata
Metadata
Assignees
Labels
problemNeither a bug, nor a feature requestNeither a bug, nor a feature request