10973 Commits

Author SHA1 Message Date
azhn
46b86570f2 deps: Enable building gtk4-layer-shell without system integration 2025-06-28 19:02:30 +10:00
azhn
33e07c87c9 deps: Default gtk4-layer-shell system integration to true
We default system-integration to true as this is a shared library that
must be installed on a library path and it is recommended to use the
system package.

If the system does not package gtk4-layer-shell then doing `zig build
-fno-sys` will now correctly build and install the shared library under
a lib/ subdirectory of the output prefix.

The output prefix should be a default library path (`/lib`, `/usr/lib`,
or a lib64 variant) otherwise a custom library path can be configured
using ldconfig (see `man ld.so 8`)
2025-06-28 19:01:26 +10:00
Daniel Wennberg
4ae75cc868 Don't pass arena allocator to os.open 2025-06-28 00:21:38 -07:00
Islam Sharabash
22a624e560 Equalize splits based on children oriented in the same direction
This changes equalization so it only counts children oriented in the
same direction.

This makes splits a bit more aesthetic, and replicates how split
equalization works in neovim.
2025-06-28 09:01:41 +02:00
Mitchell Hashimoto
206d41844e terminal: fix unexpected line wrapping in tests (#7709)
These tests write specific lines into a 10-column-wide test screen. The
"prompt3$ input3\n" writes exceed that column limit, and some of their
characters wrap onto the following line.

These tests' current assertions aren't sensitive to that overflow, but I
spotted the problem while doing some related work, and I thought it
worth making these corrections to avoid any future surprises.
2025-06-27 19:43:12 -07:00
Jon Parise
138f74524e terminal: fix unexpected line wrapping in tests
These tests write specific lines into a 10-column-wide test screen. The
"prompt3$ input3\n" writes exceed that column limit, and some of their
characters wrap onto the following line.

These tests' current assertions aren't sensitive to that overflow, but
I spotted the problem while doing some related work, and I thought it
worth making these corrections to avoid any future surprises.
2025-06-27 22:34:46 -04:00
Mitchell Hashimoto
98b1af8353 Move child exit handling logic to apprt thread (#7705)
Fixes #7500
Supersedes #7582

This commit moves the child exit handling logic from the IO thead to the
apprt thread. The IO thread now only sends a `child_exited` message to
the apprt thread with metadata about the exit conditions (exit code,
runtime).

From there, the apprt thread can handle the exit situation however is
necessary. This commit doesn't change the behavior but it does fix the
issue #7500. The behavior is: exit immediately, show abnormal exit
message, wait for user input, etc.

This also gets us closer to #7649.
2025-06-27 10:51:55 -07:00
Mitchell Hashimoto
591ef0f40f Move child exit handling logic to apprt thread
Fixes #7500
Supersedes #7582

This commit moves the child exit handling logic from the IO thead to the
apprt thread. The IO thread now only sends a `child_exited` message to
the apprt thread with metadata about the exit conditions (exit code,
runtime).

From there, the apprt thread can handle the exit situation however is
necessary. This commit doesn't change the behavior but it does fix the
issue #7500. The behavior is: exit immediately, show abnormal exit
message, wait for user input, etc.

This also gets us closer to #7649.
2025-06-27 10:36:23 -07:00
Mitchell Hashimoto
2775792b20 core: only update selection clipboard on left mouse release (#7704)
Fixes #4800, supercedes #5995

This is a rewrite of #5995 (though the solution is mostly the same since
this is pretty straightforward). The main difference is the rebase on
the new mouse handling we've had since, and I also continue to update
the selection clipboard on non-left-mouse events.
2025-06-27 09:45:52 -07:00
Mitchell Hashimoto
52354b8bec core: only update selection clipboard on left mouse release
Fixes #4800, supercedes #5995

This is a rewrite of #5995 (though the solution is mostly the same since
this is pretty straightforward). The main difference is the rebase on
the new mouse handling we've had since, and I also continue to update
the selection clipboard on non-left-mouse events.
2025-06-27 09:40:37 -07:00
Mitchell Hashimoto
4b5ccf79a5 fix compilation issue, tests should've caught this but GHA failed 2025-06-27 09:16:00 -07:00
Mitchell Hashimoto
240c9b8afc gtk: add option to always display the tab bar (#5590)
Also fixes crashes in both vanilla GTK and Adwaita implementations of
`closeTab`, which erroneously close windows twice when there are no more
tabs left (we probably already handle it somewhere else).
2025-06-27 09:14:13 -07:00
Mitchell Hashimoto
331769bc6b core: don't copy App and apprt.App (#5509)
Besides avoiding copying, this allows consumers to choose to allocate
these structs on the stack or to allocate on the heap. It also gives the
apprt.App a stable pointer sooner in the process.
2025-06-27 09:13:54 -07:00
Mitchell Hashimoto
83690744b2 reintroduce App.create 2025-06-27 09:12:20 -07:00
Jeffrey C. Ollie
1979fb92f4 embedded: fix core app init 2025-06-27 09:05:32 -07:00
Jeffrey C. Ollie
3c49d87751 fix order of defer 2025-06-27 09:05:32 -07:00
Jeffrey C. Ollie
c6f23bbb32 core: con't copy App and apprt.App
Besides avoiding copying, this allows consumers to choose to allocate
these structs on the stack or to allocate on the heap. It also gives the
apprt.App a stable pointer sooner in the process.
2025-06-27 09:05:32 -07:00
Mitchell Hashimoto
070e017b1b Update CODEOWNERS for localization managers (#7701) 2025-06-27 06:59:37 -07:00
Mitchell Hashimoto
937b10b422 Update CODEOWNERS for localization managers 2025-06-27 06:58:15 -07:00
Qwerasd
979d72056b OpenGL: Fix Custom Shaders (#7697)
Ref: GitHub Discussion #7696 

See commit messages for details.
2025-06-26 17:19:19 -06:00
Qwerasd
d6db3013be renderer/OpenGL: switch image texture from Rect to 2D
We were using the Rectangle target for simpler addressing, since that
allows for pixel coordinates instead of normalized coordinates, but
there are downsides to rectangle textures, including not supporting
compressed texture formats, and we do probably want to use compressed
formats in the future, so I'm making this change now.
2025-06-26 16:38:19 -06:00
Qwerasd
810ab6a844 renderer/OpenGL: revert change to compressed texture format
This was applied to the wrong thing by accident, making the custom
shader ping-pong textures compressed, which breaks custom shaders
because compressed texture formats are not color renderable.

Additionally, I've not switched the compressed format to the correct
texture options, because I tried that and it turns out that the default
compression applied by drivers can't be trusted to be good quality and
generally speaking looks terrible. In the future we can explore doing
the compression ourselves CPU-side with something like b7enc_rdo.
2025-06-26 16:34:51 -06:00
Mitchell Hashimoto
6d6dcf863a Correct AppStream metainfo XML, broken trailing tags 2025-06-26 13:37:20 -07:00
Mitchell Hashimoto
c12b280782 dbus and systemd activation - take 2 (#7679)
This replaces #7433. The improvements are:

1) Install the systemd user service in the proper directory depending on
if it's a 'user' install or a 'system' install. This is controlled
either by using the `--system` build flag (as most packages will) or by
the `-Dsystem-package` flag.

2) Add the absolute path to the `ghostty` binary in the application
file, the DBus service, and the systemd user service. This is done so
that they do not depend on `ghostty` being in the `PATH` of whatever is
launching Ghostty. That `PATH` is not necessarily the same as the `PATH`
in a user shell (especially for DBus activation and systemd user
services).

3) Adjust the DBus bus name that is expected by the system depending on
the optimization level that Ghostty is compiled with.
2025-06-26 13:31:29 -07:00
Mitchell Hashimoto
d92d1cac2a remove unused TODO.md 2025-06-26 13:16:55 -07:00
Mitchell Hashimoto
3d01bb43cc terminal/Screen: account for rectangle selection in clone (#7692)
Fixes an issue where rectangle selections would appear visually wrong if
their start or end were out of the viewport area, because when cloning
them the restored pins were defaulting to the start and end of the row
instead of the appropriate column.

This issue is shown in discussion #7687.
2025-06-26 13:15:48 -07:00
Mitchell Hashimoto
b4e81949ee wrong service name for dbus systemd service 2025-06-26 13:12:05 -07:00
Mitchell Hashimoto
77654eb01c use tail to clear the first line of the template 2025-06-26 13:07:41 -07:00
Mitchell Hashimoto
739b691a6d use cmake formatting to template, avoids the custom binary 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
73d5eb928c fix up formatting of desktop_template.zig 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
8a95212197 fix up the name in the metainfo when templating 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
fa4f420768 replace sed with a simple Zig program for templating desktop files 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
eb5a488b57 clean up duplicated code in installation of desktop services 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
9c95ce28ae drop system-package option 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
cf561fcc55 rename templated files with .in suffix 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
b68f9f2321 make sure that the desktop file uses the absolute path everywhere 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
ddada2fb3f flatpak: remove references to systemd unit
Replaces #7676

When building as a flatpak, don't install the systemd user services
since flatpaks can't use them. Remove references to the systemd service
from the DBus service.

Also, customize the app metadata depending on the debug mode.

Co-authored-by: Leorize <leorize+oss@disroot.org>
2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
81403f59ce dbus and systemd activation - take 2
This replaces #7433. The improvements are:

1) Install the systemd user service in the proper directory depending
on if it's a 'user' install or a 'system' install. This is controlled
either by using the `--system` build flag (as most packages will) or by
the `-Dsystem-package` flag.

2) Add the absolute path to the `ghostty` binary in the application
file, the DBus service, and the systemd user service. This is done so
that they do not depend on `ghostty` being in the `PATH` of whatever
is launching Ghostty. That `PATH` is not necessarily the same as the
`PATH` in a user shell (especially for DBus activation and systemd user
services).

3) Adjust the DBus bus name that is expected by the system depending on
the optimization level that Ghostty is compiled with.
2025-06-26 10:28:46 -07:00
Qwerasd
f7ee6b3bda terminal/Screen: clean up selection remap in clone
Cleans up the logic, checks for out of bounds using rows instead of
sel.contains because that excludes cases where a rectangle selection
doesn't include the leftmost column.

Also adds test for clipping behavior of rectangular selections.
2025-06-26 11:26:03 -06:00
Qwerasd
360124ded0 terminal/Screen: account for rectangle selection in clone
Fixes an issue where rectangle selections would appear visually wrong if
their start or end were out of the viewport area, because when cloning
them the restored pins were defaulting to the start and end of the row
instead of the appropriate column.
2025-06-25 23:16:43 -06:00
Mitchell Hashimoto
fa47db5363 config: add command-palette-entry config option (#7688)
Implements #7158 for GTK
2025-06-25 16:48:10 -04:00
Mitchell Hashimoto
9eec80e038 Terminal Background Image Support (#7686)
Adds support for background images via the `background-image` config.

Resolves #3645, supersedes PRs #4226 and #5233.

See docs of added config keys for usage details.

> [!NOTE]
> Unlike what is implied by the original issue, because this is
implemented in the renderer it is inherently per-surface not per-window,
meaning a window with a split will have two copies of the background
image.

### Future work
- We should probably introduce code in the apprts that tells surfaces
their position and size relative to the window, which would allow us to
add a `background-image-area` config with options for `surface` and
`window` to control that behavior (and probably default it to `window`).
That apprt code would also allow for window-relative custom shader
locations, which is also a fairly common user request, so I think it's
worth it.
- Currently if you use a high res background image this is fairly
inefficient, since each surface independently loads a copy of the
background image. On systems with limited VRAM this could be an issue
for users who use a lot of surfaces, so it may be worth making a shared
image cache to avoid this problem.
- ~~It's probably worth using compressed texture formats for images,
I'll look in to doing that.~~ (c43702c)
2025-06-25 16:45:40 -04:00
Mitchell Hashimoto
a8091fedf3 fix tests 2025-06-25 16:28:31 -04:00
Mitchell Hashimoto
6c2ea8637e config: add more docs for background-image 2025-06-25 16:27:23 -04:00
Qwerasd
5cb175ff63 renderer/OpenGL: use compressed texture formats for images
BPTC is required to be available OpenGL >= 4.2 and our minimum is 4.3 so
this is safe in terms of support. I tested briefly in a VM and didn't
encounter any problems so this should just be a complete win.

(Note: texture data is already automatically compressed on Metal)
2025-06-25 16:27:23 -04:00
Qwerasd
da46a47726 renderer: add support for background images
Adds support for background images via the `background-image` config.

Resolves #3645, supersedes PRs #4226 and #5233.

See docs of added config keys for usage details.
2025-06-25 16:27:23 -04:00
Qwerasd
03bdb92292 renderer: clean up image.zig, reduce repetitive code 2025-06-25 16:27:23 -04:00
Qwerasd
ca5f301eb1 util: introduce helper for detecting file types 2025-06-25 16:27:23 -04:00
Leah Amelia Chen
dbe6035da0 config: add command-palette-entry config option 2025-06-25 16:18:20 -04:00
Leah Amelia Chen
d419e5c922 gtk(command_palette): filter out more unimplemented actions 2025-06-25 16:18:20 -04:00