10108 Commits

Author SHA1 Message Date
Tristan Partin
e7cbb7fd16 gtk: update ResizeOverlay for zig-gobject (#5941)
Also switch to a "DerivedConfig" model so that we aren't referring to a
global copy of the config.
2025-02-22 20:07:20 -06:00
Jeffrey C. Ollie
bdf0f27d1a gtk: fix the alignment of the context menu (#5943)
This aligns the top left of the context menu with the right-click
location, rather than the top center.
2025-02-22 18:37:41 -06:00
Jeffrey C. Ollie
0af256b57a gtk: fix the alignment of the context menu
This aligns the top left of the context menu with the right-click
location, rather than the top center.
2025-02-22 18:23:30 -06:00
taylrfnt
398add17f1 actually change it in both places 2025-02-22 18:00:37 -06:00
taylrfnt
eec150d4cd mention default loc precendence over XDG 2025-02-22 17:58:05 -06:00
taylrfnt
573fe7348b add macos default config path to manpages 2025-02-22 17:46:30 -06:00
Jeffrey C. Ollie
f1134640c5 gtk: update ResizeOverlay for zig-gobject
Also switch to a "DerivedConfig" model so that we aren't referring to a
global copy of the config.
2025-02-22 17:42:09 -06:00
Jeffrey C. Ollie
5131f8a71c GTK: propagate config updates to the GTK apprt surfaces (#5866)
This will be needed to the convert GTK apprt surfaces to a DerivedConfig
model rather than accessing the global config stored in the app. It's a
no-op for now, but I have a PR in the works to update the resize overlay
that will take advantage of this.
2025-02-22 17:19:13 -06:00
Jeffrey C. Ollie
867982a2ff Gtk: change title prompt (#5905)
This PR implements the title change functionality for the GTK app and
closes https://github.com/ghostty-org/ghostty/issues/5769

Demo:


https://github.com/user-attachments/assets/cad611b3-b7bf-40ac-8d0f-11d2095fe525

For now I came up with a basic UI that i believe is sufficient, but I'm
open to feedback and happy to iterate on it further.

https://github.com/ghostty-org/ghostty/issues/5769#issuecomment-2660341107
- Regarding Mitchell's comment I checked Gnome Console and I could not
find a similar feature.
2025-02-22 17:00:40 -06:00
Jeffrey C. Ollie
bde5b963d0 gtk: fix Builder api changes 2025-02-22 16:39:12 -06:00
Maciej Bartczak
5d80db2ef8 code review: fix log format 2025-02-22 16:39:12 -06:00
Jeffrey C. Ollie
32a62ff862 snap: add libxml2-utils (for xmllint) to snap 2025-02-22 16:33:22 -06:00
Jeffrey C. Ollie
d4bcac0150 snap: add blueprint-compiler to snap 2025-02-22 16:33:22 -06:00
Jeffrey C. Ollie
51dc1e2e8c gtk: fix typos 2025-02-22 16:33:22 -06:00
Jeffrey C. Ollie
4f3c4037aa gtk: get 'Change Title' working with older distros 2025-02-22 16:33:20 -06:00
Maciej Bartczak
7c19dd5a33 format the blueprint file using blueprint-compiler format 2025-02-22 16:32:52 -06:00
Maciej Bartczak
8758295647 code review:
- move responses definition to the blueprint, use translatable strings
- minor changes in the response callback
2025-02-22 16:32:52 -06:00
Maciej Bartczak
1ee8dfc99c code review:
- remove unnecessary @ptrCast
- set the default focus to the text entry field
2025-02-22 16:32:52 -06:00
Maciej Bartczak
cd287b4161 - remove the unused dialog context struct
- set the current title in the input buffer
- fix formatting
2025-02-22 16:32:50 -06:00
Maciej Bartczak
454a53b3f1 code review:
- remove the menu entry defined in code
2025-02-22 16:32:23 -06:00
Maciej Bartczak
6189f5d09e code review:
- use blueprint for the dialog content
- use zig-gobject bindings
- make the enum values lowercase
2025-02-22 16:31:32 -06:00
Maciej Bartczak
dcd17c6ac4 set the ok widget to be activated by default 2025-02-22 16:30:57 -06:00
Maciej Bartczak
3542778d84 free the terminal title when destroy is run 2025-02-22 16:30:57 -06:00
Maciej Bartczak
95fc5ad1e9 remove outdated comment 2025-02-22 16:30:57 -06:00
Maciej Bartczak
cc9c45de2a fix the edge case when user tries to revert the title to default and hasn't set a title before 2025-02-22 16:30:57 -06:00
Maciej Bartczak
5e9908af27 make the change of the title persistent & allow the user to restore to a default one 2025-02-22 16:30:56 -06:00
Maciej Bartczak
6b75ca40ca Implement a prompt that allows the user to set the title 2025-02-22 16:30:55 -06:00
Jeffrey C. Ollie
3f715c296a gtk: update menus to use popovers and builder ui files (#5781)
Menus (context menus and the window hamburger menu) now use popovers and
are defined using GTK builder UI files. This is a bit more "modern" and
reduces the amount of code to define menus.
2025-02-22 14:54:06 -06:00
Mitchell Hashimoto
e307f1a373 Allow whitespace in ColorList values (#5925)
The following formats are now all valid:

```zig
macos-icon-screen-color = #00FF00,#FF1000,#00FFFF
macos-icon-screen-color = #00FF00, #FF1000, #00FFFF
macos-icon-screen-color = #00FF00 ,#FF1000 ,#00FFFF
macos-icon-screen-color =  #00FF00 , #FF1000  , #00FFFF
```

Fixes #5918
2025-02-22 12:18:54 -08:00
Mitchell Hashimoto
726ac36612 Add support for whitespace in color and palette parsing (#5926)
Resolves #5921
2025-02-22 07:25:18 -08:00
Mitchell Hashimoto
ce62b5cc5e Clarify configuration of macos-icon-screen-color's gradient (#5923)
From #5863, cc @vollink.

I'm not sure what the hard-wrap limit for comments is (70?), so I've
tried to match the paragraph I've edited.
2025-02-22 07:13:08 -08:00
Bryan Lee
1b6b029e0d Add test cases for whitespace handling for ColorList 2025-02-22 22:11:35 +08:00
Bryan Lee
2383e4d90d Add support for whitespace in color and palette parsing 2025-02-22 22:05:05 +08:00
Bryan Lee
7c6375f744 Allow whitespace after commas in ColorList values 2025-02-22 20:53:27 +08:00
Kat
6770ad3736 Clarify configuration of macos-icon-screen-color's gradient. 2025-02-22 17:14:08 +11:00
Ronit Gandhi
a262da92bf using only note instead of both for docs. 2025-02-22 10:49:27 +05:30
Mitchell Hashimoto
870b74f4da macOS: Fix new window focus when created from quick terminal (#5834)
## Root Cause

The issue has two aspects:

1. The window creation process didn't explicitly force focus on the new
window after showing it.
2. More fundamentally, we were relying on `NSApp.isActive` to determine
whether to activate the application, which is problematic because:
- When creating a window from quick terminal, the application is already
"active" but this active state is owned by the quick terminal
- The [`NSApp.isActive`
check](4cfe5522db/macos/Sources/Features/Terminal/TerminalManager.swift (L100))
doesn't accurately reflect our intent - creating a new window is an
explicit user action that should always result in that window gaining
focus

## Solution

Removing the `NSApp.isActive` check.

```swift
// Before
if !NSApp.isActive {
    NSApp.activate(ignoringOtherApps: true)
}

// After
NSApp.activate(ignoringOtherApps: true)
```

Fixes #5688
2025-02-21 15:50:00 -08:00
Mitchell Hashimoto
c1fb9a33f7 Fix barely visible new tab button on macOS (#5897)
Resolve #5894 and #4288
2025-02-21 15:47:33 -08:00
Aaron Ruan
4291e1c5d7 fix: use surfaceConfig.backgroundColor to determine if the theme is light or dark
Signed-off-by: Aaron Ruan <i@ar212.com>
2025-02-21 15:32:24 -08:00
Mitchell Hashimoto
b5ecd7b6be Update libxev to use dynamic backend, support Linux configurability (#5916)
Related to #3224

Previously, Ghostty used a static API for async event handling: io_uring
on Linux, kqueue on macOS. This commit changes the backend to be dynamic
on Linux so that epoll will be used if io_uring isn't available, or if
the user explicitly chooses it.

This introduces a new config `async-backend` (default "auto") which can
be set by the user to change the async backend in use. This is a
best-effort setting: if the user requests io_uring but it isn't
available, Ghostty will fall back to something that is and that choice
is up to us.

Basic benchmarking both in libxev and Ghostty (vtebench) show no
noticeable performance differences introducing the dynamic API, nor
choosing epoll over io_uring.

For platforms that don't have multiple choices (currently macOS), the
dynamic API is literally the static API so there should be no
performance or behavioral changes whatsoever.
2025-02-21 15:18:59 -08:00
Mitchell Hashimoto
d532a6e260 Update libxev to use dynamic backend, support Linux configurability
Related to #3224

Previously, Ghostty used a static API for async event handling: io_uring
on Linux, kqueue on macOS. This commit changes the backend to be dynamic
on Linux so that epoll will be used if io_uring isn't available, or if
the user explicitly chooses it.

This introduces a new config `async-backend` (default "auto") which can
be set by the user to change the async backend in use. This is a
best-effort setting: if the user requests io_uring but it isn't
available, Ghostty will fall back to something that is and that choice
is up to us.

Basic benchmarking both in libxev and Ghostty (vtebench) show no
noticeable performance differences introducing the dynamic API, nor
choosing epoll over io_uring.
2025-02-21 15:04:37 -08:00
Jeffrey C. Ollie
2697061e5b gtk: fix comment in Window.updateConfig 2025-02-18 23:28:10 -06:00
Jeffrey C. Ollie
d1fa933006 gtk: forward config updates to GTK apprt surfaces 2025-02-18 23:18:47 -06:00
Jeffrey C. Ollie
2d5a07c795 gtk: fix build on debian 12 2025-02-18 17:10:54 -06:00
Jeffrey C. Ollie
b3f994a9d2 gtk: use builder ui files and popovers for menus 2025-02-18 17:10:51 -06:00
Jeffrey C. Ollie
38908e0126 gtk: apply all window appearance changes in syncAppearance (#5404)
The GTK side of appearance code is kind of a mess with several different
functions all having the responsibility of interacting with each other
and setting the appropriate window appearance. It should solely be the
responsibility of the `syncAppearance` function to apply appearance
changes, with other callbacks/functions calling it instead: much like
what we already do for the macOS apprt.

~~I also took the time to refactor the libadwaita version checks since
calling `versionAtLeast(0, 0, 0)` does get old after a while. Now almost
all checks are given human-readable names and contributors need not
memorize what the relevant version checks all are.~~ Moved to another PR
2025-02-18 16:36:07 -06:00
Leah Amelia Chen
8eaa901aec config: update reload ability information for several keys
Several keys are now able to affect existing windows (especially
window-decoration, whose config documentation got a greater overhaul)
2025-02-18 10:09:41 +01:00
Leah Amelia Chen
aa2dbe2919 gtk: apply all window appearance changes in syncAppearance
The GTK side of appearance code is kind of a mess with several different
functions all having the responsibility of interacting with each other
and setting the appropriate window appearance. It should solely be the
responsibility of the `syncAppearance` function to apply appearance
changes, with other callbacks/functions calling it instead: much like
what we already do for the macOS apprt.
2025-02-18 10:09:41 +01:00
Bryan Lee
c9f8732e5c Fix new window focus when quick terminal is open 2025-02-18 10:50:01 +08:00
Jeffrey C. Ollie
da32534e8a gtk: fix closing window when last tab is closed (#5837)
Causes windows to not close and leave behind a "corpse" if they are not
the last window or we are running in single instance mode.

![image](https://github.com/user-attachments/assets/5f6860c2-7807-4ff1-9cad-d32dd4bc348b)
2025-02-17 11:37:51 -06:00