summaryrefslogtreecommitdiff
path: root/src/apprt
AgeCommit message (Collapse)Author
2025-09-05apprt/gtk-ng: clean up our single instance, new window interactionsMitchell Hashimoto
This removes `launched-from` entirely and moves our `gtk-single-instance` detection logic to assume true unless we detect CLI instead of assume false unless we detect desktop/dbus/systemd. The "assume true" scenario for single instance is desirable because detecting a CLI instance is much more reliable. Removing `launched-from` fixes an issue where we had a difficult-to-understand relationship between `launched-from`, `gtk-single-instance`, and `initial-window`. Now, only `gtk-single-instance` has some hueristic logic. And `initial-window` ALWAYS sends a GTK activation signal regardless of single instance or not. As a result, we need to be explicit in our systemd, dbus, desktop files about what we want Ghostty to do, but everything works as you'd mostly expect. Now, if you put plain old `ghostty` in your terminal, you get a new Ghostty instance. If you put it anywhere else, you get a GTK single instance activation call (either creates a first instance or opens a new window in the existing instance). Works for launchers and so on.
2025-09-05gtk-ng: deprecate detection of launch sourceJeffrey C. Ollie
Detecting the launch source frequently failed because various launchers fail to sanitize the environment variables that Ghostty used to detect the launch source. For example, if your desktop environment was launched by `systemd`, but your desktop environment did not sanitize the `INVOCATION_ID` or the `JOURNAL_STREAM` environment variables, Ghostty would assume that it had been launched by `systemd` and behave as such. This led to complaints about Ghostty not creating new windows when users expected that it would. To remedy this, Ghostty no longer does any detection of the launch source. If your launch source is something other than the CLI, it must be explicitly speciflied on the CLI. All of Ghostty's default desktop and service files do this. Users or packagers that create custom desktop or service files will need to take this into account. On GTK, the `desktop` setting for `gtk-single-instance` is replaced with `detect`. `detect` behaves as `gtk-single-instance=true` if one of the following conditions is true: 1. If no CLI arguments have been set. 2. If `--launched-from` has been set to `desktop`, `dbus`, or `systemd`. Otherwise `detect` behaves as `gtk-single-instance=false`.
2025-09-05gtk: the Future is NowLeah Amelia Chen
2025-09-05gtk: nuke the legacy apprt from orbitLeah Amelia Chen
We don't really have any large outstanding regressions on -ng to warrant keeping this alive anymore. ¡Adiós!
2025-09-03gtk-ng/wayland: allow more quick terminal configs (#8484)Mitchell Hashimoto
We should at least be on par with what Kitty's panels could do in terms of customization
2025-09-03gtk-ng/wayland: allow more quick terminal configsLeah Amelia Chen
2025-09-02apprt/gtk-ng: must quit scenarios should quit immediatelyMitchell Hashimoto
Fixes #8495 We were incorrectly calling graceful quit under must quit scenarios. This would do things like confirm quit by inspecting for running processes. However, must quit scenarios (namely when all windows are destroyed) should quit immediately without any checks because the dispose process takes more event loop ticks to fully finish.
2025-09-02macOS: firstRect should return full rect width/heightMitchell Hashimoto
Fixes #2473 This commit changes `ghostty_surface_ime_point` to return a full rect with the width/height calculated for the preedit. The `firstRect` function, which calls `ghostty_surface_ime_point` was previously setting the width/height to zero. macOS didn't like this. We then changed it to just hardcode it to width/height of one cell. This worked but made it so the IME cursor didn't follow the preedit.
2025-08-30gtk-ng: ensure CSS works on both 4.14 and 4.16+Jeffrey C. Ollie
Ghostty 1.2 needs to support GTK 4.14 because that's the version that ships with Ubuntu 24.04. This PR ensures that any GTK 4.16 CSS features are not used in any static CSS and that the runtime CSS loading handles both 4.14 and 4.16+ appropriately.
2025-08-28some typosMitchell Hashimoto
2025-08-28macos: when executing a script directly, always wait after commandMitchell Hashimoto
2025-08-27apprt/gtk-ng: "cancel" should be default close response for dialogMitchell Hashimoto
Fixes #8424 This is the response that will be sent when "escape" is pressed. This also fixes a null ptr deref that was possible when this fix wasn't in.
2025-08-26apprt/gtk-ng: show error widget if GLArea fails to initializeMitchell Hashimoto
If GTK can't acquire an OpenGL context, this shows a message. Previously, we would only log a warning which was difficult to find. The GUI previously was the default GTK view which showed "Failed to acquire EGL display" which was equally confusing.
2025-08-26gtk-ng: implement close_tab:other keybindJeffrey C. Ollie
2025-08-25close-tab: style-fixesJeffrey C. Ollie
2025-08-25parameterize close_tabJeffrey C. Ollie
- Add mode (`this`/`other`) parameter to `close_tab` keybind/apprt action. - Keybinds will default to `this` if not specified, eliminating backward compatibility issues (`keybind=x=close_tab` === `keybind=x=close_tab:this`). - Remove `close_other_tabs` keybind and apprt action.
2025-08-25gtk-ng: fix setting/unsetting of urgencyJeffrey C. Ollie
- Don't set urgency on windows that are the topmost window. - Turn off urgency on windows that become the topmost window. Fixes #8373
2025-08-24Close other tabs feature on Mac.jamylak
Supporting command line, file menu and keybindings. Default mac shortcut of `super + alt + o` (other) Not able to test on Linux so excluding `close_other_tabs` from `gtk` for now make a default short cut for close other tabs
2025-08-23apprt/gtk-ng: some style changes for toastMitchell Hashimoto
2025-08-23feat: add option to disable the "Reloaded the configuration" notificationdy0gu
2025-08-21gtk-ng: add a helper to reduce boilerplate in GTK IPC (#8306)Mitchell Hashimoto
2025-08-21gtk-ng: allow XKB remaps for non-writing-system keys (#8330)Mitchell Hashimoto
Compromise solution to #7356 XKB is naughty. It's really really naughty. I don't understand why we didn't just kill XKB with hammers during the Wayland migration and change it for something much better. I don't understand why we're content with what amounts to an OS-level software key remapper that completely jumbles information about original physical key codes in order to fake keyboard layouts, and not just let users who really want to remap keys use some sort of evdev or udev-based mapper program. In a sane system like macOS, the "c" key is always the "c" key, but it's understood to produce the Unicode character "ц" when using a Russian layout. XKB defies sanity, and just pretends that your "c" key is actually a "ц" key instead, and so when you ask for the keybind "Ctrl+C" it just shrugs in apathy (#7309). And so, we took matters into our own hands and interpreted hardware keycodes ourselves. But then, a *lot* of people have the ingrained muscle memory of swapping Escape with Caps Lock so that it is easier to hit. We respect that. In a sane system, they would use a remapper that actually makes the system think you've hit the Escape key when in reality you've hit the Caps Lock key, so in all intents and purposes to the OS and any app developer, these two just have their wires swapped. But not on Linux. Somehow this and the aforementioned case should be treated by the same key transform algorithm, which is completely diabolical. As a result, we have to settle for a compromise that truly satisfies neither party — by allowing XKB remaps for keys that don't really change depending on the layout. The Linux input stack besets all hopes and aspirations.
2025-08-22gtk-ng: allow XKB remaps for non-writing-system keysLeah Amelia Chen
Compromise solution to #7356 XKB is naughty. It's really really naughty. I don't understand why we didn't just kill XKB with hammers during the Wayland migration and change it for something much better. I don't understand why we're content with what amounts to an OS-level software key remapper that completely jumbles information about original physical key codes in order to fake keyboard layouts, and not just let users who really want to remap keys use some sort of evdev or udev-based mapper program. In a sane system like macOS, the "c" key is always the "c" key, but it's understood to produce the Unicode character "ц" when using a Russian layout. XKB defies sanity, and just pretends that your "c" key is actually a "ц" key instead, and so when you ask for the keybind "Ctrl+C" it just shrugs in apathy (#7309). And so, we took matters into our own hands and interpreted hardware keycodes ourselves. But then, a *lot* of people have the ingrained muscle memory of swapping Escape with Caps Lock so that it is easier to hit. We respect that. In a sane system, they would use a remapper that actually makes the system think you've hit the Escape key when in reality you've hit the Caps Lock key, so in all intents and purposes to the OS and any app developer, these two just have their wires swapped. But not on Linux. Somehow this and the aforementioned case should be treated by the same key transform algorithm, which is completely diabolical. As a result, we have to settle for a compromise that truly satisfies neither party — by allowing XKB remaps for keys that don't really change depending on the layout. The Linux input stack besets all hopes and aspirations.
2025-08-21gtk-ng: more complete GTK startup/shutdownJeffrey C. Ollie
2025-08-21gtk-ng: properly skip Zig testJeffrey C. Ollie
2025-08-20gtk-ng: add a helper to reduce boilerplate in GTK IPCJeffrey C. Ollie
2025-08-19gtk-ng: attach surface size callbacks AFTER realize (#8287)Mitchell Hashimoto
The `gdk.Surface` is only ever available *after* the window had been first presented and mapped. Trying to get the surface during `init` like what we had previously done will **always** return null.
2025-08-20gtk-ng: attach surface size callbacks AFTER realizeLeah Amelia Chen
The `gdk.Surface` is only ever available *after* the window had been first presented and mapped. Trying to get the surface during `init` like what we had previously done will **always** return null.
2025-08-19gtk-ng: fix toggle_window_decoration (#8286)Mitchell Hashimoto
When window-decoration=none, setting the window decoration to null would just mean it would default to none again, creating a cycle of torment none can break out of... that sounds a bit too dramatic doesn't it Fixes #8274
2025-08-20gtk-ng: fix toggle_window_decorationLeah Amelia Chen
When window-decoration=none, setting the window decoration to null would just mean it would default to none again, creating a cycle of torment none can break out of... that sounds a bit too dramatic doesn't it Fixes #8274
2025-08-18apprt/gtk-ng: defineVirtualMethod helperMitchell Hashimoto
2025-08-18gtk-ng: add some better comments on why getClass worksJeffrey C. Ollie
2025-08-18gtk-ng: remove some woefully naive musings on GObject memory layoutJeffrey C. Ollie
2025-08-18gtk-ng: remove signals from imgui_widgetJeffrey C. Ollie
2025-08-18gtk-ng: add some initial notes on memory layout of GObjectsJeffrey C. Ollie
2025-08-18gtk-ng: use gitlab permalinksJeffrey C. Ollie
2025-08-18gtk-ng: use virtual methods to draw the inspectorJeffrey C. Ollie
Insead of signals between the ImGui widget and the Inspector widget, make the Inspector widget a subclass of the ImGui widget and use virtual methods to handle setup and rendering of the Inspector.
2025-08-17gtk-ng: fix race condition when checking border bell featureJeffrey C. Ollie
Fixes #8266 When a surface is first created, there's a race condition between when the config is set on the surface and when the code to check if a border should be drawn around the surface is run. Fix that by exiting early if the bell isn't ringing, before we check to see if there's a config set on the surface and issuing the warning message.
2025-08-16gtk-ng: set IM context's input-purpose as terminal (#8251)Leah Amelia Chen
2025-08-16gtk-ng: set IM context's input-purpose as terminalLeah Amelia Chen
See https://github.com/ghostty-org/ghostty/issues/7987#issuecomment-3187597026
2025-08-16gtk-ng: refactor CSD/SSD style class settingsLeah Amelia Chen
Fixes #8127
2025-08-15apprt/gtk-ng: actually handle color scheme eventsMitchell Hashimoto
Fixes #8245
2025-08-15apprt/gtk-ng: respect window-inherit-working-directory=falseMitchell Hashimoto
Fixes #8244
2025-08-14apprt/gtk-ng: implement `maximize` and `fullscreen`Mitchell Hashimoto
These fell through the cracks.
2025-08-14gtk-ng: move actions helper to namespaceJeffrey C. Ollie
2025-08-14gtk-ng: use action helper in surfaceJeffrey C. Ollie
2025-08-14gtk-ng: use action helper in split-treeJeffrey C. Ollie
2025-08-14gtk-ng: use action helper in tabJeffrey C. Ollie
2025-08-14gtk-ng: use action helper in windowJeffrey C. Ollie
2025-08-14gtk-ng: use action helper in applicationJeffrey C. Ollie