Commit graph

5920 commits

Author SHA1 Message Date
Daniel Eklöf
f3c5b82c82
config: add tweak.bold-text-in-bright-amount
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
2023-07-28 15:40:07 +02:00
Daniel Eklöf
e912656682
render: revert part of a36f67cbe3
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.
2023-07-28 15:37:48 +02:00
Daniel Eklöf
fd813d0e6c
font baseline: use max(font->height, font->ascent + font->descent) when calculating font height
This is how it's done when calculating the cell height, and we should
do the same thing when calculating the font baseline.
2023-07-28 15:36:48 +02:00
Daniel Eklöf
613c61abb4
scaling: always round the scaling factor when converting to int
* 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()
2023-07-25 16:48:50 +02:00
Daniel Eklöf
391bc119de
ci (sr.ht): alpine no longer allows pip installing to the system installation 2023-07-25 16:47:40 +02:00
Daniel Eklöf
76e471c4bc
ci: alpine no longer allows pip installing to the system installation 2023-07-25 16:45:29 +02:00
Daniel Eklöf
a36f67cbe3
render: apply new baseline calculation everywhere
* URL jump labels
* Scrollback position indicator
* Line/box drawings characters

Closes #1430
2023-07-25 15:53:29 +02:00
Daniel Eklöf
0a61cfc3be
wayland: update terminals (fonts etc) on xdg_output_handle_done()
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
2023-07-23 20:12:13 +02:00
Daniel Eklöf
57d8f74554
Merge branch 'invalid-utf8'
Closes #1423
2023-07-23 20:10:57 +02:00
Daniel Eklöf
8223b4b76c
changelog: ignore invalid UTF-8 in input 2023-07-22 11:23:22 +02:00
Daniel Eklöf
b59fd7c388
vt: detect and ignore invalid UTF-8 sequences
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
2023-07-22 11:21:41 +02:00
Daniel Eklöf
fc973a3bb9
selection: send_clipboard_or_primary(): handle selection text being NULL 2023-07-22 11:21:12 +02:00
Daniel Eklöf
15d7885c78
changelog: add new ‘unreleased’ section 2023-07-21 09:00:57 +02:00
Daniel Eklöf
d68d5faa05
Merge branch 'releases/1.15' 2023-07-21 09:00:39 +02:00
Daniel Eklöf
9e4d82a484
meson: bump version to 1.15.1 2023-07-21 08:57:03 +02:00
Daniel Eklöf
fa97df0eab
changelog: prepare for 1.15.1 2023-07-21 08:56:49 +02:00
Daniel Eklöf
62c6c9a78a
Merge branch 'master' into releases/1.15 2023-07-21 08:55:57 +02:00
Daniel Eklöf
b3255465f1
render: change baseline calculation, to center it within the line
Before this patch, fonts were anchored to the top of the line. With
this patch, it is instead centered.

Closes #1302
2023-07-21 08:17:32 +02:00
Daniel Eklöf
098f0aafd4
Merge branch 'systemd-units-socket-activation' 2023-07-21 08:13:51 +02:00
Max Gautier
478474d0ce
Changelog: standard system target + footclient fallback 2023-07-21 08:13:36 +02:00
Max Gautier
555edd60d4
Update documentation regarding systemd units 2023-07-21 08:12:55 +02:00
Max Gautier
d3ffb0bde1
Ties systemd units to graphical-session.target
- 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.
2023-07-21 08:12:55 +02:00
Max Gautier
c12db68363
footclient: fallback logic when socket paths don't exist
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.
2023-07-21 08:12:49 +02:00
CismonX
c3b119ea81
vt: improve handling of HTS
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.
2023-07-20 08:47:40 +08:00
Daniel Eklöf
a49281ced3
render: OSD: don’t mark surface as being opaque, when it’s not 2023-07-19 16:43:18 +02:00
Daniel Eklöf
899b768b74
render: disable transparency when we’re fullscreened
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
2023-07-19 16:42:41 +02:00
Daniel Eklöf
648f6016e3
changelog: spelling: sacling -> scaling 2023-07-19 16:37:25 +02:00
Daniel Eklöf
fdd753263b
term: destroy: unref key bindings *after* destroying window
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()
2023-07-18 18:26:28 +02:00
Daniel Eklöf
27b4c2ac2d
themes: starlight: update to V4
This also updates the default theme in foot, as well as the
documentation.

Closes #1409
2023-07-18 16:20:33 +02:00
Daniel Eklöf
023a1b8da6
changelog: crash on pointer capability loss 2023-07-18 16:12:43 +02:00
xdavidwu
0b8791d1c5
wayland: fix pointer cap lost handling
Before this, on compositor without cursor-shape support, a pointer
capability lost of the seat makes foot crash.
2023-07-18 16:09:31 +02:00
Daniel Eklöf
e6d1e0cc27
Merge branch 'scale-is-floating-point'
Closes #1404
2023-07-18 16:06:37 +02:00
Daniel Eklöf
4a4f2b5dae
pgo: add stub for wayl_fractional_scaling() 2023-07-18 05:48:22 +02:00
Daniel Eklöf
df96b7f4c0
changelog: wrong DPI, and wrong initial font size with fractional scaling 2023-07-18 05:48:21 +02:00
Daniel Eklöf
5b3b89cb64
changelog: monitor metadata is now picked from the one we were last mapped on 2023-07-18 05:48:02 +02:00
Daniel Eklöf
7fca81dd3f
term: get_font_subpixel(): use subpixel from monitor we were *last* mapped on 2023-07-18 05:48:02 +02:00
Daniel Eklöf
21d99f8dce
terminal: break out scaling factor updating, and reduce number of calls to render_resize()
Break out the logic that updates the terminal’s scaling factor value,
from render_resize(), to a new function, term_update_scale(). This
allows us to update the scaling factor without a full grid resize.

We also change how we pick the scaling factor (when fractional scaling
is not in use). Before, we’d use the highest scaling factor from all
monitors we were mapped on. Now, we use the scaling factor from the
monitor we were *last* mapped on.

Then, add a boolean parameter to term_set_fonts(), and when
false, *don’t* call render_resize_force().

Also change term_font_dpi_changed() to only return true if the font
was changed in any way.

Finally, rewrite update_term_for_output_change() to:

* Call term_update_scale() before doing anything else
* Call render_resize{,_force} *last*, and *only* if either the scale
  or the fonts were updated.

This fixes several things:

* A bug where we failed to update the fonts when fractional scaling
  was in use, and we guessed the initial scale/DPI wrong. The bug
  happened because updated the internal "preferred" scale value, and a
  later call to render_resize() updated the terminal’s scale value,
  but since that code path didn’t call term_font_dpi_changed() (and it
  shouldn’t), the fonts weren’t resized properly.

* It ensures we only resize the grid *once* when the scaling factor,
  or DPI is changed. Before this, we’d resize it twice. And this
  happened when e.g. dragging the window between monitors.
2023-07-18 05:48:01 +02:00
Daniel Eklöf
c96863b188
wayland: error out if there aren’t any monitors available 2023-07-18 05:48:01 +02:00
Daniel Eklöf
b2a29280cb
wayland: use physical DPI on fractional-scale capable compositors
With legacy scaling, we need to use a "scaled", or "logical" DPI
value, that is basically the real DPI value scaled by the monitor’s
scaling factor.

This is necessary to compensate for the compositor downscaling the
surface, for "fake" fractional scaling.

But with true fractional scaling, *we* scale the surface to the final
size. This means we should *not* use the scaled DPI, but the monitor’s
actual DPI.

To facilitate this, store both the scaled and the unscaled DPI value
in the monitor struct.

This patch also changes how we pick the DPI value. Before, we would
use the highest DPI value from all the monitors we were mapped
on. Now, we use the DPI value from the monitor we were *last* mapped
on (typically the window we’re dragging the window *to*).
2023-07-18 05:48:01 +02:00
Daniel Eklöf
59f0a721c4
wayland: fractional_scale_preferred_scale(): only push update if scale has changed
Also, drop wl_window::have_preferred_scale. Check for scale > 0 instead.
2023-07-18 05:48:01 +02:00
Daniel Eklöf
829353a5da
term: font_dpi_changed: scale (and old_scale) are floating point
This should fix an issue where the font size wasn’t updated when
moving the window between outputs whose scaling factors match when
truncated.
2023-07-18 05:48:01 +02:00
Daniel Eklöf
2fd29cbf50
term: (debug): dpi_aware is no longer an enum 2023-07-18 05:48:01 +02:00
Ayush Agarwal
da81b63ec0
themes: add chiba-dark theme 2023-07-18 05:46:00 +02:00
Daniel Eklöf
6de69aa9b7
render: fix xcursor scaling with fractional-scale-v1
This worked just after the fractional-scaling branch was merged, but
was then broken by the cursor-shape branch, due to a bad rebase of
that branch.
2023-07-18 05:44:17 +02:00
CismonX
8b4cb2457a
input: do not ignore touch events on the CSDs 2023-07-16 20:41:33 +08:00
Ronan Pigott
b7100d5716 render: use rounding for fractional scale
If we truncate the buffer dimensions we may accidentally submit a
buffer with inappropriate size.
2023-07-15 20:03:16 -07:00
Daniel Eklöf
d1df98e0ca
changelog: add new ‘unreleased’ section 2023-07-14 12:40:55 +02:00
Daniel Eklöf
bee4a96b45
Merge branch 'releases/1.15' 2023-07-14 12:40:35 +02:00
Daniel Eklöf
5a3706ac46
meson: bump version to 1.15.0 2023-07-14 12:26:03 +02:00
Daniel Eklöf
53b0eb8e1b
changelog: prepare for 1.15.0 2023-07-14 12:25:16 +02:00