diff --git a/CHANGELOG.md b/CHANGELOG.md index 374d0c2c..2f2e9d88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Changelog +* [Unreleased](#unreleased) * [1.22.0](#1-22-0) * [1.21.0](#1-21-0) * [1.20.2](#1-20-2) @@ -59,6 +60,35 @@ * [1.2.0](#1-2-0) +## Unreleased +### Added +### Changed +### Deprecated +### Removed +### Fixed + +* `colors.alpha-mode=matching` not working as intended. +* Grapheme shaping was allowed to be "enabled" at runtime, even though + disabled at compile time. This caused mis-rendering of certain + codepoints ([#2039][2039]). +* Keyboard modifiers not being reset on keyboard leave events + ([#2034][2034]). +* Fallback font (and possibly wrong color) being used when a character + was followed by a zero-width grapheme breaking codepoint (for + example, _LEFT-TO-RIGHT MARK_) ([#2049][2049]). +* Regression: alpha applied to inversed text/selections + ([#2073][2073]). + +[2039]: https://codeberg.org/dnkl/foot/issues/2039 +[2034]: https://codeberg.org/dnkl/foot/issues/2034 +[2049]: https://codeberg.org/dnkl/foot/issues/2049 +[2073]: https://codeberg.org/dnkl/foot/issues/2073 + + +### Security +### Contributors + + ## 1.22.0 ### Added @@ -206,9 +236,9 @@ enabled ([#1947][1947]). * Reflow of the cursor (active + saved) when at the end of the line with a pending wrap (LCF set) ([#1954][1954]). -* Zero-width characters that also are grapheme breaks (e.g. U+200B, +* ~~Zero-width characters that also are grapheme breaks (e.g. U+200B, ZERO WIDTH SPACE) being ignored (discarded and never stored in the - grid) ([#1960][1960]). + grid) ([#1960][1960]).~~ (reverted) * `--server=` not working on FreeBSD ([#1956][1956]). * Crash when resetting the terminal and an application had previously set a custom app ID ([#1963][1963]) diff --git a/csi.c b/csi.c index 81c71e31..b66fda21 100644 --- a/csi.c +++ b/csi.c @@ -558,7 +558,9 @@ decset_decrst(struct terminal *term, unsigned param, bool enable) break; case 2027: +#if defined(FOOT_GRAPHEME_CLUSTERING) term->grapheme_shaping = enable; +#endif break; case 2048: diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd index 083a1087..cffbf9c5 100644 --- a/doc/foot.ini.5.scd +++ b/doc/foot.ini.5.scd @@ -220,10 +220,11 @@ empty string to be set, but it must be quoted: *KEY=""*) than intended when rendered with gamma-correct blending, since the font designer set the font weight based on incorrect rendering. - You may also want to enable 10-bit image buffers when - gamma-correct blending is enabled. Though probably only if you do - not use a transparent background (with 10-bit buffers, you only - get 2 bits alpha). See *tweak.surface-bit-depth*. + Note that some colors (especially dark ones) will look a bit + off. The reason for this is loss of color precision, due to foot + using 8-bit surfaces (i.e. each color channel is 8 bits). The + amount of errors can be reduced by using 10-bit surfaces; see + *tweak.surface-bit-depth*. Default: enabled when compositor support is available @@ -249,6 +250,7 @@ empty string to be set, but it must be quoted: *KEY=""*) - U+02500 - U+0259F - U+02800 - U+028FF + - U+1CD00 - U+1CDE5 - U+1Fb00 - U+1FB9B Default: _no_. @@ -1190,17 +1192,18 @@ different approaches. As an example, let's say you press ctrl+shift+c (assume plain us ASCII layout). XKB will tell foot *Control+C* was pressed. Note the lack of the shift modifier, and the upper case 'C'. Internally, this is called -the "translated" form, and is what foot tries to match first. +the "translated" form. -If no "translated" key bindings can be found, foot proceeds to -checking the "untranslated" variant. Using the same example as above, -this will match *Control+Shift+c* (shift modifier present, lower case -'c'). +The "untranslated" form (*Control+Shift+c*) is derived from the +translated form, and is what foot tries to match first. + +If no "untranslated" key bindings can be found, foot proceeds to +checking the "translated" variant. This means you can use either form in your foot configuration, and -that *Control+C* (and similar) has higher priority than -*Control+Shift+c*. Also note that while foot normally detects when the -same combination is assigned to multiple actions, it will not detect +that *Control+Shift+c* (and similar) has higher priority than +*Control+C*. Also note that while foot normally detects when the same +combination is assigned to multiple actions, it will not detect *Control+C* vs. *Control+Shift+c* collisions. Call it a known bug... Finally, foot tries to match the raw key code. Here, the primary @@ -1977,13 +1980,13 @@ any of these options. best option. When *gamma-correct-blending* is enabled, you may want to enable - 10-bit surfaces, as that improves the color resolution. Be aware + 10-bit surfaces, as that improves color precision. Be aware however, that in this mode, the alpha channel is only 2 bits instead of 8 bits. Thus, if you are using a transparent background, you may want to use the default, *8-bit*, even if you have gamma-correct blending enabled. - You should also note that 10-bit surface is slower. This will + You should also note that 10-bit surface is much slower. This will increase input latency and decrease rendering throughput. Default: _8-bit_ diff --git a/foot.ini b/foot.ini index 0981e180..7d96ca0f 100644 --- a/foot.ini +++ b/foot.ini @@ -38,8 +38,6 @@ # utmp-helper=/usr/lib/utempter/utempter # When utmp backend is ‘libutempter’ (Linux) # utmp-helper=/usr/libexec/ulog-helper # When utmp backend is ‘ulog’ (FreeBSD) -# alpha-mode=default # Can be `default`, `matching` or `all` - [environment] # name=value @@ -102,6 +100,7 @@ [colors] # alpha=1.0 +# alpha-mode=default # Can be `default`, `matching` or `all` # background=242424 # foreground=ffffff # flash=7f7f00 diff --git a/input.c b/input.c index 0f2a8446..d7a7975a 100644 --- a/input.c +++ b/input.c @@ -765,9 +765,17 @@ keyboard_leave(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, seat->kbd.alt = false; seat->kbd.ctrl = false; seat->kbd.super = false; + if (seat->kbd.xkb_compose_state != NULL) xkb_compose_state_reset(seat->kbd.xkb_compose_state); + if (seat->kbd.xkb_state != NULL && seat->kbd.xkb_keymap != NULL) { + const xkb_layout_index_t layout_count = xkb_keymap_num_layouts(seat->kbd.xkb_keymap); + + for (xkb_layout_index_t i = 0; i < layout_count; i++) + xkb_state_update_mask(seat->kbd.xkb_state, 0, 0, 0, i, i, i); + } + if (old_focused != NULL) { seat->pointer.hidden = false; term_xcursor_update_for_seat(old_focused, seat); diff --git a/meson.build b/meson.build index ed2dc7e4..3d97040d 100644 --- a/meson.build +++ b/meson.build @@ -253,7 +253,7 @@ vtlib = static_library( 'osc.c', 'osc.h', 'sixel.c', 'sixel.h', 'vt.c', 'vt.h', - builtin_terminfo, emoji_variation_sequences, srgb_funcs, + builtin_terminfo, srgb_funcs, wl_proto_src + wl_proto_headers, version, dependencies: [libepoll, pixman, fcft, tllist, wayland_client, xkb, utf8proc], @@ -265,6 +265,7 @@ pgolib = static_library( 'grid.c', 'grid.h', 'selection.c', 'selection.h', 'terminal.c', 'terminal.h', + emoji_variation_sequences, wl_proto_src + wl_proto_headers, dependencies: [libepoll, pixman, fcft, tllist, wayland_client, xkb, utf8proc], link_with: vtlib, diff --git a/render.c b/render.c index fdf7015c..b0d21d18 100644 --- a/render.c +++ b/render.c @@ -744,7 +744,7 @@ render_cell(struct terminal *term, pixman_image_t *pix, _bg = swap; } - if (!term->window->is_fullscreen && term->colors.alpha != 0xffff) { + else if (!term->window->is_fullscreen && term->colors.alpha != 0xffff) { switch (term->conf->colors.alpha_mode) { case ALPHA_MODE_DEFAULT: { if (cell->attrs.bg_src == COLOR_DEFAULT) { @@ -754,8 +754,15 @@ render_cell(struct terminal *term, pixman_image_t *pix, } case ALPHA_MODE_MATCHING: { - if (cell->attrs.bg == term->colors.bg) + if (cell->attrs.bg_src == COLOR_DEFAULT || + ((cell->attrs.bg_src == COLOR_BASE16 || + cell->attrs.bg_src == COLOR_BASE256) && + term->colors.table[cell->attrs.bg] == term->colors.bg) || + (cell->attrs.bg_src == COLOR_RGB && + cell->attrs.bg == term->colors.bg)) + { alpha = term->colors.alpha; + } break; } diff --git a/terminal.c b/terminal.c index ae1adb1a..f2d03e77 100644 --- a/terminal.c +++ b/terminal.c @@ -4188,7 +4188,7 @@ term_process_and_print_non_ascii(struct terminal *term, char32_t wc) if (grapheme_clustering) { /* Check if we're on a grapheme cluster break */ if (utf8proc_grapheme_break_stateful( - last, wc, &term->vt.grapheme_state) && width > 0) + last, wc, &term->vt.grapheme_state)) { term_reset_grapheme_state(term); goto out; diff --git a/themes/alacritty b/themes/alacritty new file mode 100644 index 00000000..a5e4d2c1 --- /dev/null +++ b/themes/alacritty @@ -0,0 +1,59 @@ +# -*- conf -*- +# Alacritty + +[cursor] +color = 181818 56d8c9 + +[colors] +background= 181818 +foreground= d8d8d8 + +#black +regular0= 181818 + +#red +regular1= ac4242 + +#green +regular2= 90a959 + +#yellow +regular3= f4bf75 + +#blue +regular4= 6a9fb5 + +#magenta +regular5= aa759f + +#cyan +regular6= 75b5aa + +#white/grey +regular7= d8d8d8 + + + +#grey/black +bright0= 6b6b6b + +#red +bright1= c55555 + +#green +bright2= aac474 + +#yellow +bright3= feca88 + +#blue +bright4= 82b8c8 + +#pink +bright5= c28cb8 + +#cyan +bright6= 93d3c3 + +#grey +bright7= f8f8f8 \ No newline at end of file