619 Commits

Author SHA1 Message Date
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
Mitchell Hashimoto
83b004b6e1 macos: show ghostty icon on main app loading 2024-01-13 22:26:51 -08:00
Mitchell Hashimoto
48af1c6c99 macos: add iOS target 2024-01-13 22:24:35 -08:00
Thorsten Ball
2bf8dac864 macos: use switch statement instead of if-let 2024-01-13 08:32:50 +01: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
8b0d4312ee macos: invalidate restorable state whenever a terminal window is closed 2024-01-10 21:28:49 -08:00
Mitchell Hashimoto
837b551a92 macos: invalid restorable state whenever surface tree changes
Related to #1177

This detects whenever the surface tree (splits) change in any way and
requests that the restorable state be invalided by macOS.
2024-01-10 21:24:47 -08:00
Mitchell Hashimoto
88c525d593 macos: minor style changes 2024-01-10 09:37:36 -08:00
Thorsten Ball
3e811dad2c macos: stop windows glitching when cascading
Noticed that windows glitch when cascading: they show up in center of
screen, then quickly move to the correct position at last-cascade point.

This fixes the issue, by moving the `showWindow` call to _after_ the
setting of the last cascade point.

Now if you look at the code and think: "shouldn't this work without the
async-dispatch, like this?"

```swift
if (!window.styleMask.contains(.fullScreen)) {
    Self.lastCascadePoint = window.cascadeTopLeft(from: Self.lastCascadePoint)
}
c.showWindow(self)
```

Then, yes, I had the same thought, but it doesn't. And as discussed on
Discord, we probably don't know what's going on behind the scenes.

So this is the simplified code of the version we have to live with:
async dispatching the cascade and non-cascade versions both.
2024-01-10 18:28:19 +01:00
Thorsten Ball
b7a715ec86 macos: allow submitting clipboard confirmation with return
Before this change I couldn't submit the dialog with return. Or
cmd+return.

From what I understand the problem was that the `TextEditor` always
steals the default focus. I tried a bunch of workarounds I found to set
the default focus on the button, but none of them worked.

Then I thought: do we even need a full-on Text*Editor*? So I switched
`TextEditor` to `Text` with a `ScrollView`: things look the same, text
is selectable and scrollable, but I can hit return to submit the dialog.
2024-01-10 06:58:56 +01: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
Mitchell Hashimoto
42c10de814 macos: move active state to delegate 2024-01-05 12:32:18 -08:00
Vivek Roy
3aad646be2 macos: Address window spawning and ordering issues from service. 2024-01-06 00:35:34 +05:30
Mitchell Hashimoto
9bf13c6236 macos: set initial window size in controller window init
Fixes #1227
Fixes #1206

This moves the logic that respects `window-width` and `window-height` to
the controller window initialization. This is where it should've been
all the time but we previously didn't use a controller architecture so
we did our best to use heuristics in the view to do this.

This location now ensures that this only happens on window
initialization and only if we have one surface.
2024-01-05 09:42:50 -08:00
Mitchell Hashimoto
f93c41669e macos: order main window front on restore 2024-01-03 12:10:52 -08:00
Mitchell Hashimoto
c9ff034b62 macos: prevent super hot loop to restore focus state 2024-01-03 12:07:03 -08:00
Mitchell Hashimoto
ae7221d680 macos: try to save window state before sparkle restart 2024-01-03 11:53:18 -08:00
Gregory Anders
a17fad2da9 macos: use ReleaseLocal build configuration for Profile action 2024-01-02 16:45:26 -06:00
Mitchell Hashimoto
5e0e0b2bd4 macos: wait for window to become visible to set blur
Fixes #1181
2023-12-29 21:58:30 -08:00
Mitchell Hashimoto
6532ff73a8 macos: verify inspector is not nil before sending it to draw 2023-12-29 07:53:20 -08:00
Mitchell Hashimoto
40e882ff48 macos: invalid restorable state when surface is closed
Fixes #1177
2023-12-28 19:39:47 -08:00
Burak Yildiz
f3c6066be3 Reorder menu items (File, Edit, View ...) like most of the other apps 2023-12-28 21:43:24 +01:00
Mitchell Hashimoto
0008fb0a27 macos: set surface tree on init in restore
This prevents an unnecessary SurfaceView from being created. Creating a
SurfaceView is very expensive because this starts multiple threads,
creates the pty, starts the pty process, etc.

Additionally, this was exposing what I believe to be #497 when restoring
state: a surface view was created and destroyed very quickly causing
hangs on some machines. This still needs to be resolved but the behavior
in this commit was still a bug anyways.
2023-12-27 20:12:46 -08:00
Mitchell Hashimoto
181cfa1350 macos: notifications use surface UUID for lookups
Fixes #1162
2023-12-27 08:49:12 -08:00
Mitchell Hashimoto
789107ff1b macos: text in about window is selectable
Fixes #1163

I also fixed the AppIconImage from being 1024x1024 to much smaller so we
don't see as many artifacts in the downsize.
2023-12-27 07:53:28 -08:00
Mitchell Hashimoto
2aa7f12417 macos: increment restorable state version 2023-12-26 14:45:39 -08:00
Mitchell Hashimoto
98041940f0 macos: restore focused split on app restore 2023-12-26 14:45:27 -08:00
Mitchell Hashimoto
a321ef515d macos: assign unique UUID per surface, store in app state 2023-12-26 14:24:05 -08:00
Mitchell Hashimoto
20f9a3baab macos: reset state version to 1 2023-12-23 18:59:19 -08:00
Mitchell Hashimoto
c3b89fa215 macos: use securecoding for codablebridge to prevent warning
Thanks Matt Polzin!
2023-12-23 18:49:41 -08:00
Mitchell Hashimoto
a8568306c9 macos: store pwd with save/restore state 2023-12-23 17:06:34 -08:00
Mitchell Hashimoto
2390668834 macos: encode surface tree in state restore 2023-12-23 13:15:46 -08:00
Mitchell Hashimoto
a5d249eb48 config: if window-save-state is never, never restore state 2023-12-22 22:00:25 -08:00
Mitchell Hashimoto
f0bf0fd888 config: window-save-state 2023-12-22 21:51:06 -08:00
Mitchell Hashimoto
59f54a1d88 macos: initial window save/restore is working for frames only 2023-12-22 21:24:27 -08:00
Mitchell Hashimoto
a94973c240 Merge pull request #1138 from gpanders/vim-plugin
build: build Vim plugin files for Ghostty config file
2023-12-22 08:50:34 -08:00
Chris Marchesi
e1320be757 macos: handle middle click
This adds middle-click support to MacOS.

Very simple update, since everything else is in place to handle mouse
clicks in the embedded runtime already, we just needed to add the event
handlers in the UI.
2023-12-22 00:05:28 -08:00
Vivek Roy
aa75e7dfd8 macos: Implement context menu functionality to open tabs and windows. 2023-12-22 11:20:42 +05:30
Gregory Anders
f7033524ec macos: add generated Vim plugin files to app bundle 2023-12-21 21:49:36 -06:00
Mitchell Hashimoto
fc897067a6 macos: reordering some files 2023-12-21 17:59:16 -08:00
Gregory Anders
18f2fb3fbd macos: include ghostty subdirectory under Resources
This enables us to treat Ghostty's resources directory the same way
whether it is installed in a macOS app bundle or under e.g. /usr/share.
2023-12-21 17:56:57 -08:00
Mitchell Hashimoto
3762f8c342 macos: make default config ReleaseLocal 2023-12-20 14:37:48 -08:00
Leo Razoumov
d568ef5b97 fix(macos): ReleaseLocal build configuration with "Library Validation" disabled
Fixes #1133

MacOS: If ghostty build succeeds but it crashes at startup due to a library or framework failing
to load, build it with `xcodebuild -configuration ReleaseLocal`
2023-12-20 16:54:58 -05:00