10777 Commits

Author SHA1 Message Date
Mitchell Hashimoto
2df301e2fb macos: mouse pos and scroll intents 2025-06-21 06:39:20 -07:00
Mitchell Hashimoto
bc134016f7 macos: move mousePos and mousScroll to Ghostty.Surface 2025-06-21 06:39:20 -07:00
Mitchell Hashimoto
4445a9c637 macos: add mouse button intent 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
71b6e223af macos: input keyboard event can send modifiers and actions now 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
93619ad420 macos: Ghostty.Key 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
a6074040e7 macos: input intent 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
c904e86883 macos: invoke keybind intent 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
14e46d0979 macos: InvokeCommandPaletteIntent and CommandEntity 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
5259d0fa55 macos: starting to work on new libghostty data models 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
bbb69c8f27 macos: NewTerminalIntent returns Terminal, can split 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
683b38f62c macos: can specify parent terminal for new terminal intent 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
b8d4463754 macos: terminal not found should be an error 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
e51a93ee7c macos: Terminal entity has screen contents deferred 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
93f0ee2089 macos: GetTerminalDetails intent 2025-06-21 06:39:18 -07:00
Mitchell Hashimoto
2aa731a64e macos: TerminalEntity 2025-06-21 06:39:18 -07:00
Mitchell Hashimoto
7ae5018fe8 macos: new terminal intent 2025-06-21 06:39:18 -07:00
Mário Victor Ribeiro Silva
b249fe0b2c fix: undo poedit formatting 2025-06-20 21:15:03 -03:00
Qwerasd
ddf1a5b23d renderer: move drawFrame AutoreleasePool handling to GraphicsAPI
Introduces `drawFrameStart`/`drawFrameEnd` for this purpose.
2025-06-20 16:21:44 -06:00
Qwerasd
ab926fc842 naming(GraphicsAPI): repeat -> presentLastTarget 2025-06-20 15:51:48 -06:00
Qwerasd
a802108558 renderer: remove unused surface parameter from updateFrame 2025-06-20 15:49:53 -06:00
Qwerasd
8b9e6641f2 style(renderer): explicit result type
In case of future breaking changes to `options`
2025-06-20 15:48:44 -06:00
Qwerasd
3e7d64b5ce style(renderer): explicit empty error set for OpenGL init 2025-06-20 15:45:43 -06:00
Qwerasd
ea7a91e2ba style(renderer): explicit error sets 2025-06-20 15:18:41 -06:00
Qwerasd
9d00018f8b renderer: minimize initial size of GPU resources
These will all be resized anyway on the first frame, so there's no point
in preallocating sizes that will be too small.
2025-06-20 15:18:41 -06:00
Qwerasd
2f10caec8f renderer: clarify why SwapChain.defunct is required 2025-06-20 15:18:41 -06:00
Qwerasd
6b7d751007 renderer: make GraphicsAPI.swap_chain_count required 2025-06-20 15:18:41 -06:00
Qwerasd
dccbec2283 style(renderer): capture generic consts as decls in returned struct
Out of an abundance of caution, since there have been issues in the past
relating to consts outside of the returned struct.
2025-06-20 15:18:41 -06:00
Qwerasd
b9e35c5970 renderer: uncomment resize message handling
We need this to get info about the padding, even if we do derive the
grid and screen size separately.

In the future this should possibly be changed to a message that only
sends the padding info and nothing else.
2025-06-20 15:18:41 -06:00
Qwerasd
8b23e73d20 metal: retain IOSurfaceLayer ourselves instead of relying on the view
If this was Swift code, we'd be using a strong reference, which would
retain the layer for us and release it when the object is deallocated,
but this is Zig land so we have to do that manually.

NOTE: We don't *have* to do this, but it fits much better with Zig idiom
and hopefully avoids potential future footguns. We should do this to any
autoreleased objects that we persist a reference to in a Zig struct.
2025-06-20 15:18:41 -06:00
Qwerasd
e8460e80b2 docs: update info about runtime change of custom-shader
Also removes incorrect information about OpenGL requirement, since the
minimum required OpenGL is now unconditionally 4.3
2025-06-20 15:18:41 -06:00
Qwerasd
541bb0d4d9 fix window cross-compilation 2025-06-20 15:18:41 -06:00
Qwerasd
ea1e507af7 unwrap unnecessary @"" identifiers 2025-06-20 15:18:41 -06:00
Qwerasd
6dc5ae7a00 format (remove empty lines) 2025-06-20 15:18:41 -06:00
Qwerasd
ac2eef9aeb renderer: disable multi-buffering for OpenGL
Frames are sequential for OpenGL since the completion handler always
calls `glFinish`, so the extra buffers do nothing but waste memory.
2025-06-20 15:18:41 -06:00
Qwerasd
371d62a82c renderer: big rework, graphics API abstraction layers, unified logic
This commit is very large, representing about a month of work with many
interdependent changes that don't separate cleanly in to atomic commits.

The main change here is unifying the renderer logic to a single generic
renderer, implemented on top of an abstraction layer over OpenGL/Metal.

I'll write a more complete summary of the changes in the description of
the PR.
2025-06-20 15:18:41 -06:00
Qwerasd
521872442a vendor: update glad to OpenGL 4.3 2025-06-20 15:18:41 -06:00
Qwerasd
7cfc906c60 debug: properly set thread names on macOS 2025-06-20 15:18:41 -06:00
Qwerasd
77c050c156 refactor(Metal): make pipeline handling DRYer 2025-06-20 15:18:41 -06:00
Qwerasd
f40cd3cae3 chore: improve Metal API definitions a bit 2025-06-20 15:18:41 -06:00
Mitchell Hashimoto
f55c77bc81 build: Use correct SDK for iOS Simulator shader build (#7636)
This PR makes the build script use the correct SDK and version flag for
the iOS Simulator.

Without this PR, the terminal fails to initialize on the iOS Simulator:

```
Compiler failed to build request
metal error=Target OS is incompatible: library was not compiled for the simulator
error initializing surface err=error.MetalFailed
```


<details>
<summary>With the PR</summary>


![image](https://github.com/user-attachments/assets/13735334-1321-42d5-8f01-4d5f6a7660ba)
</details>

Fixes #7635.
2025-06-20 14:01:54 -07:00
Zhaofeng Li
fda08a6999 build: Use correct SDK for iOS Simulator shader build 2025-06-20 14:02:07 -06:00
Mário Victor Ribeiro Silva
b89cb59d79 translation(pt_BR): add missing translation 2025-06-20 10:23:10 -03:00
Mitchell Hashimoto
d0e145292e snap: vendor libgtk4-layer-shell.so (#7623)
vendor libgtk4-layer-shell.so to ensure it's available at runtime
regardless of host system.
2025-06-18 08:38:43 -07:00
Ken VanDine
7d2da23021 snap: vendor libgtk4-layer-shell.so 2025-06-18 10:06:35 -04:00
Mitchell Hashimoto
5a788bfa90 build: use xcrun --sdk <sdk> metal for metal paths (#7619)
This wasn't working before but it just requires a restart of the machine
for the changes to take effect. The namespace runners have this prebuilt
so this should work now.

The other workaround was flaky for unknown reasons so I'd prefer to go
back to this.
2025-06-17 16:36:43 -07:00
Mitchell Hashimoto
30a8ba1bf6 macos: disambiguate close tab vs close window for confirmation (#7618)
This fixes an issue where pressing the red close button in a window or
the "x" button on a tab couldn't differentiate and would always close
the tab or close the window (depending on tab counts).

It seems like in both cases, AppKit triggers the `windowShouldClose`
delegate method on the controller, but for the close window case it
triggers this on ALL the windows in the group, not just the one that was
clicked.

I implemented a kind of silly coordinator that debounces
`windowShouldClose` calls over 100ms and uses that to differentiate
between the two cases.
2025-06-17 16:24:46 -07:00
Mitchell Hashimoto
559fd92295 build: use xcrun --sdk <sdk> metal for metal paths
This wasn't working before but it just requires a restart of the machine
for the changes to take effect. The namespace runners have this prebuilt
so this should work now.

The other workaround was flaky for unknown reasons so I'd prefer to go
back to this.
2025-06-17 16:23:29 -07:00
Mitchell Hashimoto
51b9fa751a macos: disambiguate close tab vs close window for confirmation
This fixes an issue where pressing the red close button in a window or
the "x" button on a tab couldn't differentiate and would always close
the tab or close the window (depending on tab counts).

It seems like in both cases, AppKit triggers the `windowShouldClose`
delegate method on the controller, but for the close window case it
triggers this on ALL the windows in the group, not just the one
that was clicked.

I implemented a kind of silly coordinator that debounces
`windowShouldClose` calls over 100ms and uses that to differentiate
between the two cases.
2025-06-17 16:16:14 -07:00
Mitchell Hashimoto
7d01332574 macOS tip regression: Confirm close on window close (#7617)
Fixes #7615

We were incorrectly closing the window without confirmation when there
were no tabs.

This was part of the undo/redo PR.
2025-06-17 15:20:53 -07:00
Mitchell Hashimoto
e6c77789d3 macOS: Confirm close on window close
Fixes #7615

We were incorrectly closing the window without confirmation when there
were no tabs.
2025-06-17 15:03:10 -07:00