303 Commits

Author SHA1 Message Date
Mitchell Hashimoto
75b8dc19d4 Merge pull request #2430 from ghostty-org/push-qqxqmpquyyut
macos: retry focusing the quick terminal to handle focus on other screen
2024-10-09 15:25:55 -07:00
Mitchell Hashimoto
94d30eaea3 macos: retry focusing the quick terminal to handle focus on other screen
Fixes #2409

This is one of the weirder macOS quirks (bugs? who knows!) I've seen
recently. The bug as described in #2409: when you have at least two
monitors ("screens" in AppKit parlance), Ghostty on one, a focused app
on the other, and you toggle the quick terminal, the quick terminal
does not have focus.

We already knew and accounted for the fact that
`window.makeKeyAndOrderFront(nil)` does not work until the window is visible
and on the target screen. To do this, we only called this once the
animation was complete. For the same NSScreen, this works, but for
another screen, it does not.

Using one DispatchQueue.async tick also does not work. Based on testing,
it takes anywhere from 2 to 5 ticks to get the window focus API to work
properly. Okay.

The solution I came up with here is to retry the focus operation every
25ms up to 250ms. This has worked consistently for me within the first 5
ticks but it is obviously a hack so I'm not sure if this is all right.

This fixes the issue but if there's a better way to do this, I'm all
ears!
2024-10-09 15:13:54 -07:00
Mitchell Hashimoto
eec77e271c macos: change our minimum version to macOS 13
macOS 12 is officially EOL by Apple and the project only supports
officially supported versions of macOS. Once publicly released, users on
older macOS versions will have to use older released builds.
2024-10-09 14:41:57 -07:00
Mitchell Hashimoto
a2ba7b4948 macos: don't swallow flagsChanged events, breaks system bindings
Fixes #2419
2024-10-09 10:17:39 -07:00
Mitchell Hashimoto
163e6cccca macos: quick terminal window blur settings take effect properly
Fixes #2410
2024-10-07 14:58:47 -10:00
Mitchell Hashimoto
715df3f263 macos: global keybind event tap only handles events when app is inactive
Fixes #2403
2024-10-07 05:46:16 -10:00
Mitchell Hashimoto
e3dd0edc4f macos: use local event listener to propagate modifier changes to all
Related to #1547

Concretely, if you are highlighting a link and then release the
modifier, the other surfaces will be notified of this change.
2024-10-05 10:33:15 -10:00
Mitchell Hashimoto
78b9636d15 macos: apply background opacity to quick terminal
Fixes #2331
2024-09-30 21:18:47 -07:00
Mitchell Hashimoto
46cbe59076 macos: quick terminal supports fullscreen
Fixes #2330

The quick terminal now supports fullscreen. The fullscreen mode is
always non-native due to the quick terminal being a titleless, floating
window.

When the quick terminal loses focus and animates out, it will always
exit fullscreen mode.
2024-09-30 21:07:16 -07:00
Mitchell Hashimoto
7a5a9c2a58 macos: quick terminal app activation tweaks to avoid bringing up other windows
Fixes #2336

The comments explain the issues here.
2024-09-30 20:45:54 -07:00
Mitchell Hashimoto
408c33e174 macos: handle non-native fullscreen changing screens 2024-09-30 14:14:01 -07:00
Mitchell Hashimoto
045ecacd8c macos: fullscreen mode can be changed at runtime 2024-09-30 10:31:11 -07:00
Mitchell Hashimoto
5f9d4f9733 macos: fullscreen=true with non-native fullscreen works
Fixes #1377
2024-09-30 10:02:50 -07:00
Mitchell Hashimoto
718fa6042c macos: new fullscreen implementation 2024-09-30 09:42:46 -07:00
Mitchell Hashimoto
332e1a1494 macos: new FullscreenMode/Style architecture for fullscreen impls 2024-09-29 21:31:58 -07:00
Mitchell Hashimoto
19012cb6f5 macos: quick terminal restores focus to previous application 2024-09-29 15:33:12 -07:00
Mitchell Hashimoto
c70e0b2634 macos: use orderOut which handles all of our focus logic for us 2024-09-29 15:06:54 -07:00
Mitchell Hashimoto
c8a40a7791 macos: quick terminal close focuses next window on same screen/space
Previously, we'd find the next Ghostty window anywhere. Now we find the
one on the same screen/space to avoid moving the focus to a different screen.
2024-09-29 14:56:03 -07:00
Mitchell Hashimoto
83505bb4c0 macos: ensure quick terminal becomes key and focused after animation in 2024-09-29 10:44:16 -07:00
Mitchell Hashimoto
e47e7a8b8b macos: quick terminal always brings Ghostty to the front 2024-09-29 09:31:56 -07:00
Mitchell Hashimoto
4f9d49b380 macos: handle multiple monitors properly 2024-09-28 20:52:22 -07:00
Mitchell Hashimoto
76a2041cbf macos: make quick terminal animation 0.2 instead of 0.3 2024-09-28 19:11:40 -07:00
Mitchell Hashimoto
1d727320b4 macos: if initializing new surface tree, move focus to it 2024-09-28 19:11:16 -07:00
Mitchell Hashimoto
61dd395251 macos: show alert if new tab is attempted from quick term 2024-09-28 18:46:52 -07:00
Mitchell Hashimoto
11d5ec7dc1 config: support quick terminal position 2024-09-28 18:42:25 -07:00
Mitchell Hashimoto
13eb8ac6e2 macos: ability to interrupt animation, track it in menu 2024-09-28 15:29:57 -07:00
Mitchell Hashimoto
1570ef01a7 rename slide to quick terminal 2024-09-28 15:20:35 -07:00
Mitchell Hashimoto
e3b340c6d3 macos: set initial terminal dimensions 2024-09-28 15:08:27 -07:00
Mitchell Hashimoto
1977e220f5 macos: slide terminal exit and close window don't kill the window 2024-09-28 10:51:40 -07:00
Mitchell Hashimoto
50fb7331af macos: base class for terminal controller 2024-09-28 10:41:51 -07:00
Mitchell Hashimoto
bdc2c02f23 macos: when sliding out the terminal, cycle focus 2024-09-27 18:36:06 -07:00
Mitchell Hashimoto
cadb960ef9 core: slide terminal keybinding action 2024-09-27 18:36:06 -07:00
Mitchell Hashimoto
d18e1c879b macos: restrict resizing based on sliding terminal position 2024-09-27 18:36:06 -07:00
Mitchell Hashimoto
63456d28a5 macos: make sliding logic a bit more extensible 2024-09-27 18:36:06 -07:00
Mitchell Hashimoto
bdd0070ffd macos: render a terminal in the slide window 2024-09-27 18:36:06 -07:00
Mitchell Hashimoto
93b2fe60f8 macos: start work on SlideTerminal, slides in window from top 2024-09-27 18:36:06 -07:00
Mitchell Hashimoto
7befb5a418 macos: fix previous/next tab bindings, improve action logging 2024-09-27 12:24:11 -07:00
Mitchell Hashimoto
4ae20212bf libghostty: unified action dispatch
First, this commit modifies libghostty to use a single unified action
dispatch system based on a tagged union versus the one-off callback
system that was previously in place. This change simplifies the code on
both the core and consumer sides of the library. Importantly, as we
introduce new actions, we can now maintain ABI compatibility so long as
our union size does not change (something I don't promise yet).

Second, this moves a lot more of the functions call on a surface into
the action system. This affects all apprts and continues the previous
work of introducing a more unified API for optional surface features.
2024-09-26 22:00:11 -07:00
Mitchell Hashimoto
1b31663865 apprt/embedded: new_window can be called without a parent 2024-09-24 18:33:10 -07:00
Mitchell Hashimoto
689ee0f385 typos 2024-09-24 16:38:42 -07:00
Mitchell Hashimoto
ed7ac8aa21 macos: better enable timing depending on process launch time 2024-09-24 16:38:17 -07:00
Mitchell Hashimoto
1ad904478d Tap events, core API to handle global keybinds 2024-09-24 16:29:02 -07:00
Mitchell Hashimoto
f9bd009ce5 macos: unhide cursor on clipboard confirmation 2024-09-21 09:59:40 -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
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
Mitchell Hashimoto
962aa49a45 macos: remove nstitlecontainerview hidden 2024-09-20 19:18:01 -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