80 Commits

Author SHA1 Message Date
Gregory Anders
9b14398153 macos: support resizing splits 2023-11-05 20:42:59 -06:00
Gregory Anders
3b2799ce97 macos: refactor SplitNode
This commit does two things: adds a weak reference to the parent
container of each SplitNode.Container and SplitNode.Leaf and moves the
"direction" of a split out of the SplitNode enum and into the
SplitNode.Container struct as a field.

Both changes are required for supporting split resizing. A reference to
the parent in each leaf and split container is needed in order to
traverse upwards through the split tree. If the focused split is not
part of a container that is split along the direction that was requested
to be resized, then we instead try and resize the parent. If the parent
is split along the requested direction, then it is resized
appropriately; otherwise, repeat until the root of the tree is reached.

The direction is needed inside the SplitNode.Container object itself so
that the container knows whether or not it is able to resize itself in
the direction requested by the user. Once the split direction was moved
inside of SplitNode.Container, it became redundant to also have it as
part of the SplitNode enum, so this simplifies things.
2023-11-05 20:20:39 -06:00
Mitchell Hashimoto
ef44551522 apprt/embedded: hook up paste confirmation 2023-11-05 09:20:16 -08:00
Mitchell Hashimoto
04acaf8b20 macos: hook up paste protection delegate, cancel button 2023-11-04 20:47:16 -07:00
Mitchell Hashimoto
5f5f5a44ec macos: paste protection boilerplate 2023-11-04 20:15:39 -07:00
Mitchell Hashimoto
cad461fff7 macos: modify tabbing mode when entering/exiting fullscreen
Related to #799

With tabbing mode disabled, fullscreen (native) windows when creating a
new tab creates a window in the tab bar, but ALSO puts the window into a
new "screen" on macOS. When you click the tab bar, macOS animates
between screens. Its jarring!

This commit makes it so that in fullscreen we go back to automatic
tabbing even for new windows, which produces new windows within a tab.
This is normal default behavior for macOS tabbed programs. When you are
not in fullscreen or exit fullscreen, then the tabbing mode returns to
disabled so Ghostty can manage it.
2023-11-03 09:16:55 -07:00
Gregory Anders
6c340810a5 macos: fix tab labeling
Fixes a regression introduced in
https://github.com/mitchellh/ghostty/pull/772.
2023-11-03 07:40:56 -07:00
Mitchell Hashimoto
833e1a5329 macos: only modify style mask, don't overwrite
Fixes #784

The issue before was we were removing the fullscreen style which was
triggering a Cocoa assertion.
2023-11-02 22:12:52 -07:00
Mitchell Hashimoto
60e1ca81f0 macos: if alert is already showing, don't check if need confirm 2023-10-31 09:41:40 -07:00
Mitchell Hashimoto
6a024897a6 macos: new window on existing terminal inherits properly 2023-10-30 22:57:46 -07:00
Mitchell Hashimoto
ecd7a17384 macos: new tab while a window is focused inherits 2023-10-30 22:55:57 -07:00
Mitchell Hashimoto
07c4692799 macos: forgot the toggle fullscreen binding 2023-10-30 22:18:20 -07:00
Mitchell Hashimoto
09ad0f6b7b macos: attach various menu items to first responder, terminal
Fixes #758
2023-10-30 22:06:55 -07:00
Mitchell Hashimoto
9d3a4d2a58 Update macos/Sources/Features/Terminal/TerminalController.swift
Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
2023-10-30 18:26:44 -07:00
Mitchell Hashimoto
db309a0b61 macos: fix cascade points 2023-10-30 15:28:14 -07:00
Mitchell Hashimoto
b4c973cd23 macos: improved comments 2023-10-30 15:15:56 -07:00
Mitchell Hashimoto
b010875176 macos: do not need base config 2023-10-30 14:59:19 -07:00
Mitchell Hashimoto
7fe6f15d2d macos: only show alert once 2023-10-30 14:56:59 -07:00
Mitchell Hashimoto
350a9da68b macos: confirm quit with splits, tab 2023-10-30 14:50:54 -07:00
Mitchell Hashimoto
1fcc5812be macos: detect when surface tree becomes empty 2023-10-30 14:46:28 -07:00
Mitchell Hashimoto
b40245f01d macos: remove old primary window stuff 2023-10-30 14:36:20 -07:00
Mitchell Hashimoto
c86faa37c2 macos: terminal controller owns split data 2023-10-30 14:31:04 -07:00
Mitchell Hashimoto
05fd3f25b3 macos: clear content view on window close 2023-10-30 11:58:23 -07:00
Mitchell Hashimoto
ed1741730e macos: base config plumbed through 2023-10-30 11:53:05 -07:00
Mitchell Hashimoto
61451942e8 macos: implement last surface close to close window 2023-10-30 09:53:59 -07:00
Mitchell Hashimoto
8a03dcbb5b macos: goto tab works 2023-10-30 09:24:06 -07:00
Mitchell Hashimoto
b8a24e8bba macos: toggle fullscreen 2023-10-30 09:19:13 -07:00
Mitchell Hashimoto
bee0f25d54 macos: new terminal view new tab/window 2023-10-30 09:06:24 -07:00
Mitchell Hashimoto
704c303cd1 macos: working on the new terminalmanager 2023-10-30 09:06:24 -07:00
Mitchell Hashimoto
3018377389 macos: wip 2023-10-30 09:06:24 -07:00