Commit graph

294 commits

Author SHA1 Message Date
Daniel Eklöf
ae8394b0c1
wip: io-uring 2025-05-08 10:23:06 +02:00
Daniel Eklöf
970e13db8d
config: tweak.surface-bit-depth: add support for 16-bit surfaces
This adds supports for 16-bit surfaces, using the new
PIXMAN_a16b16g16r16 buffer format. This maps to
WL_SHM_FORMAT_ABGR16161616 (little-endian).

Use the new 16-bit surfaces by default, when
gamma-correct-blending=yes.
2025-05-03 09:04:15 +02:00
Daniel Eklöf
85c81042d2
meson: bump version to 1.22.3 2025-05-01 10:20:38 +02:00
Daniel Eklöf
513e91c33a
meson: bump version to 1.22.2 2025-04-30 10:23:51 +02:00
Daniel Eklöf
c85d5d5096
meson: bump version to 1.22.1 2025-04-26 10:36:23 +02:00
Jan Palus
bc8d6d1ff3
build: fix race when generating emoji-variation-sequences.h
d3f692990e moved emoji-variation-sequences.h header inclusion from
vt.c to terminal.c. these two files are part of different libraries
hence target for generating emoji-variation-sequences.h needs to be
moved too.
2025-04-23 11:44:41 +02:00
Daniel Eklöf
95f7b71058
meson: bump version to 1.22.0 2025-04-17 14:41:32 +02:00
Dominique Martinet
34d3f4664b
xkbcommon: require libxkbcommon >= 1.8.0
Trying to build with an older libxkbcommon fails as follow:
```
../input.c: In function ‘keyboard_keymap’:
../input.c:648:82: error: ‘XKB_VMOD_NAME_ALT’ undeclared (first use in this function); did you mean ‘XKB_MOD_NAME_ALT’?
  648 |             xkb_mod_index_t alt = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_VMOD_NAME_ALT);
      |                                                                                  ^~~~~~~~~~~~~~~~~
      |                                                                                  XKB_MOD_NAME_ALT
../input.c:648:82: note: each undeclared identifier is reported only once for each function it appears in
../input.c:649:83: error: ‘XKB_VMOD_NAME_META’ undeclared (first use in this function); did you mean XKB_MOD_NAME_ALT’?
  649 |             xkb_mod_index_t meta = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_VMOD_NAME_META);
      |                                                                                   ^~~~~~~~~~~~~~~~~~
      |                                                                                   XKB_MOD_NAME_ALT
../input.c:650:84: error: ‘XKB_VMOD_NAME_SUPER’ undeclared (first use in this function); did you mean ‘XKB_MOD_NAME_NUM’?
  650 |             xkb_mod_index_t super = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_VMOD_NAME_SUPER);
      |                                                                                    ^~~~~~~~~~~~~~~~~~~
      |                                                                                    XKB_MOD_NAME_NUM
../input.c:651:84: error: ‘XKB_VMOD_NAME_HYPER’ undeclared (first use in this function); did you mean ‘XKB_MOD_NAME_CAPS’?
  651 |             xkb_mod_index_t hyper = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_VMOD_NAME_HYPER);
      |                                                                                    ^~~~~~~~~~~~~~~~~~~
      |                                                                                    XKB_MOD_NAME_CAPS
../input.c:652:87: error: ‘XKB_VMOD_NAME_NUM’ undeclared (first use in this function); did you mean ‘XKB_MOD_NAME_NUM’?
  652 |             xkb_mod_index_t num_lock = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_VMOD_NAME_NUM);
      |                                                                                       ^~~~~~~~~~~~~~~~~
      |                                                                                       XKB_MOD_NAME_NUM
../input.c:653:90: error: ‘XKB_VMOD_NAME_SCROLL’ undeclared (first use in this function); did you mean ‘XKB_LED_NAME_SCROLL’?
  653 |             xkb_mod_index_t scroll_lock = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_VMOD_NAME_SCROLL);
      |                                                                                          ^~~~~~~~~~~~~~~~~~~~
      |                                                                                          XKB_LED_NAME_SCROLL
../input.c:654:90: error: ‘XKB_VMOD_NAME_LEVEL3’ undeclared (first use in this function); did you mean ‘XKB_MOD_NAME_CTRL’?
  654 |             xkb_mod_index_t level_three = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_VMOD_NAME_LEVEL3);
      |                                                                                          ^~~~~~~~~~~~~~~~~~~~
      |                                                                                          XKB_MOD_NAME_CTRL
../input.c:655:89: error: ‘XKB_VMOD_NAME_LEVEL5’ undeclared (first use in this function); did you mean ‘XKB_MOD_NAME_CTRL’?
  655 |             xkb_mod_index_t level_five = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_VMOD_NAME_LEVEL5);
      |                                                                                         ^~~~~~~~~~~~~~~~~~~~
      |                                                                                         XKB_MOD_NAME_CTRL
```
2025-04-07 09:25:11 +02:00
Alex Xu (Hello71)
9b776f2d6d
meson: add foot (render.c) -> srgb.h dep
otherwise, depending on ninja dependency resolution order and parallel
build, srgb.h may not be built in time

Fixes: ccf625b991 ("render: gamma-correct blending")
2025-03-26 18:17:59 +01:00
Daniel Eklöf
df32cd0504
meson: bump version to 1.21.0 2025-03-17 12:04:59 +01:00
Craig Barnes
eb9357709b main/client: simplify code for printing --version string 2025-03-14 20:15:11 +00:00
Daniel Eklöf
d48a1c53f5
meson: require wayland-protocols >= 1.41 2025-03-13 13:28:34 +01:00
Daniel Eklöf
a79fd6a7cf
meson: require fcft-3.3.1
fcft-3.3.0 is not binary compatible with 3.2.x, and earlier.
2025-03-13 13:23:25 +01:00
Daniel Eklöf
7f11ba59ef
fcft: require fcft >= 3.3.0, add support for new scaling-filters
Update tweak.scaling-filter to recognize the new scaling filters added
in fcft-3.3.0.

Since fcft_set_scaling_filter() is deprecated in 3.3.0, don't use it
anymore, and set the scaling filter via fcft_font_options instead.
2025-03-12 10:03:06 +01:00
Daniel Eklöf
ccf625b991
render: gamma-correct blending
This implements gamma-correct blending, which mainly affects font
rendering.

The implementation requires compile-time availability of the new
color-management protocol (available in wayland-protocols >= 1.41),
and run-time support for the same in the compositor (specifically, the
EXT_LINEAR TF function and sRGB primaries).

How it works: all colors are decoded from sRGB to linear (using a
lookup table, generated in the exact same way pixman generates it's
internal conversion tables) before being used by pixman. The resulting
image buffer is thus in decoded/linear format. We use the
color-management protocol to inform the compositor of this, by tagging
the wayland surfaces with the 'ext_linear' image attribute.

Sixes: all colors are sRGB internally, and decoded to linear before
being used in any sixels. Thus, the image buffers will contain linear
colors. This is important, since otherwise there would be a
decode/encode penalty every time a sixel is blended to the grid.

Emojis: we require fcft >= 3.2, which adds support for sRGB decoding
color glyphs. Meaning, the emoji pixman surfaces can be blended
directly to the grid, just like sixels.

Gamma-correct blending is enabled by default *when the compositor
supports it*. There's a new option to explicitly enable/disable it:
gamma-correct-blending=no|yes. If set to 'yes', and the compositor
does not implement the required color-management features, warning
logs are emitted.

There's a loss of precision when storing linear pixels in 8-bit
channels. For this reason, this patch also adds supports for 10-bit
surfaces. For now, this is disabled by default since such surfaces
only have 2 bits for alpha. It can be enabled with
tweak.surface-bit-depth=10-bit.

Perhaps, in the future, we can enable it by default if:

* gamma-correct blending is enabled
* the user has not enabled a transparent background
2025-03-05 18:45:01 +01:00
Daniel Eklöf
10c4e94e1b
Merge branch 'releases/1.20' 2025-01-18 09:43:57 +01:00
Daniel Eklöf
771af699f0
meson: bump version to 1.20.2 2025-01-18 09:25:36 +01:00
Daniel Eklöf
f7031a2161
meson: fix dependencies (utf8proc missing in lots of places) 2025-01-18 09:23:29 +01:00
Daniel Eklöf
2a07a2e6b9
Add support for the new Wayland protocol xdg-system-bell
From the release notes:

    system bell - allowing e.g. terminal emulators to hand off system
    bell alerts to the compositor for among other things accessibility
    purposes

The new protocol is used when the new config option
bell.system=yes (and the compositor implements the protocol,
obviously).

The system bell is rung independent of whether the foot window has
keyboard focus or not (thus relying on compositor configuration to
determine whether anything should be done or not in response to the
bell).

The new option is enabled by default.
2025-01-17 10:21:50 +01:00
Daniel Eklöf
a2960aa457
meson: fix dependencies (utf8proc missing in lots of places) 2025-01-04 10:22:29 +01:00
Daniel Eklöf
b0e6645395
meson: bump version to 1.20.1 2025-01-03 08:01:35 +01:00
Daniel Eklöf
9b1c31ebcb
meson: bump version to 1.20.0 2025-01-01 09:21:51 +01:00
Daniel Eklöf
cb91fbb4b6
meson: bump version to 1.19.0 2024-10-23 13:51:15 +02:00
Daniel Eklöf
5ef69fc591
meson: detect wayland-protocols >= 1.37, and conditionally enable xdg-toplevel-icon-v1 2024-09-13 09:04:17 +02:00
Craig Barnes
d4a1283797
xsnprintf: various improvements related to xvsnprintf() and xsnprintf()
Summary of changes:

* Make xvsnprintf() static
* restrict-qualify pointer arguments (as done by the libc equivalents)
* Make comments and spec references more thorough
* Remove pointless `n <= INT_MAX` assertion (see comment)
* Use FATAL_ERROR() instead of xassert() (since the assertion is inside
  a shared util function but the caller is responsible for ensuring the
  condition holds true)
* Change some callers to use size_t instead of int for the return value
  (negative returns are impossible and all subsequent uses are size_t)

The updated comments and code were taken (and adapted) from:

49260bb154/src/util/xsnprintf.c (L6-50)

This work was entirely authored by me and I hereby license this
contribution under the MIT license (stated explicitly, so that
there's no ambiguity w.r.t. the original license).
2024-09-13 09:01:15 +02:00
Daniel Eklöf
c8185aec1d
desktop: rename to foot{,client,-server}.desktop
That is, skip the reverse DNS naming scheme suggested by the .desktop
specification, and directly match our app-ids ("foot", and
"footclient").

This simplifies .desktop -> window instance mapping, allowing DEs to
match the filenames directly, without having to look at the
StartupWMClass key in the .desktop files.

These are the original names of the .desktop files. There were
renamed (to use the reverse DNS syntax) to please the flathub people,
who *required* this scheme to accept the foot package.

But, since:

* We don't package foot ourselves
* We don't go out of our way to support non-distro packaging schemes
* Flathub still hasn't merged the foot PR (it's now 2 years old)
* There are no know issues in any known DE that prevents a non-reverse
  DNS .desktop filename from working
* There are plenty of other applications that doesn't use reverse DNS
  names (a very clear majority, in my case)

Let's just revert back to the simpler naming scheme.

Closes #1607
2024-09-08 13:06:27 +02:00
Daniel Eklöf
ce9c9f6be6
meson: bump version to 1.18.1 2024-08-14 12:00:20 +02:00
Daniel Eklöf
803f712332
meson: add "prefix: '#include <unistd.h>" to cc.has_function()
When checking for execvpe, include <unistd.h>
2024-08-09 08:15:13 +02:00
Shogo Yamazaki
9d5d84a835
meson: fix false positive detection of memfd_create
Add the arguments to `has_function` to properly detect availability of the
function on SDK environments.
2024-08-09 08:14:12 +02:00
Daniel Eklöf
b5e692ef8b
meson: bump version to 1.18.0 2024-08-02 14:28:16 +02:00
Daniel Eklöf
065eb05e3e
meson/pgo: fix PGO build errors with recent meson(?) versions
The back-reference to 'tokenize.c' in the parent directory causes PGO
build failures, where gcc can't find the PGO data. Likely due to
path/naming issues caused by meson's generated build directories.
2024-07-18 09:02:42 +02:00
Daniel Eklöf
9665661445
vt: only apply VS-15/16 to valid sequences
At compile time, build a lookup table from the Unicode data file
'emoji-variation-sequences.txt'.

At run-time, when we detect a VS-15/16 sequence, do a lookup in this
table, and enforce the variation selector iff the sequence is valid.

Closes #1742
2024-06-25 08:20:21 +02:00
Jan Beich
f67449700b
meson: auto-detect execvpe on FreeBSD
0667d0e0e3
2024-06-07 16:31:11 +02:00
Daniel Eklöf
3c96d0b68e
render: use single-pixel buffers for overlays, when possible
The unicode-mode, and flash overlays are single color buffers. This
means we can use the single-pixel buffer protocol.

It's undefined whether the compositor will release the buffer or not;
to make things easier, simply destroy the buffer as soon as we've
committed it.

Note that since compositors don't necessarily release single-pixel
buffers, we can't plug them into our own buffer interface. This means
we can't use buffer pointers to check if we can re-use the previous
buffer (i.e. we can skip comitting a new buffer), or if we have to
create a new one.

It's _almost_ enough to just check if the last overlay style is the
same as the current one. Except that that doesn't take window resizes
into account...
2024-05-22 13:48:46 +02:00
Daniel Eklöf
b88f0d672f
meson: bump version to 1.17.2 2024-04-17 11:26:45 +02:00
Daniel Eklöf
04ebd02874
meson: bump version to 1.17.1 2024-04-11 15:28:17 +02:00
Daniel Eklöf
21951feb2b
meson: bump version to 1.17.0 2024-04-02 16:27:54 +02:00
Daniel Eklöf
8b3dbf0972
meson: bump version to 1.16.2 2023-10-17 17:24:12 +02:00
Daniel Eklöf
195eb3356a
meson: bump version to 1.16.1 2023-10-12 16:36:18 +02:00
Daniel Eklöf
a9d6eaf937
meson: bump version to 1.16.0 2023-10-11 18:15:01 +02:00
Daniel Eklöf
34520aa16e
meson: allow building with wayland-protocols as a subproject 2023-08-08 19:32:45 +02:00
Daniel Eklöf
698c5b54f3
wayland: cursor-shape-v1 is now always available
Since we're requiring wayland-protocols >= 1.32
2023-08-07 16:53:19 +02:00
Daniel Eklöf
7eee415b75
wayland: fractional-scale-v1 is now always available
Since we're requiring wayland-protocols >= 1.32
2023-08-07 16:53:19 +02:00
Daniel Eklöf
d59a4e7a77
wayland: xdg-activation is now always available
Since we're requiring wayland-protocols >= 1.32
2023-08-07 16:53:19 +02:00
Daniel Eklöf
e0475a5421
meson: require wayland-protocols >= 1.32 2023-08-07 16:53:19 +02:00
Daniel Eklöf
f314699945
meson: bump version to 1.15.3 2023-08-07 16:39:54 +02:00
Daniel Eklöf
53a5d62e5a
meson: bump version to 1.15.2 2023-07-30 13:18:55 +02:00
Daniel Eklöf
139fd6d55c
meson: add -Dterminfo-base-name option
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'
2023-07-28 15:40:53 +02:00
Daniel Eklöf
9e4d82a484
meson: bump version to 1.15.1 2023-07-21 08:57:03 +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