59 Commits

Author SHA1 Message Date
Mitchell Hashimoto
d090384600 macos: fix non-AppKit builds 2024-09-21 10:22:14 -07:00
Mitchell Hashimoto
f9bd009ce5 macos: unhide cursor on clipboard confirmation 2024-09-21 09:59:40 -07:00
Mitchell Hashimoto
c01bdc6d7c macos: use pointerStyle for SplitView Divider 2024-09-20 22:02:21 -07:00
Mitchell Hashimoto
0e1258b7fe macos: pointer style uses macOS 15 helpers 2024-09-20 22:02:21 -07:00
Mitchell Hashimoto
e89a4f7408 macos: use macOS 15 pointerVisibility to show/hide cursor 2024-09-20 22:02:20 -07:00
Mitchell Hashimoto
c6bbdfb7bf macos: remove EventSinkHostingView
This was breaking various other features:

  - Popovers stopped working
  - Split divider drag gestures stopped working

For now we document the top part of the window is draggable... we
can look into removing that limitation later.
2024-09-20 22:01:01 -07:00
Mitchell Hashimoto
2c44e20860 macos: EventSinkHostingView must not override mouse events
This breaks split resizing. Removing this doesn't seem to have negative
effects for hidden titlebars (which it was originally made for).
2024-09-20 21:40:30 -07:00
Mitchell Hashimoto
44e39326b3 Merge pull request #2276 from qwerasd205/macos-titlebar-hidden
macOS: add `macos-titlebar-style = hidden`
2024-09-20 20:50:27 -07:00
Mitchell Hashimoto
578aaa1ba6 macos: DraggableWindowView helper (unused currently) 2024-09-20 20:45:27 -07:00
Qwerasd
16919488da macOS: add macos-titlebar-style = hidden
Hides titlebar without removing the other typical window frame elements
2024-09-20 16:11:51 -06:00
Mitchell Hashimoto
df24d8e1a6 macos: show clickable mouse pointer when hovering over secure input
This only works on macOS 15 because it uses the new `pointerStyle` API.
I don't have the interest to backport this to older macOS versions but
I'm happy to accept a PR if someone else wants to do it.
2024-09-20 09:56:44 -07:00
Mitchell Hashimoto
c3d6356a87 macos: show secure input overlay when it is enabled 2024-09-19 16:24:42 -07:00
pnodet
7ff9af1520 style(macos): cleanup trailing spaces 2024-08-21 21:53:09 +02:00
Łukasz Niemier
f9be02a20f chore: clean up typos 2024-08-05 13:56:57 +02:00
Mitchell Hashimoto
1d70e822c5 macos: disable macOS-only API on iOS 2024-06-30 19:03:06 -07:00
Mitchell Hashimoto
6c01d20eb7 macos: add string extension 2024-06-30 14:58:28 -07:00
Pete Schaffner
f086bff651 Make things work with really dark backgrounds
This fixes issue #1549
2024-04-02 22:28:34 +02:00
Mitchell Hashimoto
0c4800b015 macos: usingColorSpace is only available with AppKit 2024-03-26 11:39:03 -07:00
Mitchell Hashimoto
f7129880f5 macos: only set titlebar color with enough luminance to avoid #1549 2024-03-26 11:13:39 -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
Pete Schaffner
3b6bac0121 Make special blending mode class more generic
This allows us to specify what kind of context we'd like our vibrant
layer to exist in (light or dark).
2024-02-11 00:53:18 +01:00
Pete Schaffner
95c8541efd Color the new tab button image appropriately 2024-02-08 17:46:16 +01:00
Pete Schaffner
8831c601a4 Use draw rect to do the "plus darker" blending
This is a lot simpler and doesn't require adding Obj-C into the mix.
2024-02-08 16:38:07 +01:00
Pete Schaffner
40cfa1abd4 Add CALayer subclass for use in titlebar tabs
It uses a private compositing filter to match what the sytem does to
color unselected tabs in the window's tab bar (specifically with a
light appearance).
2024-02-08 10:10:40 +01:00
Pete Schaffner
93fb852d9b Add comments/docs and make method name clearer 2024-02-07 21:44:44 +01:00
Pete Schaffner
591c05641b Use shallow search to improve performance 2024-02-07 21:39:36 +01:00
Pete Schaffner
e00197c1bd Add extensions to help finding private subviews 2024-02-07 11:10:43 +01:00
Mitchell Hashimoto
da61f0797e Merge pull request #1457 from qwerasd205/macos-fix-fullscreen-separator
fix(macOS): Hide titlebar separator line in native fullscreen.
2024-02-04 13:39:16 -08:00
Qwerasd
7f217fc326 fix(macOS): Hide titlebar separator line in native fullscreen. 2024-02-04 14:22:44 -05:00
Qwerasd
181d64338d fix(macOS): Restore titlebar tabs when exiting non-native fullscreen 2024-02-03 20:03:34 -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
d625e9d7c4 macos: remove headers
Nothing personal, I remove them from all files.
2024-01-29 21:33:08 -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
487c22011c macos: make SurfaceView cross-platform! 2024-01-18 19:28:36 -08:00
Gregory Anders
e4d8ddb3d5 macos: respect minimum split size when using resize keys 2024-01-15 10:05:53 -06: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
2390668834 macos: encode surface tree in state restore 2023-12-23 13:15:46 -08:00
Thorsten Ball
ae9d7fc76a macOS: only unhide manu in non-native FS if focus lost to Ghostty
This fixes #786 by adding a check to the callback that unhides the menu
bar to only unhide the menu bar if focus was lost to another Ghostty
window.

That's the desired behaviour: when focus is lost to another app's
window, we want the non-native-fullscreen window to stay unchanged in
background, but when changing focus to another Ghostty window, we want
to unhide the menu bar.

Why did this problem even show up?

It started to show up with the introduction of the Xib-file based
approach, in 3018377.

Before that, in 27ddc90, for example, the app would receive the same
notifications, but the `.autoHideMenuBar` didn't have an effect on the
window. Only after adding the Xib-file did it start to have an effect.

So I figured there's two ways we could fix it:

1. Figure out why the `.autoHideMenuBar` now works with Xib-files and
   suppress it, or
2. Encode in the code the behaviour that we actually want: we only want
   to show the menu bar when focus shifts to another one of Ghostty's
   windows, but we want to leave it untouched when focus is lost to
   another app's window.

I went with (2) but I think (1) is also valid and happy to close PR if
that's what we want to do.
2023-11-11 07:41:12 +01:00
Gregory Anders
dc7c313166 macos: pass split as a binding to SplitView
Fixes: https://github.com/mitchellh/ghostty/issues/833
2023-11-07 11:55:29 -06:00
Mitchell Hashimoto
1ff0573518 macos: use normal swiftui parameters for resizable publisher/inc 2023-11-06 09:06:20 -08:00
Gregory Anders
9b14398153 macos: support resizing splits 2023-11-05 20:42:59 -06:00
Mitchell Hashimoto
b8a24e8bba macos: toggle fullscreen 2023-10-30 09:19:13 -07:00
Mitchell Hashimoto
981efb11db macos: add HostingWindow helper 2023-10-30 09:06:23 -07:00
Gregory Anders
2ee80a52df macos: set window resizeIncrements when cell size changes
The resizeIncrements property is only modified when the cell size of the
focused window changes. If two splits have the same cell size then the
property is not modified when focusing between the two splits.
2023-10-26 20:27:58 -05:00
Mitchell Hashimoto
f15aaf3b9e macos: use a MTKView subclass for the inspector 2023-10-24 15:27:14 -07:00
Mitchell Hashimoto
69cc6d11dc macos: MetalView, render an MTKView 2023-10-24 15:27:14 -07:00
Mitchell Hashimoto
f386f12e8a macos: safeAreaInsets.top includes menu 2023-09-29 12:05:24 -07:00