diff options
| author | Thorsten Ball <mrnugget@gmail.com> | 2023-09-05 13:59:07 +0200 |
|---|---|---|
| committer | Thorsten Ball <mrnugget@gmail.com> | 2023-09-05 13:59:07 +0200 |
| commit | cac5b00d94e53a78b6af05968d513e4914736544 (patch) | |
| tree | 7250718f4eb5780f6d70874d41fc6720dce0483c /src/config.zig | |
| parent | 42a228938f714f1b0c256f88b557d17d7a0327fc (diff) | |
gtk: add gtk-single-instance setting to allow disabling of it
This is based on our conversation on Discord and adds a setting for GTK
that allows disabling the GTK single-instance mode.
If this is off, it's possible to start multiple applications from the
same release binary.
Tested like this:
```
$ zig build -Dapp-runtime=gtk -Doptimize=ReleaseFast && ./zig-out/bin/ghostty --gtk-single-instance=false
[... starts new application ...]
```
and
```
$ zig build -Dapp-runtime=gtk -Doptimize=ReleaseFast && ./zig-out/bin/ghostty --gtk-single-instance=true
info: ghostty version=0.1.0-main+42a22893
info: runtime=apprt.Runtime.gtk
info: font_backend=font.main.Backend.fontconfig_freetype
info: dependency harfbuzz=8.0.0
info: dependency fontconfig=21400
info: renderer=renderer.OpenGL
info: libxev backend=main.Backend.io_uring
info(os): LANG is not valid according to libc, will use en_US.UTF-8
info: reading configuration file path=/home/mrnugget/.config/ghostty/config
info(config): default shell source=env value=/usr/bin/zsh
(process:49045): GLib-GIO-WARNING **: 13:55:56.116: Your application did not unregister from D-Bus before destruction. Consider using g_application_run().
[exits]
```
Diffstat (limited to 'src/config.zig')
| -rw-r--r-- | src/config.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/config.zig b/src/config.zig index 5e59bc428..9e582305d 100644 --- a/src/config.zig +++ b/src/config.zig @@ -314,6 +314,15 @@ pub const Config = struct { /// This does not work with GLFW builds. @"macos-option-as-alt": OptionAsAlt = .false, + /// If true (default), then the Ghostty GTK application will run in + /// single-instance mode: each new `ghostty` process launched will result + /// in a new window, if there is already a running process. + /// + /// If false, each new ghostty process will launch a separate application. + /// + /// Debug builds of Ghostty have a separate single-instance ID. + @"gtk-single-instance": bool = true, + /// This is set by the CLI parser for deinit. _arena: ?ArenaAllocator = null, |
