Files
ghostty-rs/crates/ghostty-apprt-gtk/resources/ui/1.2/key-state-overlay.blp
T
ddidderr 88cc13871c feat(apprt-gtk): port the GTK4/libadwaita app runtime
Ports ZIG/src/apprt/gtk into ghostty-apprt-gtk: every GObject class
(application, window, tab, split tree, surface + scrolled window,
child-exited banner, search/key-state/resize overlays, command palette,
global shortcuts, all dialogs, config wrapper) as glib subclasses with
the same GType names, properties, signals and template children; GDK
key translation; X11 and Wayland window-protocol helpers (blur, CSD,
quick terminal via gtk4-layer-shell); single-instance D-Bus IPC;
gsettings; cgroup scope creation.

build.rs compiles Ghostty's blueprints with blueprint-compiler and
bundles UI, CSS and icons into a gresource, as Ghostty's build does.

The core is not ported yet, so the crate defines the boundary it needs
in src/core.rs (CoreApp, CoreSurface, RtApp, RtSurface, Waker); the
spec is in docs/rewrite/notes/ghostty-apprt-gtk.md. ghostty-core will
implement these traits (the crate no longer depends on core to avoid a
cycle). examples/demo.rs runs the app with a dummy core that clears the
GLArea; it launches on Wayland without GTK criticals.

Stubs/open items: toggle_visibility, float_window, secure_input and
close_all_windows return false; inspector is a no-op; X11/Wayland
protocol code is untested against real compositors; gtk4-rs doesn't
expose the GLArea framebuffer id, so the renderer must query it.

Also registers ghostty-apprt and ghostty-cli in workspace.dependencies.

Test Plan:
- cargo test -p ghostty-apprt-gtk (36 tests)
- DEMO_QUIT_AFTER_MS=3000 cargo run -p ghostty-apprt-gtk --example demo
2026-10-11 22:57:15 +02:00

59 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using Gtk 4.0;
using Adw 1;
template $GhosttyKeyStateOverlay: Adw.Bin {
visible: bind $has_state(template.has-tables, template.has-sequence) as <bool>;
valign-target: end;
halign: center;
valign: bind template.valign-target;
GestureDrag {
button: 1;
propagation-phase: capture;
drag-end => $on_drag_end();
}
Adw.Bin {
Box container {
styles [
"background",
"key-state-overlay",
]
orientation: horizontal;
spacing: 6;
Image {
icon-name: "input-keyboard-symbolic";
pixel-size: 16;
}
Label tables_label {
visible: bind template.has-tables;
label: bind $tables_text(template.tables) as <string>;
xalign: 0.0;
}
Label chevron_label {
visible: bind $show_chevron(template.has-tables, template.has-sequence) as <bool>;
label: "›";
styles [
"dim-label",
]
}
Label sequence_label {
visible: bind template.has-sequence;
label: bind $sequence_text(template.sequence) as <string>;
xalign: 0.0;
}
Spinner pending_spinner {
visible: bind template.has-sequence;
spinning: bind template.has-sequence;
}
}
}
}