mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-09-29 22:48:37 +00:00
libghostty: unified action dispatch
First, this commit modifies libghostty to use a single unified action dispatch system based on a tagged union versus the one-off callback system that was previously in place. This change simplifies the code on both the core and consumer sides of the library. Importantly, as we introduce new actions, we can now maintain ABI compatibility so long as our union size does not change (something I don't promise yet). Second, this moves a lot more of the functions call on a surface into the action system. This affects all apprts and continues the previous work of introducing a more unified API for optional surface features.
This commit is contained in:
@@ -219,13 +219,13 @@ extension Ghostty {
|
||||
|
||||
// Determine our desired direction
|
||||
guard let directionAny = notification.userInfo?["direction"] else { return }
|
||||
guard let direction = directionAny as? ghostty_split_direction_e else { return }
|
||||
guard let direction = directionAny as? ghostty_action_split_direction_e else { return }
|
||||
var splitDirection: SplitViewDirection
|
||||
switch (direction) {
|
||||
case GHOSTTY_SPLIT_RIGHT:
|
||||
case GHOSTTY_SPLIT_DIRECTION_RIGHT:
|
||||
splitDirection = .horizontal
|
||||
|
||||
case GHOSTTY_SPLIT_DOWN:
|
||||
case GHOSTTY_SPLIT_DIRECTION_DOWN:
|
||||
splitDirection = .vertical
|
||||
|
||||
default:
|
||||
|
Reference in New Issue
Block a user