Commit Graph

24 Commits (93debc439ccc87e8dee82d73c49a693a368b0685)

Author SHA1 Message Date
Leah Amelia Chen 93debc439c
gtk: the Future is Now 2025-09-05 10:10:52 +02:00
Leah Amelia Chen ac52af27d3
gtk: nuke the legacy apprt from orbit
We don't really have any large outstanding regressions on -ng to warrant
keeping this alive anymore. ¡Adiós!
2025-09-05 00:21:41 +02:00
Jörg Thalheim a8651882a7 add cut/copy/paste keys
The origin of these keys are old sun keyboards.
They are getting picked up by the custom (progammable) keyboard scene
(see https://github.com/manna-harbour/miryoku for a popular layout).
Support in ghosty is quite handy because it allows to bind copy/paste in
a way that doesn't overlap with ctrl-c/ctrl-v, which can have special
bindings in some terminal applications.
2025-05-24 00:29:53 +02:00
Mitchell Hashimoto 3d2bc3dca1
build: add unwind tables and frame pointers to debug/test builds
This fixes an issue where stack traces were unreliable on some platforms
(namely aarch64-linux in a MacOS VM). I'm unsure if this is a bug in Zig
(defaults should be changed?) or what, because this isn't necessary on
other platforms, but this works around the issue.

I've unconditionally enabled this for all platforms, depending on build
mode (debug/test) and not the target. This is because I don't think
there is a downside for other platforms but if thats wrong we can fix
that quickly.

Some binaries have this unconditionally enabled regardless of build mode
(e.g. the Unicode tables generator) because having symbols in those
cases is always useful.

Some unrelated GTK test fix is also included here. I'm not sure why CI
didn't catch this (perhaps we only run tests for none-runtime) but all
tests pass locally and we can look into that elsewhere.
2025-05-19 17:12:39 -07:00
Leah Amelia Chen 54dbd1990a
gtk: implement global shortcuts
It's been a lot of D-Bus related pain and suffering, but here it is.

I'm not sure about how well this is integrated inside App, but I'm fairly
proud of the standalone logic.
2025-05-18 22:40:31 +02:00
Mitchell Hashimoto ffdf86374a
apprt/gtk: build 2025-05-09 10:01:06 -07:00
Leah Amelia Chen 1ee9c85954
gtk: port inspector & key handling to zig-gobject 2025-03-18 12:35:41 +01:00
Jeffrey C. Ollie 572fc8b5d7
gtk: convert Surface to zig-gobject 2025-03-13 12:04:10 -05:00
Mitchell Hashimoto 27b254db8a
apprt/gtk: set key modifier flag if physical modifier key is pressed
Fixes #5191
2025-01-29 13:12:50 -08:00
Mitchell Hashimoto ed81b62ec2
apprt/gtk: winproto
Rename "protocol" to "winproto".
2025-01-10 09:39:34 -08:00
Leah Amelia Chen 03fee2ac33 gtk: unify Wayland and X11 platforms 2025-01-09 14:57:02 -08:00
Peter Cock 6459e5c8ca
Fixing a few typos in the source code comments (#4529) 2025-01-03 11:00:45 -08:00
Mitchell Hashimoto c4ff873726
ci: test gtk via a matrix 2024-12-28 14:29:36 -08:00
Jeffrey C. Ollie 8ecb11a602
gtk: add option to not link against libX11 2024-12-28 13:40:17 -06:00
Mitchell Hashimoto 9e435f050e
apprt/gtk: setup window key event infrastructure 2024-10-07 13:01:36 -07:00
Tristan Partin a0bc6ae966 gtk: silence bad accelerator warnings
Before this a commit a keybind of CTRL + \ would create a GTK
accelerator of <Ctrl>\, which is incorrect. It needs to be
<Ctrl>backslash, which can be retrieved with gdk_keyval_name().

Signed-off-by: Tristan Partin <tristan@partin.io>
2024-09-05 19:08:29 -05:00
Mitchell Hashimoto 9409e3072f
apprt/gtk: remove usingnamespace 2024-08-16 14:58:04 -07:00
Mitchell Hashimoto cb76fe6634
fix linux builds 2024-06-24 15:16:24 -07:00
Mitchell Hashimoto 14417d2592
Allow keybinding arbitrary unicode codepoints (#1814)
Fixes #1802 

This allows `keybind` configurations to map to any Unicode codepoint. This enables keybindings for which we don't have a registered keycode or for custom keyboard firmwares that may produce arbitrary text (but the Ghostty support is limited to a single codepoint).

The `keybind` syntax is unchanged. If a bound character doesn't map to a known logical key that Ghostty knows about, we map it to a Unicode codepoint. The unicode codepoint is compared against the _unshifted codepoint_ from the apprt key event. 

Note that this binding is to a single _codepoint_. We don't support arbitrary sequences of characters or multi-code point graphemes for keybindings due to the complexity in memory management that would introduce.

This also provides a good fallback for scenarios where it might make sense to educate Ghostty about a key code or fix a bug in our keyboard input system, but the unicode data is correct. In that scenario, unicode key binds should allow key binds to still work while we investigate the input issues.

Example:

```
shift+ö=text:hello
```

This now works as expected on a US hardware keyboard with the Hungarian keyboard layout.
2024-06-02 10:53:36 -07:00
Tim Culverhouse 4bd9b1365a key: add TODO's for media keys
Add TODO comments in places where we need to add media keys.
2023-12-13 06:57:15 -06:00
Tim Culverhouse a0880bcfed key: add additional keypad keys
Add additional keypad keys to the encoding scheme. This allows Ghostty
to report KP_HOME and it's relatives. We also always check for a keyval
first, so we can report KP_7, etc as opposed to ASCII '7'.
2023-12-13 06:55:22 -06:00
Mitchell Hashimoto 0c695f3510
apprt/gtk: add comment about key aliases 2023-11-08 09:37:53 -08:00
Severus 3497fec7df
Add keymap for KP_*
We miss some kp_* like: kp_home, kp_end, kp_up, kp_down, kp_page_up, kp_page_down, kp_left, kp_right.
Then we map those keys in gtk runtime.
2023-11-08 14:43:00 +07:00
Mitchell Hashimoto dcf615022e
apprt/gtk: key file for logic related to keys 2023-09-18 14:27:05 -07:00