245 Commits

Author SHA1 Message Date
Mitchell Hashimoto
d2adf0501c macos: ime coordinate needs to be converted from view to window coords
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.
2024-05-10 20:45:51 -07:00
Qwerasd
5df0935f82 update font_size to f32 in libghostty 2024-05-09 00:03:40 -04:00
Mitchell Hashimoto
ca9689be46 renderer/metal: API to handle macOS display ID changing 2024-05-04 19:40:58 -07:00
Mitchell Hashimoto
e31e25f54d apprt/embedded: add draw now API 2024-05-04 14:49:49 -07:00
Mitchell Hashimoto
41cffd116a Merge pull request #1484 from jparise/window-title-font
macos: configurable titlebar fonts
2024-03-28 09:49:19 -07:00
Mitchell Hashimoto
9aadf59ab1 macos,libghostty: font size is a u8 2024-03-27 20:53:03 -07:00
Jon Parise
baf75dfaaf macos: configurable titlebar fonts
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.
2024-03-26 16:56:39 -07:00
Mitchell Hashimoto
6854fe91ab macos: only process key equivalents if we're focused
Fixes #1581
2024-03-15 14:11:46 -07:00
Qwerasd
bd03b19679 style 2024-03-08 13:24:01 -05:00
Qwerasd
d1ac0aff39 feat(macOS): Paste copied files as absolute paths.
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.
2024-03-07 20:53:48 -05:00
Mitchell Hashimoto
118b51157a macos: more robust surface focus state detection
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.
2024-02-11 09:19:13 -08:00
Qwerasd
cf2968c186 fix(macOS): Prevent janky transition animation on DPI change 2024-02-05 15:48:02 -05:00
Qwerasd
7a4c97329e macOS: Add URL to documentation in comment 2024-02-05 15:41:33 -05:00
Qwerasd
e91e2d409b fix(macOS): Prevent incorrect scaling of the Metal layer after DPI change
Ref: https://developer.apple.com/library/archive/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/CapturingScreenContents/CapturingScreenContents.html#//apple_ref/doc/uid/TP40012302-CH10-SW27
2024-02-05 14:08:12 -05:00
Mitchell Hashimoto
62785d9e54 macos: report color scheme for surface to libghostty 2024-02-02 13:19:46 -08:00
Mitchell Hashimoto
50125c0319 macos: whitespace 2024-01-31 15:44:34 -08:00
Mitchell Hashimoto
939bb22615 macos: do not hardcode true for titlebar tabs 2024-01-31 10:22:09 -08:00
Mitchell Hashimoto
fbac2d9810 macos: titlebar tab logic shuffling 2024-01-31 10:08:05 -08:00
Qwerasd
ba16d65d02 macOS: Added titlebar tabs 2024-01-30 18:48:36 -05:00
Pete Schaffner
63cc7dbe0d Move color extensions into OSColor
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.
2024-01-30 22:36:52 +01:00
Pete Schaffner
c248441057 Add ability to color the split divider on iOS
This adds the needed UIColor extensions to achieve the equivalent of
what we did on macOS
2024-01-30 14:31:25 +01:00
Mitchell Hashimoto
411a757cdf macos: fix uikit build, NSColor is not available 2024-01-29 22:23:06 -08:00
Mitchell Hashimoto
18dfb642f5 macos: plumb through the split divider color 2024-01-29 21:32:10 -08:00
Pete Schaffner
375df57155 Tint split view divider based on theme background 2024-01-29 21:58:13 +01:00
Mitchell Hashimoto
81532c0b56 macos: support reading service result text into terminal 2024-01-21 17:26:41 -08:00
Mitchell Hashimoto
4dbd10c913 apprt/embedded: support asking for selection text, existence 2024-01-21 17:22:44 -08:00
Mitchell Hashimoto
4c9fc452b6 macos: register that we accept/send text types for services 2024-01-21 17:07:24 -08:00
Mitchell Hashimoto
cc01049d55 macos: select split above/below should go to correct split when nested
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.
2024-01-19 21:11:20 -08:00
Mitchell Hashimoto
fd782746d4 macos: set proper content size for UIView views 2024-01-18 20:26:42 -08:00
Mitchell Hashimoto
487c22011c macos: make SurfaceView cross-platform! 2024-01-18 19:28:36 -08:00
Mitchell Hashimoto
01afa293c8 apprt/embedded: fix initialization on macOS 2024-01-18 08:55:03 -08:00
Mitchell Hashimoto
2568b4979b macos: allow first click when non-focused to shift focus
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.
2024-01-17 20:30:34 -08:00
Mitchell Hashimoto
ed3f1df5f0 Merge pull request #1316 from qwerasd205/macos-file-handler
Added macOS file open handler
2024-01-16 18:56:34 -08:00
Mitchell Hashimoto
1005116f03 macos: detect error during surface initialization and render 2024-01-16 18:50:47 -08:00
Qwerasd
51f53aa9bf Added macOS file open handler 2024-01-16 16:26:21 -05:00
Mitchell Hashimoto
b806b45bae macos: use UIColor for iOS 2024-01-16 11:58:14 -08:00
Mitchell Hashimoto
376345dcae macos: detect renderer health failures and show error view 2024-01-16 11:27:18 -08:00
Mitchell Hashimoto
875a774d4b macos: remove AppState and unify onto Ghostty.App cross-platform 2024-01-14 19:35:57 -08:00
Mitchell Hashimoto
5e69b30240 macos: iOS Ghostty.App converted to use Ghostty.Config 2024-01-14 15:55:31 -08:00
Mitchell Hashimoto
eba3d5414d macos: Ghostty.Config to store all config-related operations 2024-01-14 15:53:33 -08:00
Mitchell Hashimoto
65fd02817e macos: only load config files on macos target 2024-01-14 14:53:00 -08:00
Mitchell Hashimoto
4d9fd2becc macos: iOS app can initialize Ghostty 2024-01-14 14:44:16 -08:00
Thorsten Ball
90427a8d22 macos: respect window-new-tab-position configuration 2024-01-12 20:22:53 +01:00
Ryota
ad9de6707d Fix comment 2024-01-12 00:54:16 +00:00
Ryota
3baae1dce8 Wrap around split focus with next and previous 2024-01-12 00:53:47 +00:00
Ryota
3500293bac Add firstOrLast search based on next and previous 2024-01-12 00:53:19 +00:00
Ryota
ab8dfab9de Add helper func for first and last leaf 2024-01-12 00:52:26 +00:00
Ryota
d9c4bd7e25 Add helper functions for finding root 2024-01-12 00:52:17 +00:00
Mitchell Hashimoto
afb1fea48b macos: add Edit => Select All menu item
Fixes #1268
2024-01-09 20:54:23 -08:00
Mitchell Hashimoto
44544f29b2 macos: support Display P3 colorspace through configuration
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`.
2024-01-09 20:47:07 -08:00