132 Commits

Author SHA1 Message Date
Mitchell Hashimoto
abafb81a1b apprt/gtk: update app color scheme state
Fixes #2781

This commit contains two separate changes but very related:

1. We update the color scheme state of the app on app start. This is
   necessary so that the configuration properly reflects the conditional
   state of the theme at the app level (i.e. the window headerbar).

2. We take ownership of the new config when it changes, matching macOS.
   This ensures that things like our GTK headerbar update when the theme
   changes but more generally whenever any config changes.

And some housekeeping:

- We remove runtime CSS setup from init. We can do it on the first tick
  of `run` instead. This will probably save some CPU cycles especially
  when we're just notifying a single instance to create a new window.

- I moved dbus event setup to `run` as well. We don't need to know these
  events unless we're actually running the app. Similar to the above,
  should save some CPU time on single instance runs.
2024-11-26 19:13:36 -08:00
Mitchell Hashimoto
204c5796a7 Merge pull request #2825 from StratusFearMe21/gtk-startup
Prevent GTK from initializing Vulkan. This improves startup time
2024-11-26 13:24:16 -08:00
Mitchell Hashimoto
e3621e81b7 apprt/gtk: use proper env var for vulkan disable on <= 4.14 2024-11-26 13:18:05 -08:00
Isaac Mills
39fbd7db4b Prevent GTK from initializing Vulkan. This improves startup time 2024-11-26 11:10:00 -07:00
Mitchell Hashimoto
518f8b1048 Merge pull request #2797 from kyswtn/application-support-dir
Support loading config from "Application Support" directory on macOS
2024-11-25 16:15:59 -08:00
Mitchell Hashimoto
b9345e8d6a try to abstract bundle ID to a zig file 2024-11-25 16:11:02 -08:00
Mitchell Hashimoto
a39aa7e89d apprt/gtk: only show config reload toast if app config changes
This resolves the toast showing up every time the surface config changes
which can be relatively frequent under certain circumstances such as
theme changes.
2024-11-25 15:13:23 -08:00
Mitchell Hashimoto
f20b20bd6a apprt/gtk: fix build 2024-11-22 11:52:34 -08:00
Mitchell Hashimoto
00c62708d3 apprt: remove change conditional state action 2024-11-22 11:52:34 -08:00
Mitchell Hashimoto
266e4781fb apprt/gtk: update for new reload config API 2024-11-22 11:52:34 -08:00
Mitchell Hashimoto
fadfb08efe apprt: add config_change action 2024-11-21 10:30:27 -08:00
Mitchell Hashimoto
03b60ab2ef apprt/gtk: support light/dark mode change on the fly 2024-11-19 16:12:11 -08:00
Mitchell Hashimoto
b7f1eaa145 apprt: action to change conditional state, implement for embedded 2024-11-19 15:36:31 -08:00
Tristan Partin
9c25811576 apprt/gtk: handle pwd action
Use it as a tooltip for the tab.

Signed-off-by: Tristan Partin <tristan@partin.io>
2024-11-16 15:20:53 -06:00
Mitchell Hashimoto
3ca246ceb9 apprt: support a pwd change action 2024-11-13 12:29:30 -08:00
Paul Berg
1e003b2e0f gtk: implement toggle_split_zoom 2024-11-06 09:59:10 +01:00
FineFindus
89f7f88286 apprt/adw: reapply headerbar colors
Fixes a regression in ca42b4ca1c7a9319b7fbc17cabab0cbb4120f0fb that
caused the headerbar to no longer use the same color as the
ghostty-theme.
2024-11-03 19:42:58 +01:00
Mitchell Hashimoto
1065359b9a apprt: rename set_bg/fg to "color_change" to report all color changes 2024-10-30 16:33:18 -04:00
CJ van den Berg
a2a1d93d5c apprt: propagate OSC10/11 (set term fore/background color) through to apprt
This is to allow the running apprt to set the UI theme to match the
terminal application coloring.
2024-10-30 17:35:34 +01:00
axdank
e7bd60b28e fix type mismatch in moveTab function parameter 2024-10-25 16:53:13 -03:00
axdank
520dda65cb apply review changes 2024-10-25 08:07:11 -03:00
axdank
465d60def8 gui: add move_current_tab action 2024-10-24 00:01:54 -03:00
Mitchell Hashimoto
be3fc5c04a apprt/gtk: exit if there are CLI errors 2024-10-18 08:26:27 -07:00
Mitchell Hashimoto
4e25840e08 apprt/gtk: support new config diagnostics API 2024-10-18 08:11:11 -07:00
Mitchell Hashimoto
c614f2b485 apprt/gtk: use stackfallback for runtime CSS, explicit errors 2024-10-16 06:19:47 -07:00
Jeffrey C. Ollie
ca42b4ca1c gtk: use CSS variables and color calcs introduced in 4.16
This takes advantage of CSS variables and color expressions to improve
the `window-theme=ghostty` support. The only visibile difference from
the previous implementation is that the header bar will darken if the
Ghostty window is in the background, which is standard for GTK apps.

This is conditional at runtime. If Ghostty detects that you're running
against GTK 4.16 or newer it will use the CSS variables and color calcs.
If you're running against older versions it will use CSS classes to
achieve nearly the same effect.
2024-10-14 18:24:05 -05:00
Mitchell Hashimoto
b65a9ebc45 Merge pull request #2234 from jcollie/gtk-css-no-libadwaita
gtk: load css when libadwaita is not being used
2024-10-09 09:37:30 -07:00
Mitchell Hashimoto
5c1ffbb642 apprt: implement key_sequence action 2024-10-08 21:55:00 -07:00
Jeffrey C. Ollie
bb109c435f gtk: fix window-theme=ghostty 2024-10-08 11:17:33 -05:00
Jeffrey C. Ollie
ab0a736089 gtk: load css when libadwaita is not being used 2024-10-08 11:17:32 -05:00
Leah Amelia Chen
fbc621a7d8 gtk: implement splitting leftwards and upwards 2024-10-07 18:19:27 -07:00
Mitchell Hashimoto
494fedca2f apprt/gtk: report proper app focus state 2024-10-06 13:31:03 -07:00
Roland Peelen
24ba1a6100 Add action on Zig side 2024-10-02 10:33:36 -07:00
Christian Kugler
f9d3f64978 Merge branch 'main' into fix_2271 2024-09-29 14:15:56 +02:00
Christian Kugler
f309d4191e Use helper function to set correct env variables
GTK4 version 4.16 split the environment variable `GDK_DEBUG` into `GDK_DEBUG`
and `GDK_DISABLE`. This is being done by using the helper function `atLeast` to
handle certain versions accordingly.

`GSK_RENDERER` also only needs to be set in later GTK versions (>=1.14.0).
2024-09-29 14:04:13 +02:00
Mitchell Hashimoto
1570ef01a7 rename slide to quick terminal 2024-09-28 15:20:35 -07:00
Mitchell Hashimoto
7806366eec core: fix up toggle_slide_terminal action for rebase 2024-09-27 18:36:06 -07:00
Mitchell Hashimoto
576453cfde apprt/gtk: set null url if url is empty
Fixes #2306
2024-09-27 18:34:08 -07:00
Paul Berg
f1474c220d bind: add toggle_tab_overview binding 2024-09-27 10:13:05 -07:00
Mitchell Hashimoto
4ae20212bf libghostty: unified action dispatch
First, this commit modifies libghostty to use a single unified action
dispatch system based on a tagged union versus the one-off callback
system that was previously in place. This change simplifies the code on
both the core and consumer sides of the library. Importantly, as we
introduce new actions, we can now maintain ABI compatibility so long as
our union size does not change (something I don't promise yet).

Second, this moves a lot more of the functions call on a surface into
the action system. This affects all apprts and continues the previous
work of introducing a more unified API for optional surface features.
2024-09-26 22:00:11 -07:00
Mitchell Hashimoto
3b419a2ba2 apprt/gtk: handle zero value notification pointers 2024-09-26 14:40:33 -07:00
Mitchell Hashimoto
4e2781fdec apprt/gtk 2024-09-26 14:13:18 -07:00
Paul
b41f45d7a3 apprt/gtk: support window-theme != ghostty
- support for gtk-tabs-location=bottom
 - support for gtk-titlebar=false
2024-09-24 08:10:06 +02:00
Tristan Partin
81c50e588c apprt/gtk: override the top bar colors in libadwaita correctly
This is the way to override the color in libadwaita < 1.6. We can
transition to named colors, specifically headerbar-{fg,bg}-color for
libadwaita 1.6.

Fixes: #2266
Signed-off-by: Tristan Partin <tristan@partin.io>
2024-09-23 17:09:14 -05:00
Mitchell Hashimoto
a503e0250e apprt/gtk: add version helpers
This adds version helpers similar to the adwaita version helpers so that
build time and runtime version checks can be done.
2024-09-19 20:24:52 -07:00
Severus
888861984d Fix typo 2024-09-20 10:18:19 +07:00
Severus
b675905cc2 Fix 2271 issue
From GTK 4.16, GDK_DEBUG is splitted into GDK_DEBUG and GDK_DISABLE
2024-09-20 07:55:40 +07:00
Paul Berg
990bcb9573 gtk: respect window-theme=ghostty when gtk-titlebar=false 2024-09-18 13:52:44 +02:00
Tristan Partin
d0c6c4f367 apprt/gtk: use toast UX from Adwaita if available
Notify the user with in-app notifications if libadwaita is available.

Co-authored-by: Paul Berg <paul@ber.gp>
Signed-off-by: Tristan Partin <tristan@partin.io>
2024-09-16 11:57:58 -05:00
Mitchell Hashimoto
941adcdac8 apprt/gtk: rename the other underscore actions to match naming rules 2024-09-13 20:49:31 -07:00