This adds functionality for choosing different normalization metrics for
each fallback font. It's not exposed as a config option, but could be in
the future, which would probably go a long way towards addressing
concerns like #7929.
The currently available reference metrics are, in priority order:
`ic_width, ex_height, cap_height, line_height, em_size`. The default
value is `ic_width`.
By priority order, I mean that if the chosen metric is not defined in
the fallback font, we move to the next metric in the list---we don't
normalize by an estimated metric from the fallback font (however, we're
happy to use an estimated metric from the primary font, that's how
`ic_width` normalization between CJK and Latin fonts work). This extends
the pattern that was used between `ic_width` and `ex_height` in the
existing hardcoded rule. `line_height` is always defined, so the buck
stops there.
What motivated me to implement this was the fact that, with the existing
hardcoded rule, the embedded symbols-only Nerd Font was always scaled up
by a factor of 1.2, which turned out to be an important reason why it's
been difficult to make icon scaling work to everyone's satisfaction.
Accordingly, the symbols-only font is the first to take advantage of the
new functionality. If this PR is merged, #7917 is no longer needed. (To
limit the scope of this PR, it only includes the minimal changes to let
icon scaling take advantage of this functionality. I may submit a
follow-up PR with some further icon scaling improvement enabled by
this.)
This ports over a basic headerbar, maximize, and fullscreen. The
headerbar only has the main menu button for now since we have no tabbing
or splits. The main menu has the full main menu that mainline GTK has
but most of it is disabled since we don't implement the actions yet.
I didn't use anything from your branch @tristan957 so I didn't add
coauthor but I want to note that @tristan957 worked on this as well and
I suspect there's overlap.
This fixes a double-free that Valgrind found when the quit action was
used (the keybinding to quit or the menu item). This fixes it in both
the gtk and gtk-ng apprts.
The issue stems from the fact that our quit action worked by traversing
the toplevels and destroying all windows. When all windows are
destroyed, GTK exits the main loop.
When fcitx is used as the input method editor (IME), it appears to hold
its own `gtk.Window` widget as a property (probably for the IME popup).
Unfortunately this does not react well to being destroyed externally and
triggers a double-free when the IME widget also tries to dispose itself.
I think this is probably a bug somewhere in the GTK IME widget because
it should be resilient to this kind of destruction. But, we can't
tolerate a double free in the mean time.
We can still quit by destroying only OUR windows (which cascades to
destroy everything else).
This fixes a double-free that Valgrind found when the quit action was
used (the keybinding to quit or the menu item).
The issue stems from the fact that our quit action worked by traversing the
toplevels and destroying all windows. When all windows are destroyed,
GTK exits the main loop.
When fcitx is used as the input method editor (IME), it appears to hold
its own `gtk.Window` widget as a property (probably for the IME popup).
Unfortunately this does not react well to being destroyed externally and
triggers a double-free when the IME widget also tries to dispose itself.
I think this is probably a bug somewhere in the GTK IME widget because
it should be resilient to this kind of destruction. But, we can't
tolerate a double free in the mean time.
We can still quit by destroying only OUR windows (which cascades to
destroy everything else).
I changed my mind, this is a pretty small change and relevant to the
intent of the PR. This brings the appearance of the embedded symbols
much closer to patched fonts.
With this, the sizes of most symbols are nearly identical to a patched
font, the only big difference is positioning (and TBH I think we do a
better job positioning than the patcher does, since we have knowledge
about the cell size).
Move size adjustment logic out of `Entry`, I understand the impulse to
put it there but it results in passing a lot of stuff around which isn't
great.
Rework `add(...)` in to `add(...)` and `addDeferred(...)`, faces are
passed directly now instead of passing an entry, and an options struct
is used instead of positional arguments for things like style, fallback,
and size adjustment.
Change size adjustment test back to a half pixel tolerance instead of 5%
because the previous commit (allowing fractional pixel sizes) fixed the
root cause of large differences.
This makes the `new_window` action properly inherit properties from the
parent surface that initiated the action. Today, that is only the pwd
and font size.
This makes the `new_window` action properly inherit properties from the
parent surface that initiated the action. Today, that is only the pwd
and font size.
For now, this just emits a signal that an embedding widget will react to
to do something like flashing the window.
I think we should implement the audio bell in the actual surface view
but I don't currently have audio drivers hooked up in my Linux VM and
I'm away from my desktop PC. :)
cc @jcollie if you're interested, pretty tightly scoped.
For now, this just emits a signal that an embedding widget will react to
to do something like flashing the window.
I think we should implement the audio bell in the actual surface view
but I don't currently have audio drivers hooked up in my Linux VM and
I'm away from my desktop PC. :)
This change might be good, but it is incomplete and not relevant to the
PR that it's a part of. I'll explore making this change separately after
this, since it might be a good idea.
(It's incomplete since the attribute data was not re-generated based on
the non-mono file.)
A variety of naming, commenting, and formatting improvements + a few
explicit error sets. This commit has no functional changes, though it
does remove a couple functions that didn't really need to exist.
This ports the child exited overlay.
We're able to use Zig comptime and Blueprint templates to use the same
Surface blueprint for this even if libadwaita is too old to support
banners (< 1.3) by inheriting from `gtk.Widget` instead and not
instantiating the blueprint. Its a bit noisy to maintain the `noop`
version but we should be able to test that compilation in CI (we do via
Debian 12).
GTK dynamically loads librsvg when it needs to convert a SVG-only icon
(or any other SVG-only resource) for display. This PR adds the libraries
that GTK needs so that running programs from within the developer shell
can display those SVG resources.
GTK dynamically loads librsvg when it needs to convert a SVG-only icon
(or any other SVG-only resource) for display. This PR adds the libraries
that GTK needs so that running programs from within the developer shell
can display those SVG resources.
This adds a new icon for the GTK-based application that adheres (mostly)
to the Gnome Human Interface Guidelines (HIG). The icon is designed to
fit in better with other Gnome applications.
While there isn't a single standard "native" style amongst Linux
applications, I believe this better fits the general Linux desktop
ecosystem over our macOS icon.
The icon itself is undeniably Ghostty. The core design language is the
same and I don't think ayone will mistake it for anything else. I wanted
to keep the brand the same, but making it fit in better aligns with
Ghostty's goal of being "platform native".
As of this PR, you can't use the macOS icon on Linux without modifying
the source. We may provide a compile-time option to swap icons in the
future (unfortunately Linux desktop applications require hardcoding an
icon path in the desktop files, so making it runtime selectable is...
messy!)
<img width="2048" height="2048" alt="2048"
src="https://github.com/user-attachments/assets/0b15e6db-bb6d-424c-8a83-ca809759b0c4"
/>