Commit Graph

1460 Commits

Author SHA1 Message Date
Mitchell Hashimoto
19f7b57cd1 macos: fixup focus issues when closing the new window 2025-12-29 10:36:24 -08:00
Mitchell Hashimoto
29edbbbc86 macos: open dragged windows where they are dropped 2025-12-29 10:21:21 -08:00
Mitchell Hashimoto
5ecd26727e macos: allow pulling split out into its own window 2025-12-29 10:11:59 -08:00
Mitchell Hashimoto
89c515cab5 macos: new window from tree in TerminalController 2025-12-29 10:03:36 -08:00
Mitchell Hashimoto
25c413005b macos: emit a notification when the surface drag ends outside area 2025-12-29 09:55:18 -08:00
Mitchell Hashimoto
c164e3bc02 macos: fix messy rebase 2025-12-29 07:13:25 -08:00
Mitchell Hashimoto
cfa3de5d9b macos: change style 2025-12-29 06:55:01 -08:00
Mitchell Hashimoto
dbeeb952cc macos: fix dragging point 2025-12-29 06:55:01 -08:00
Mitchell Hashimoto
e56dce3d84 macos: don't create drop zone at all if self dragging 2025-12-29 06:55:01 -08:00
Mitchell Hashimoto
e1f22472f6 macos: convert the transferable to a nsdraggingitem 2025-12-29 06:55:01 -08:00
Mitchell Hashimoto
7b743164ef macos: fix iOS builds 2025-12-29 06:55:01 -08:00
Mitchell Hashimoto
be97b5bede macOS: convert Surface dragging to use NSDraggingSource 2025-12-29 06:55:01 -08:00
Mitchell Hashimoto
9b7124cf62 macos: use preference key to detect self dragging 2025-12-29 06:55:01 -08:00
Mitchell Hashimoto
5245757875 macos: all sorts of cleanups 2025-12-29 06:55:01 -08:00
Mitchell Hashimoto
1dd8e3ef4a macos: add GhosttyDelegate for global operations 2025-12-29 06:55:00 -08:00
Mitchell Hashimoto
9724541a33 macos: unify split callbacks into a single tagged enum 2025-12-29 06:55:00 -08:00
Mitchell Hashimoto
60bc5a9ae7 macos: clean up some SwiftUI nesting 2025-12-29 06:55:00 -08:00
Mitchell Hashimoto
5916755388 macos: drop splits across windows 2025-12-29 06:55:00 -08:00
Mitchell Hashimoto
8f8b5846c6 macos: hook up onDrop to move splits 2025-12-29 06:55:00 -08:00
Mitchell Hashimoto
d92fe44d0d macos: fix various iOS build errors 2025-12-29 06:55:00 -08:00
Mitchell Hashimoto
485b861342 macos: drag preview is an image of the surface 2025-12-29 06:55:00 -08:00
Mitchell Hashimoto
5d8c9357c0 macos: move around some functions 2025-12-29 06:55:00 -08:00
Mitchell Hashimoto
0a80f77766 macos: wire up onDrop 2025-12-29 06:55:00 -08:00
Mitchell Hashimoto
43d87cf9f8 macos: setup drop UI on our split views 2025-12-29 06:55:00 -08:00
Mitchell Hashimoto
304e2612ab macOS: work on drop destination 2025-12-29 06:55:00 -08:00
Mitchell Hashimoto
5045688623 macos: move grab handle to separate file 2025-12-29 06:55:00 -08:00
Mitchell Hashimoto
57bb636655 surfaceview as transferable 2025-12-29 06:55:00 -08:00
Mitchell Hashimoto
88adffd734 macOS: add handle to the top of surfaces that can be used to drag
UI only
2025-12-29 06:54:59 -08:00
Mitchell Hashimoto
ab232b3060 macos: move Ghostty surface view into dedicated folder 2025-12-29 06:54:59 -08:00
Mitchell Hashimoto
551031e41f macOS: move NSGlassEffectView into TerminalViewContainer (#10062)
- Fixes #9991
> Modifying the subview of NSThemeFrame seems "dangerous" and
unpredictable.
- Provides correct `intrinsicContentSize` as previous
`NSHostingView<TerminalView>` did
  > Fixes regression caused by #10046

> [!NOTE]
> AI Proofread some of my comments
2025-12-29 06:52:18 -08:00
Daniel Wennberg
b7a12effce Only use macOS 26.0 workarounds on macOS 26.0 2025-12-28 09:47:22 -08:00
Mitchell Hashimoto
14f592b8d4 macOS: Don't duplicate command palette entries for terminal commands
This is a regression introduced when we added macOS support for custom
entries. I mistakingly thought that only custom entries were in the
config, but we do initialize it with all!
2025-12-26 11:03:50 -08:00
Lukas
6ab884d69f macOS: fix intrinsicContentSize of TerminalViewContainer 2025-12-26 13:35:25 +01:00
Zongyuan Li
88e471e015 fix(iOS): fix iOS app startup failure
Fixes #7643

This commit address the issue with 3 minor fixes:
1. Initialize ghostty lib before app start, or global allocator will
   be null.
2. `addSublayer` should be called on CALayer object, which is the
   property 'layer' of UIView
3. According to apple's [document](https://developer.apple.com/documentation/metal/mtlstoragemode/managed?language=objc),
   managed storage mode is not supported by iOS. So always use shared
   mode.

FYI, another [fix](https://github.com/mitchellh/libxev/pull/204) in libxev
is also required to make iOS app work.
2025-12-26 18:53:45 +08:00
Lukas
1c90af3569 macOS: move NSGlassEffectView into TerminalViewContainer 2025-12-26 11:44:30 +01:00
Mitchell Hashimoto
2415116ad0 Revert "macOS: move NSGlassEffectView into TerminalViewContainer (#10046)"
This reverts commit b8490f40c5, reversing
changes made to 050278feae.
2025-12-25 13:52:59 -08:00
Mitchell Hashimoto
b8490f40c5 macOS: move NSGlassEffectView into TerminalViewContainer (#10046)
Fixes #9991, modifying the subview of `NSThemeFrame` seems "dangerous"
and unpredictable.

> [!NOTE]
> AI Proofread some of my comments



https://github.com/user-attachments/assets/c443cf71-8a00-4c37-b008-d89b7f1564a3
2025-12-25 12:51:47 -08:00
rezky_nightky
bf73f75304 chore: fixed some typo
Author: rezky_nightky <with dot rezky at gmail dot com>
Repository: ghostty
Branch: main
Signing: GPG (4B65AAC2)
HashAlgo: BLAKE3

[ Block Metadata ]
BlockHash: c37f4ee817412728a8058ba6087f5ca6aaff5a845560447d595d8055972d0eac
PrevHash: 3510917a780936278debe21786b7bae3a2162cb3857957314c3b8702e921b3d4
PatchHash: 5e5bb4ab35df304ea13c3d297c6d9a965156052c82bccf852b1f00b7bcaa7dd4

FilesChanged: 18
Lines: +92 / -92

Timestamp: 2025-12-25T17:27:08Z
Signature1: c1970dbb94600d1e24dfe8efcc00f001664db7b777902df9632a689b1d9d1498
Signature2: 30babb1e3ca07264931e067bfe36c676fb7988c2e06f8c54e0c9538fe7c7fc9a
2025-12-26 00:27:08 +07:00
Mitchell Hashimoto
12523ca61c macOS: command-palette-entry is now visible in macOS 2025-12-24 14:33:21 -08:00
Lukas
574ee470bd macOS: move NSGlassEffectView into TerminalViewContainer 2025-12-24 23:10:31 +01:00
Lukas
7ce88b6811 macOS: fix initial surface color scheme in quickTerminal 2025-12-24 21:46:42 +01:00
Mitchell Hashimoto
6b7a7aacf2 macos: apply window position after setting content size (#10007)
> **Note**: This is a re-submission of #9952, which was closed in favor
of #9975. However, as noted in my [comment on
#9975](https://github.com/ghostty-org/ghostty/pull/9975#issuecomment-3677916608),
the issue still persists.

## Summary

- Fix `window-position-x/y` not being applied when `window-width/height`
is also configured

## Problem

When both `window-position-x/y` and `window-width/height` are
configured, the window position was not being applied correctly. The
window would appear near the center of the screen instead of the
specified position.

This worked correctly in v1.2.3 but regressed afterwards.

## Root Cause

This is a regression introduced in c75bade89 (#9747).

The commit refactored the default size logic from a computed `NSRect?`
property to a `DefaultSize` enum with `.frame` and
`.contentIntrinsicSize` cases.

**Before (working):**
```swift
private var defaultSize: NSRect? {
    // ... calculate frame ...
    return adjustForWindowPosition(frame: frame, on: screen)  // ← position was applied
}
```

**After (broken):**
```swift
enum DefaultSize {
    case frame(NSRect)
    case contentIntrinsicSize
    
    func apply(to window: NSWindow) {
        case .contentIntrinsicSize:
            window.setContentSize(size)
            window.constrainToScreen()
            // ← adjustForWindowPosition call was lost
    }
}
```

When `window-width/height` is configured, the `.contentIntrinsicSize`
case is used. This case only called `setContentSize` and
`constrainToScreen`, but did not apply the window position adjustment.

## Why This Fix is Correct

`DefaultSize.apply()` is intentionally **not** responsible for
position—it only handles **size**:

1. `apply()` is also called from `returnToDefaultSize(_:)` menu action
2. When user triggers "Return to Default Size", only the **size** should
reset—**not the position**
3. If we added position logic inside `apply()`, the window would
unexpectedly jump back to its initial position

Therefore, position adjustment belongs **outside** of `apply()`,
specifically during initial window setup in `windowDidLoad`.

## Fix

Call `adjustForWindowPosition` after applying the content intrinsic size
to ensure the window position is correctly set during initial window
creation.
2025-12-23 07:08:16 -08:00
Yasu Flores
5bd814adf8 move guard down to keep surfaceModel logic together 2025-12-22 08:53:43 -06:00
Suyeol Jeon
b4a5ddfef9 macos: apply window position after setting content size
When window-width/height is configured, the window size is set via
setContentSize in windowDidLoad. However, window-position-x/y was not
being applied after this resize, causing the window to appear at an
incorrect position.

This was a regression introduced in c75bade89 which refactored the
default size logic from a computed NSRect property to a DefaultSize
enum. The original code called adjustForWindowPosition after calculating
the frame, but this was lost during the refactoring.

Fixes the issue by calling adjustForWindowPosition after applying
contentIntrinsicSize to ensure window position is correctly set.
2025-12-22 15:09:00 +09:00
Yasu Flores
2215b731da Address warning and add guard clause 2025-12-21 20:47:56 -06:00
Yasu Flores
ab352b5af9 macos: Support native actions to move to beginning of document and move to end of document 2025-12-21 20:26:57 -06:00
Mitchell Hashimoto
39481453fe macos: show the key sequence overlay if no tables are active 2025-12-21 13:32:24 -08:00
Lukas
7d3db17396 macOS: key table animations and cleanup 2025-12-21 09:29:47 +01:00
Mitchell Hashimoto
dc8f082392 macos: copy the key table action bytes 2025-12-20 20:36:35 -08:00
Mitchell Hashimoto
eac0ec14fd macOS: revamped key table/sequence UI 2025-12-20 20:27:56 -08:00