114 Commits

Author SHA1 Message Date
Mitchell Hashimoto
a60f9eb9e6 apprt/gtk: empty inspector window 2023-10-24 15:27:13 -07:00
Mitchell Hashimoto
dcf615022e apprt/gtk: key file for logic related to keys 2023-09-18 14:27:05 -07:00
Mitchell Hashimoto
d5036e78f4 apprt/gtk: refactor into separate files 2023-09-16 08:28:49 -07:00
Mitchell Hashimoto
120588fb62 apprt/gtk: show warning when running debug version 2023-09-15 15:57:51 -07:00
Tim Culverhouse
de5c416341 gtk: handle all close-requests
When compiling in any Release mode, the default gtk close-request
handler does not properly fire. We only rely on the default handler if
we aren't confirming the close. Replace the default handler with our own
in all cases (and just destroy the window if we don't need
confirmation).

Fixes #458
2023-09-15 04:31:50 -05:00
Mitchell Hashimoto
54f58d9cd2 apprt/gtk: implement hide cursor 2023-09-14 19:45:20 -07:00
Mitchell Hashimoto
62ae59cd97 apprt/gtk: apply GDK scale factor to mouse coordinates
Fixes #452
2023-09-14 12:26:36 -07:00
Mitchell Hashimoto
01cb1ad90e apprt/gtk: cursor state should be on surface 2023-09-14 11:22:54 -07:00
Thorsten Ball
d96d60445a Fix compilation issues with GTK cursor support 2023-09-14 20:19:53 +02:00
Mitchell Hashimoto
cb2931cb27 rename cursor shape to mouse shape for OSC 22 2023-09-14 11:12:17 -07:00
Mitchell Hashimoto
674575e598 apprt/gtk: support set cursor shape 2023-09-14 10:55:05 -07:00
Mitchell Hashimoto
678bd0de0c core: surface should not use app mailbox
The surface runs on the same thread as the app so if we use the app
mailbox then we risk filling the queue before it can drain. The surface
should use the app directly.

This commit just changes all the calls to use the app directly. We may
also want to coalesce certain changes to avoid too much CPU but I defer
that to a future change.
2023-09-13 08:34:09 -07:00
Mitchell Hashimoto
fc90a4a052 apprt/gtk: do not ask for confirm window close if all surfaces idle 2023-09-11 15:53:20 -07:00
Mitchell Hashimoto
868b66ce74 apprt/gtk: integrate app needsConfirmQuit 2023-09-11 15:47:37 -07:00
Mitchell Hashimoto
9be46fa80a apprt/gtk: log configuration errors 2023-09-11 09:18:03 -07:00
Thorsten Ball
cac5b00d94 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]
```
2023-09-05 13:59:07 +02:00
Thorsten Ball
a1a48eb3f0 gtk: allow hiding window decoration in configuration
This is part of #319 by fixing it for GTK and introducing the
configuration option.

This adds `window-decoration = false` as a possible configuration
option. If set to `false`, then no window decorations are used.
2023-09-03 21:27:21 +02:00
Will Pragnell
86122624e0 macos: add visible-menu non-native-fullscreen option 2023-09-01 21:45:45 -07:00
Seth Rider
c56d07c36f use Gtk.Notebook::switch-page callback for setting window title 2023-08-28 07:26:30 -07:00
Seth Rider
fc774cf21a Set gtk window title on change and tab swap (by key command) 2023-08-26 21:25:54 +01:00
Mitchell Hashimoto
fe0e1f5ee8 input: key must provide unshifted codepoint 2023-08-17 09:40:32 -07:00
Mitchell Hashimoto
33bef28850 rename key2callback to keycallback 2023-08-16 13:40:57 -07:00
Mitchell Hashimoto
4e8f5d3997 remove charCallback/keyCallback 2023-08-16 13:39:44 -07:00
Mitchell Hashimoto
896d0e8fcf apprt/gtk: only use key2callback 2023-08-16 13:02:31 -07:00
Mitchell Hashimoto
83ba2b9825 apprt/gtk: clean up keyval_unicode usage 2023-08-16 12:51:00 -07:00
Mitchell Hashimoto
1a918bc64b apprt/gtk: call new key2callback using the all-in-one key event 2023-08-16 12:48:48 -07:00
Mitchell Hashimoto
e74a173704 apprt/gtk: translate keyval if there is no utf8
This is the same fix as #287 but for GTK.
2023-08-16 12:47:51 -07:00
Mitchell Hashimoto
49a9d626ec apprt/gtk: convert keyval to unicode if input method doesn't process
See comment for details.
2023-08-13 16:27:46 -07:00
Mitchell Hashimoto
5e2fa50d0b macos-option-as-alt config, handle alt-prefix for charCallback 2023-08-13 14:55:31 -07:00
Mitchell Hashimoto
81995fc078 apprt/gtk: inherit font size on new windows and tabs 2023-08-13 12:15:42 -07:00
Mitchell Hashimoto
619d2ade3e only initialize font discovery mechanism once, cache on App
Fontconfig in particular appears unsafe to initialize multiple times.

Font discovery is a singleton object in an application and only ever
accessed from the main thread so we can work around this by only
initializing and caching the font discovery mechanism exactly once on
the app singleton.
2023-08-13 08:01:33 -07:00
Mitchell Hashimoto
55778a049b apprt/gtk, opengl: render preedit 2023-08-11 12:37:27 -07:00
Mitchell Hashimoto
ce4eb2112c core: get rid of ignore_char, apprt must handle this now 2023-08-11 12:02:01 -07:00
Mitchell Hashimoto
38477ed547 apprt/gtk: use manual translation, handle dead key states 2023-08-11 12:02:01 -07:00
Mitchell Hashimoto
4fe739cae0 core: note when keyCallback processed the input 2023-08-11 12:02:00 -07:00
Mitchell Hashimoto
f012b908b7 apprt/gtk: use glfw for reading primary clipboard (see comment) 2023-08-09 14:17:03 -07:00
Mitchell Hashimoto
347c60d9bd selection copies to the selection clipboard 2023-08-09 14:00:48 -07:00
Mitchell Hashimoto
f3996ff0f8 apprt: primary clipboard awareness (selection clipboard) 2023-08-09 13:41:22 -07:00
moderation
b33b2bb6a4 gtk: apply background opacity
Signed-off-by: moderation <michael@sooper.org>
2023-08-09 12:03:05 -07:00
Thorsten Ball
147d5b0f3e gtk: fix arrow-up stealing focus
This fixes #253 -- with essentially a single line! Just took me a while
to find out where to add this line.

Turns out we already solved this problem for `<Tab>` so now we do the
same thing for `<Up>`: we tell the `GtkApplication` we handled the event
so it doesn't propagate any further.
2023-08-09 20:11:03 +02:00
Mitchell Hashimoto
e93a6eb2e4 apprt/gtk: set icon name 2023-08-08 09:44:11 -07:00
Mitchell Hashimoto
6b45d931c3 plumb through the resources dir to termio 2023-08-08 09:29:38 -07:00
Kevin Hovsäter
22b8173164 Fix typos 2023-08-08 14:27:34 +02:00
Mitchell Hashimoto
aff64d9951 Merge pull request #247 from mitchellh/gtk-single-instance
GTK single instance, fix UB in termio read thread termination
2023-08-07 21:43:08 -07:00
Mitchell Hashimoto
6d32d74996 apprt/gtk: remove useless calls 2023-08-07 21:15:42 -07:00
Mitchell Hashimoto
2e98d43a58 apprt/glfw: launch window on startup 2023-08-07 19:28:48 -07:00
Mitchell Hashimoto
60a36ca5cc apprt/gtk: enable single instance mode 2023-08-07 19:26:57 -07:00
Mitchell Hashimoto
22296b377a Revert "Merge pull request #244 from mitchellh/alt-as-esc"
This reverts commit c139279d479682c17f63d9b57c2d56608d09d16a, reversing
changes made to 4ed21047a734d7c586debe0026e3b6ea90ed1622.

We do want to do this but this broke bindings.
2023-08-07 17:06:40 -07:00
Mitchell Hashimoto
eca5955e65 apprt/gtk: new input mods format 2023-08-07 14:35:52 -07:00
Mitchell Hashimoto
8ff81de30f apprt/gtk: fix build for macos non-native fullscreen changes 2023-08-04 18:19:48 -07:00