Rewrite render_osd(), and instead of passing in an y-offset, let
render_osd() itself center the text inside the OSD buffer.
This is done using the same baseline calculation term_font_baseline()
does, except we use the buffer height instead of the line height.
Note that most OSDs are sized based on the line height...
Closes#1430
Instead of special casing configuration affecting command line
options (like --font, --fullscreen, --maximized etc), translate them
to overrides, and let the configuration system handle them.
This also fixes an issue where -f,--font did not set csd.font, if
csd.font were otherwise unset.
Before this patch, we didn’t ensure width and height were valid for
the current scaling factor, when fractional scaling _is_
available. That is, we didn’t ensure the width/height values
multiplied back to their original values after dividing with the
scaling factor.
Closes#1446
This function is only called directly when scaling the mouse
pointer. The mouse pointer is never guaranteed to have a valid width
and height, so skip the width/height assertions for it.
* Ensure buffer sizes are valid. That is, ensure that
size / scale * scale == size.
* Do size calculation of the window geometry in the same way we
calculate the CSD offsets.
And calculation of compounded offsets/widths/heights, to compensate
for compositor rounding when positioning and scaling/sizing
subsurfaces.
Closes#1441
When instantiating the viewport for a pointer surface, we didn't first
check if the compositor implements the viewporter interface.
This triggered a crash when a) foot was compiled with fractional
scaling, and b) the compositor did not implement the viewporter
interface.
Closes#1444
This defines the base name of the generated terminfo files. It
defaults to the value of -Ddefault-terminfo (i.e. 'foot')
Example:
meson -Ddefault-terminfo=foot-bananas -Dterminfo-base-name=foot-apples
The generated terminfo files will be
* terminfo/f/foot-apples
* terminfo/f/foot-apples-direct
The default value of $TERM will be 'foot-bananas'
By how much to increase the luminance when brightening bold
fonts. This was previously hard-coded to a factor of 1.3, which is now
the default value of the new config option.
Closes#1434
render_osd() shouldn't use term_font_baseline().
This is because term_font_baseline() uses the line height to determine
the position, while render_osd() renders to surfaces that aren't sized
like the grid.
This fixes a regression, where the CSD title were sometimes rendered
too high up, and sometimes too low.
* In all calls to wl_subsurface_set_position()
* (wp_viewport_set_destination() already does this)
* Whenever we use the scale to calculate margins (search box,
scrollback indicator etc)
* Since the scaling factor is stored as a float (and not a double),
use roundf() instead of round()
Monitor DPI depends on information from both the wl_output and the
xdg_output interfaces.
Before this patch, terminals were only updated after changes to the
wl_output interfaces (thus depending on xdg output changes being
pushed by the compositor before wl_output changes).
That assumption (xdg_output happening before wl_output) isn’t always
true.
This patch fixes the issue by updating the terminals in the
xdg_output’s “done” event.
Closes#1431
This patch detects invalid codepoints in the UTF-8 EDxxxx range, and
the F4xxxxxx range.
Note that we still allow the E0xxxx and F0xxxxxx ranges. These
contains overlong encodings. We allow them, because they still decode
into correct UTF-32.
Closes#1423
- wayland-instance template target was a mistake.
Systemd does not support simultaneous same user session, so stop
trying to go against that.
- Only start systemd units in Wayland environments.
Even if WAYLAND_DISPLAY / XDG_RUNTIME_DIR are defined, if we can't
find the corresponding socket, we fallback to the path used when they
are not defined.
Do not insert existing positions into the tab stop list.
This prevents a performance issue when iterating through
an extremely long tab stop list.
Also corrects the behaviour of CBT.
The wayland protocol recommends (or mandates?) that compositors render
a black background behind fullscreened transparent windows. I.e. you
never see what’s _actually_ behind the window.
So, if you have a white, but semi-transparent background in foot,
it’ll be rendered in a shade of gray.
Given this, it’s better to simply disable transparency while we’re
fullscreened. That way, we at least get the "correct" background
color.
Closes#1416
This fixes a crash-on-exit on compositors that emit a _"keyboard
leave"_ event when a surface is unmapped.
In our case, destroying the window (where we unmap it) in
term_destroy(), lead to a crash in term_mouse_grabbed(), due to
key_binding_for() returning NULL.
The call chain in this is case is, roughly:
term_destroy() ->
wayl_win_destroy() ->
keyboard_leave() ->
term_xcursor_update_for_seat() ->
term_mouse_grabbed()