11347 Commits

Author SHA1 Message Date
Jayson Reis
acc2ea724f build-system: Replace deprecated usages of addStaticLibrary with addLibrary (#8029)
Hi there, this is just a low-hanging fruit and it also prepares the way
for the future 0.15, which removes addStaticLibrary.
Please, let me know what to do on the `// TODO` comments.
2025-07-22 14:47:18 -07:00
Mitchell Hashimoto
c903754b70 apprt/gtk-ng: clipboard support (#8030)
This ports over read/write clipboard to gtk-ng.

This was a surprisingly massive amount of work! The clipboard
confirmation dialog is non-trivial: it supports multiple read/write
types, blurring, remember choice, and spans multiple Adw versions. I was
able to port all of the functionality into a single
`CloseConfirmationDialog` class and make use of a good amount of
Blueprint binds to simplify some stuff.
2025-07-22 14:45:26 -07:00
Mitchell Hashimoto
04143645f2 apprt/gtk-ng: fixed missing icon for hide button 2025-07-22 14:38:36 -07:00
Mitchell Hashimoto
2855c44118 typos 2025-07-22 14:36:21 -07:00
Mitchell Hashimoto
5c21d9a123 prettier 2025-07-22 14:36:21 -07:00
Mitchell Hashimoto
7e329d3e4c apprt/gtk-ng: paste can't remember 2025-07-22 14:36:21 -07:00
Mitchell Hashimoto
4d39f2728a apprt/gtk-ng: implement remember 2025-07-22 14:36:21 -07:00
Mitchell Hashimoto
58a5f3f1f8 apprt/gtk-ng: emit signal when clipboard read/write 2025-07-22 14:36:21 -07:00
Mitchell Hashimoto
a6e0878b11 apprt/gtk-ng: hook up all the dialogs 2025-07-22 14:36:21 -07:00
Mitchell Hashimoto
b11dadafb1 apprt/gtk-ng: clipboard confirm 2025-07-22 14:36:21 -07:00
Mitchell Hashimoto
46e395055d apprt/gtk-ng: implement blur 2025-07-22 14:36:21 -07:00
Mitchell Hashimoto
222c3c888d apprt/gtk-ng: clipboard confirmation dialog 2025-07-22 14:36:21 -07:00
Mitchell Hashimoto
a91ed99054 apprt/gtk-ng: fix focus deadlock 2025-07-22 14:36:21 -07:00
Mitchell Hashimoto
a4f494e2ae apprt/gtk-ng: wip set clipboard 2025-07-22 14:36:21 -07:00
Mitchell Hashimoto
c3acbf1a49 apprt/gtk-ng: clipboard read 2025-07-22 14:36:21 -07:00
Mitchell Hashimoto
49cf8d80a6 core: use std.testing.expectEqualStrings where appropriate (#8025) 2025-07-22 13:40:25 -07:00
Jeffrey C. Ollie
cc0a688b5d core: use std.testing.expectEqualStrings where appropriate 2025-07-22 13:08:24 -05:00
Leah Amelia Chen
7eab97653d terminal/osc: allow empty payloads (#8023) 2025-07-23 02:57:04 +09:00
Leah Amelia Chen
c194f7a0cd i18n(zh_CN): update strings 2025-07-22 17:38:49 +00:00
Leah Amelia Chen
a01a40394a i18n: update translations 2025-07-22 17:25:57 +00:00
Leah Amelia Chen
a7b7c10474 gtk: only show clipboard toast when content isn't empty 2025-07-22 17:25:57 +00:00
Leah Amelia Chen
d3f40d70e2 terminal/osc: allow empty payloads
xterm docs explicitly say that empty payloads should be permitted and
are used to clear the selected clipboards, so we need to implement that
correctly. The GTK apprt still shows a "Copied to Clipboard" toast though
and we might want to change that too
2025-07-22 16:50:29 +00:00
Mitchell Hashimoto
820879d2ef apprt/gtk-ng: port surface cgroup logic (#8013)
Absolutely nothing interesting here, just porting our cgroup logic.
2025-07-21 21:24:41 -07:00
Mitchell Hashimoto
8f8f2ebd2d apprt/gtk-ng: surfaces start in cgroup if enabled 2025-07-21 21:21:09 -07:00
Mitchell Hashimoto
578fd7f7f8 apprt/gtk-ng: resize overlay (#8012)
This implements the resize overlay. This is implemented using a new
mostly generic `ResizeOverlay` class that can probably be renamed one
day to something like `TemporaryOverlay` since it is generic to show a
label with a duration.

The only user-facing change here is `after-first` behavior has been
changed in the config to actually mean "after a delay." The
`after-first` behavior has been problematic since we introduced it on
both macOS and Linux because a lot of windowing systems may perform
multiple resizes very quickly at startup (especially tiling ones) so its
less about being "first" and more about semantically only showing the
overlay for user-driven resizes. We should rename this, eventually.

The valgrind suppression file change is mostly to handle an alternate
machine, but its all the same stuff (GTK renderers, GPU drivers, etc.),
nothing new in our app code.
2025-07-21 21:05:14 -07:00
Mitchell Hashimoto
4aaacc04a5 fix logger name 2025-07-21 20:54:16 -07:00
Mitchell Hashimoto
6abb9ec427 ignore valgrind supp file for typos 2025-07-21 20:51:58 -07:00
Mitchell Hashimoto
66ce764d67 valgring supps for VMware VGA 2025-07-21 20:49:08 -07:00
Mitchell Hashimoto
9caf5f5a86 apprt/gtk-ng: ResizeOverlay class 2025-07-21 20:48:59 -07:00
Mitchell Hashimoto
c6abf65dd1 apprt/gtk-ng: resize overlay 2025-07-21 14:02:16 -07:00
Mitchell Hashimoto
e34248a2ad apprt/gtk-ng: hovered url overlay (#8010)
I was going to do more overlays but this introduced enough new
complexity that I want to PR this on its own.

Valgrind clean!
2025-07-21 14:02:10 -07:00
Mitchell Hashimoto
58ccfb558a apprt/gtk-ng: mouse over link to show tooltip 2025-07-21 12:56:03 -07:00
Mitchell Hashimoto
7711f6b5b6 apprt/gtk-ng: setup basic css resources 2025-07-21 09:58:46 -07:00
Mitchell Hashimoto
55a384e165 apprt/gtk-ng: implement quit timer, close app confirmation (#8006)
This PR tidies up our quit logic to match the GTK implementation,
respecting quit delays and also showing a confirmation dialog if
required. There shouldn't be anything surprising here, its mostly a
copy/paste of the old logic with very small tweaks to fit the new style.
2025-07-21 09:32:21 -07:00
Mitchell Hashimoto
2333815b6c apprt/gtk-ng: implement app close confirmation dialog 2025-07-21 09:06:10 -07:00
Mitchell Hashimoto
ab8717e320 apprt/gtk-ng: hook up basic quit functionality (no confirm) 2025-07-21 08:36:08 -07:00
Mitchell Hashimoto
3e83364937 apprt/gtk-ng: hook up quit timer 2025-07-21 08:36:08 -07:00
Mitchell Hashimoto
805c8601a9 apprt/gtk-ng: hook up title, pwd surface properties (#8005)
Continuing to plumb along the APIs necessary basic surface functionality
before moving onto windowing functionality. This adds title/pwd as
properties to Surface, adds abstractions necessary to manage that memory
correctly, and also adds a tiny change to renderers to make everything
slightly more usable under Valgrind.
2025-07-21 08:35:55 -07:00
Mitchell Hashimoto
7e834a1c32 apprt/gtk-ng: some actions 2025-07-21 08:15:42 -07:00
Mitchell Hashimoto
edb5f7c69d slow down our cursor timer under valgrind 2025-07-21 07:28:23 -07:00
Mitchell Hashimoto
e911d53a2e apprt/gtk-ng: get-title 2025-07-21 07:16:19 -07:00
Mitchell Hashimoto
ef686d62aa apprt/gtk-ng: clear memory properly 2025-07-21 07:08:46 -07:00
Mitchell Hashimoto
cd82a610c3 apprt/gtk-ng: abstract helper for private string fields 2025-07-21 06:55:28 -07:00
Mitchell Hashimoto
9440c775c7 apprt/gtk-ng: set title 2025-07-20 15:23:43 -07:00
Mitchell Hashimoto
793e271989 apprt/gtk-ng: set pwd 2025-07-20 15:17:03 -07:00
Mitchell Hashimoto
a88689ca75 apprt/gtk-ng: mouse shape,visibility (#7999)
Relatively simple port. A few cool things:

1. We use properties on `GhosttySurface` to set this now and standard
property listeners
2. We make `terminal.MouseShape` a GObject enum if we have gobject
available.
3. The property based approach means we don't have to manage
`*gdk.Cursor` memory anywhere anymore.

And, we're still Valgrind clean.
2025-07-20 14:53:24 -07:00
Mitchell Hashimoto
fb2021bc9f apprt/gtk-ng: correct default mouse shapes 2025-07-20 14:39:02 -07:00
Mitchell Hashimoto
4ffbd93ab5 apprt/gtk-ng: surface mouse visibility 2025-07-20 14:35:16 -07:00
Mitchell Hashimoto
ecd14a8739 apprt/gtk-ng: surface mouse shape 2025-07-20 14:35:16 -07:00
Mitchell Hashimoto
2c6d978ed5 pkg/oniguruma: fix memory leak for failed regex searches (#7998)
Found by Valgrind:

```
==265734== 320 bytes in 8 blocks are definitely lost in loss record 13,786 of 15,141
==265734==    at 0x5A65810: malloc (in /nix/store/l431jn8ahj09g5c1arrl7q6wcxngg21q-valgrind-3.24.0/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==265734==    by 0x3D799EB: onig_region_resize (.cache/zig/p/N-V-__8AAHjwMQDBXnLq3Q2QhaivE0kE2aD138vtX2Bq1g7c/src/regexec.c:923)
==265734==    by 0x3D81BCA: onig_region_resize_clear (.cache/zig/p/N-V-__8AAHjwMQDBXnLq3Q2QhaivE0kE2aD138vtX2Bq1g7c/src/regexec.c:949)
==265734==    by 0x3DA814F: search_in_range (.cache/zig/p/N-V-__8AAHjwMQDBXnLq3Q2QhaivE0kE2aD138vtX2Bq1g7c/src/regexec.c:5454)
==265734==    by 0x3DA7F25: onig_search (.cache/zig/p/N-V-__8AAHjwMQDBXnLq3Q2QhaivE0kE2aD138vtX2Bq1g7c/src/regexec.c:5414)
==265734==    by 0x382E7E8: regex.Regex.searchAdvanced (regex.zig:61)
==265734==    by 0x382E974: regex.Regex.search (regex.zig:48)
==265734==    by 0x382EC08: terminal.StringMap.SearchIterator.next (StringMap.zig:40)
==265734==    by 0x39ADDCD: renderer.link.Set.matchSetFromLinks (link.zig:320)
==265734==    by 0x39AE5C7: renderer.link.Set.matchSet (link.zig:95)
==265734==    by 0x39BCCE1: renderer.generic.Renderer(renderer.OpenGL).rebuildCells (generic.zig:2307)
==265734==    by 0x39C3BDB: renderer.generic.Renderer(renderer.OpenGL).updateFrame (generic.zig:1228)
==265734==    by 0x3993E88: renderer.Thread.renderCallback (Thread.zig:607)
==265734==    by 0x3993CFF: renderer.Thread.wakeupCallback (Thread.zig:524)
==265734==    by 0x39C522E: callback (async.zig:679)
==265734==    by 0x39C522E: watcher.async.AsyncEventFd(api.Xev(.io_uring,backend.io_uring)).waitPoll__anon_592685__struct_596870.callback (async.zig:181)
==265734==    by 0x3970EAE: backend.io_uring.Completion.invoke (io_uring.zig:804)
==265734==    by 0x3973AD8: backend.io_uring.Loop.tick___anon_586861 (io_uring.zig:193)
==265734==    by 0x3973BCD: backend.io_uring.Loop.run (io_uring.zig:84)
==265734==    by 0x3978673: dynamic.Xev(&.{ .io_uring, .epoll }[0..2]).Loop.run (dynamic.zig:172)
==265734==    by 0x3978972: renderer.Thread.threadMain_ (Thread.zig:263)
==265734==    by 0x3954580: renderer.Thread.threadMain (Thread.zig:202)
==265734==    by 0x39279CA: Thread.callFn__anon_573552 (Thread.zig:488)
==265734==    by 0x38F4594: Thread.PosixThreadImpl.spawn__anon_570448.Instance.entryFn (Thread.zig:757)
==265734==    by 0x6E567EA: start_thread (pthread_create.c:448)
==265734==    by 0x6ED9FB3: clone (clone.S:100)
==265734==
```
2025-07-20 14:29:40 -07:00