Fixes#1756
We previously converted from view to screen coordinates but if the view
doesn't take up the full window then the view coordinates are wrong. We
need to convert to window coordinates in the middle.
Add support for configurable fonts for window and tab titles. This is
only implemented for macOS (and could be macOS-only if other platforms
aren't able to support this using their windowing toolkits). It plays
nicely with regular and titlebar tabs.
Previously files would be pasted as only the filename. This commit
introduces an extension to NSPasteboard which provides a method to
consistently get the string contents of a pasteboard so that the
behavior can stay the same anywhere where we need to do that.
Fixes#1500
This overhauls how we do focus management for surfaces to make it more
robust. This DID somehow all work before but was always brittle and was
a sketchy play with SwiftUI/AppKit behavior across macOS versions.
The new approach uses our window controller and terminal delegate
system to disseminate focus information whenever any surface changes
focus. This ensures that only ONE surface ever has focus in libghostty
because the controller ensures it is widely distributed.
We are also now using the `darken(by:)` implementation to generate
the split divider color on macOS, which means we'll have a consistent
rendering across iOS and macOS.
Fixes#1330
I admit this code is a mess to understand, so I'm not 100% certain this
fix is correct. It definitely fixes#1330 but I'm not sure if this
breaks other split scenarios.
I believe that our logic here was simply wrong, notice that left/right
had opposite logic and this brings it all into consistency.
Long term, we should redo all of our directional movement since we've
refactored how split state is stored now on the controller with parent
references.
This allows for example clicking on a split when focused on a different
app and having focus immediately jump to that split. Before this, you'd
have to click to focus the window, then second click to focus on the
split.
Fixes#1214
This introduces the `window-colorspace` configuration which allows
configuring the colorspace to use for windows on macOS. The default is
sRGB (same as before) but this can also be set to `display-p3`.