Commit graph

6684 commits

Author SHA1 Message Date
Daniel Eklöf
ce424e0990
scripts: srgb: use 2.2 gamma TF instead of piece-wise sRGB TF 2025-04-30 10:20:52 +02:00
Daniel Eklöf
1ea20b1b70
changelog: add new 'unreleased' section 2025-04-30 10:19:47 +02:00
Daniel Eklöf
c85d5d5096
meson: bump version to 1.22.1 2025-04-26 10:36:23 +02:00
Daniel Eklöf
89bfac00e7
changelog: prepare for 1.22.1 2025-04-26 10:36:13 +02:00
Daniel Eklöf
9d0b048cf9
Merge branch 'master' into releases/1.22 2025-04-26 10:34:56 +02:00
Daniel Eklöf
0020ef12b4
changelog: add missing bug ref 2025-04-26 10:31:09 +02:00
Daniel Eklöf
cb1b7ba0c5
render: regression: alpha applied to inversed text/selections
Introduced by 5f83278afd

Closes #2073
2025-04-25 19:20:36 +02:00
Daniel Eklöf
d43326d2b5
changelog: zero-width grapheme breaking codepoints causing fallback font to be used 2025-04-24 18:40:22 +02:00
Daniel Eklöf
1fec0cf5ea
Revert "term: append zero-width grapheme breaking characters to previous cell"
This reverts commit 76503fb86a.
2025-04-24 18:22:37 +02:00
Daniel Eklöf
1b15cc5f3d
Revert "term: ignore LTR+RTL markers (U+200E + U+200F)"
This reverts commit 70b324b24c.
2025-04-24 18:20:18 +02:00
Daniel Eklöf
70b324b24c
term: ignore LTR+RTL markers (U+200E + U+200F)
Foot doesn't implement RTL, and explicit LTR markers is neither
needed, nor used in anyway. In fact, they cause issues with font
lookup, as fcft often fails to find the marker codepoint in the
primary font, causing a fallback font to be used instead.

Closes #2049
2025-04-24 08:23:56 +02:00
valoq
b2dfd339e4
Add alacritty theme
This adds the default colors from alacritty  as an additional theme
2025-04-23 12:08:37 +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
8bded8ce8c
doc: foot.ini: add newish Unicode range to 'box-drawings-uses-font-glyphs' 2025-04-19 17:10:52 +02:00
Daniel Eklöf
ef4a680ae8
input: reset modifiers in keyboard_leave()
Closes #2034
2025-04-19 13:36:13 +02:00
Daniel Eklöf
cb2a64c585
csi: don't allow client app to enable grapheme-shaping when disabled at compile-time
Closes #2039
2025-04-19 13:35:06 +02:00
Daniel Eklöf
1a2e5f4932
render: fix colors.alpha-mode=matching
Before this patch, it only matched RGB color sources. It did not match
the default bg color, or indexed colors. That is, e.g. CSI 43m didn't
apply alpha, even if the color3 matched the default background color.
2025-04-19 13:33:23 +02:00
Daniel Eklöf
1bf9156628
doc: foot.ini: spaces -> tab (for indentation) 2025-04-19 11:59:50 +02:00
Daniel Eklöf
179e14e0a1
doc: foot.ini: gamma-correct-blending: mention colors being off 2025-04-19 09:16:28 +02:00
Daniel Eklöf
155c7c96b7
doc: foot.ini: key-bindings: untranslated symbols are tried before translated 2025-04-18 14:43:36 +02:00
Daniel Eklöf
30aafce82d
foot.ini: move alpha-mode to colors section
This is where the config parser expects it
2025-04-18 13:59:43 +02:00
Daniel Eklöf
6e5a602f67
changelog: add new 'unreleased' section 2025-04-17 14:44:05 +02:00
Daniel Eklöf
9799c4ddcd
Merge branch 'releases/1.22' 2025-04-17 14:42:52 +02:00
Daniel Eklöf
95f7b71058
meson: bump version to 1.22.0 2025-04-17 14:41:32 +02:00
Daniel Eklöf
2c8214f6ea
changelog: prepare for 1.22.0 2025-04-17 14:41:13 +02:00
datsudo
b46a9aa6d7
themes: add "Night Owl" theme 2025-04-15 07:36:41 +02:00
Daniel Eklöf
9ba8caf30b
doc: foot.ini: add colors.alpha-mode 2025-04-14 17:02:45 +02:00
Daniel Eklöf
f7807c0f4c
tests: config: test colors.alpha-mode 2025-04-14 17:00:07 +02:00
Daniel Eklöf
d2d4f53861
config+render: move alpha-mode to colors.alpha-mode, fix cursor handling
Move main.alpha-mode to colors.alpha-mode.

Fix (inverted) cursor handling, by always using the bg color without
alpha.

Do a minor optimization, where we don't even lock at colors.alpha-mode
if there's no transparency configured.
2025-04-14 16:58:23 +02:00
Daniel Eklöf
bacfba135d
changelog: move 'alpha-mode' to next-release 2025-04-14 16:48:44 +02:00
Fazzi
5f83278afd
config: add alpha_mode option 2025-04-14 16:47:45 +02:00
Daniel Eklöf
9a6227acb3
doc: foot.ini: workers: "if you have a ridiculous number of cores" 2025-04-14 07:03:37 +02:00
Daniel Eklöf
b93d2f042c
url-mode: fix double-width characters not being handled correctly
When a regex matches a string containing double-width characters, the
CELL_SPACER values were included in the URL string. This meant the
final URL (either launched, or copied) weren't handled correctly, as
invalid UTF-8 sequences were inserted in the middle of the string.

Closes #2027
2025-04-13 08:28:13 +02:00
Daniel Eklöf
bc2e0a29bb
changelog: move vmod support in config from "changed" to "added" 2025-04-10 12:18:34 +02:00
Daniel Eklöf
23431e3ecf
wayland+input: add support for toplevel edge constraints
Edge constraints are new (not yet available in a wayland-protocols
release) toplevel states, acting as a complement to the existing tiled
states.

Tiled tells us we shouldn't draw shadows etc *outside our window
geometry*.

Constrained tells us the window cannot be resized in the constrained
direction.

This patch does a couple of things:

* Recognize the new states when debug logging

* Change is_top_left() etc to look at the new constrained state
  instead of the tiled state. These functions are used when both
  choosing cursor shape, and when determining if/how to resize a
  window on a CSD edge click-and-drag.

* Update cursor shape selection to use the default (left_ptr) shape
  when on a constrained edge (or corner).

* Update CSD resize triggering, to not trigger a resize when attempted
  on a constrained edge (or corner).

See
86750c99ed:

    An edge constraint is an complementery state to the tiled state,
    meaning that it's not only tiled, but constrained in a way that it
    can't resize in that direction.

    This typically means that the constrained edge is tiled against a
    monitor edge. An example configuration is two windows tiled next
    to each other on a single monitor. Together they cover the whole
    work area.

    The left window would have the following tiled and edge constraint
    state:

        [ tiled_top, tiled_right, tiled_bottom, tiled_left,
          constrained_top, constrained_bottom, constrained_left ]

    while the right window would have the following:

        [ tiled_top, tiled_right, tiled_bottom, tiled_left,
          constrained_top, constrained_bottom, constrained_right ]

    This aims to replace and deprecate the
    `gtk_surface1.configure_edges` event and the
    `gtk_surface1.edge_constraint` enum.
2025-04-07 13:41:37 +02:00
Dominique Martinet
091aa90f1a
wayland: handle xdg-shell edge constraints
wayland-protocols commit 86750c99ed06 ("xdg-shell: Add edge
constraints") added a few more enums to handle, making the build fail
with -Werror:
../wayland.c: In function ‘xdg_toplevel_configure’:
../wayland.c:878:9: error: enumeration value ‘XDG_TOPLEVEL_STATE_CONSTRAINED_LEFT’ not handled in switch [-Werror=switch]
  878 |         switch (*state) {
      |         ^~~~~~
../wayland.c:878:9: error: enumeration value ‘XDG_TOPLEVEL_STATE_CONSTRAINED_RIGHT’ not handled in switch [-Werror=switch]
../wayland.c:878:9: error: enumeration value ‘XDG_TOPLEVEL_STATE_CONSTRAINED_TOP’ not handled in switch [-Werror=switch]
../wayland.c:878:9: error: enumeration value ‘XDG_TOPLEVEL_STATE_CONSTRAINED_BOTTOM’ not handled in switch [-Werror=switch]

(This is not part of any release yet, but can be used when building with
the submodule)

From a quick look it sounds like the meaning is the same as tiling as
far as we are concerned so handle these as we do of tiling.
2025-04-07 13:03:30 +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
Łukasz Wojniłowicz
bdf65672c0
Themes: Add 'Molokai' theme 2025-04-07 09:19:34 +02:00
Daniel Eklöf
1760cb6ab8
config: update default URL regex
The old one is in some cases too liberal. The new one is stricter in
two ways:

1. The protocol list is now explicit, rather than matching anything://
2. Allowed characters are now limited to the "safe character set", the
   "reserved character set", and some from the "unsafe character set"

Furthermore, some of the characters are restricted in how/when they
are allowed:

1. Periods, commas, question marks etc are allowed inside an URL, but
   not at the end.
2. [ ], ( ), " " and ' ' are allowed but only when balanced. This
   allows us to match e.g. [http://foo.bar/foo[bar]] correctly.

Closes #2016
2025-04-07 09:11:16 +02:00
Daniel Eklöf
a50f78c599
Merge branch 'kbd-no-virtual-modifiers'
Closes #2009
2025-03-31 13:04:02 +02:00
Daniel Eklöf
0d8c7db962
changelog: reword, and remove section that no longer applies 2025-03-31 11:08:22 +02:00
Daniel Eklöf
a43614f098
doc: foot.ini: mention virtual modifiers are allowed 2025-03-31 10:25:14 +02:00
Daniel Eklöf
dc99cf7358
key-binding: recognize virtual modifiers, and translate to the corresponding real modifier. 2025-03-31 10:25:06 +02:00
Daniel Eklöf
58910856c8
input: xkb: ignore virtual modifiers
Some compositors (mutter/GNOME is one) adds _virtual_ modifiers to the
set of active modifiers when e.g. Alt, Meta, Super or Hyper is
pressed. For example, pressing Alt+b would result in *both* the Alt
*and* the Mod1 modifier being set.

Since foot makes close to zero assumptions on how the modifiers should
be interpreted, this causes various breakages.

For example, a foot shortcut defined as Mod1+b will not match, since
the Alt modifiers is also set. This has forced users to
redefine/override some of the default key bindings to include the
additional modifiers.

It also causes issues with the kitty keyboard protocol, for some key
combinations. Mainly whether or not to use unshifted key or not,
resulting in incorrect escape sequences.

Since all the "real" modifiers are always set as well, we can safely
ignore the virtual modifiers.

Closes #2009
2025-03-31 08:08:43 +02:00
Daniel Eklöf
c8470f40c1
grid: reflow: fix empty line coalescing
If a range of empty lines ended with a non-empty line at the very
bottom of the to-be-resized grid, all those empty lines were removed.

Closes #2011
2025-03-29 10:16:31 +01: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
6922ab2b8e
doc: foot.ini: gamma-correct: move section 2025-03-23 17:00:19 +01:00
Sam McCall
663c9082db
render: dim and brighten using linear rgb interpolation
Adds setting tweak.dim-amount, similar to bold-text-in-bright-amount.

Closes #2006
2025-03-23 15:24:23 +01:00
Daniel Eklöf
5f72f51ae8
changelog: url-mode: show-urls-persistent regression fix 2025-03-20 08:52:19 +01:00
llyyr
cc99db5bc4
url-mode: fix crash when opening multiple urls with persist mode
Fixes: 051cd6ecfc
Closes #2000
2025-03-20 08:52:10 +01:00