Merge branch 'master' into releases/1.20

This commit is contained in:
Daniel Eklöf 2025-01-03 08:00:53 +01:00
commit b66a076bf1
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
8 changed files with 108 additions and 15 deletions

View file

@ -1,5 +1,6 @@
# Changelog
* [Unreleased](#unreleased)
* [1.20.0](#1-20-0)
* [1.19.0](#1-19-0)
* [1.18.1](#1-18-1)
@ -55,6 +56,33 @@
* [1.2.0](#1-2-0)
## Unreleased
### Added
### Changed
* Runtime changes to the app-id (OSC-176) now limits the app-id string
to 2048 characters ([#1897][1897]).
* `colors.flash-alpha` can no longer be set to 1.0 (i.e. fully
opaque). This fixes an issue where the window would be stuck in the
flash state.
[1897]: https://codeberg.org/dnkl/foot/issues/1897
### Deprecated
### Removed
### Fixed
* Regression: trying to print a Unicode _"Legacy Computing symbol"_,
in the range U+1FB00 - U+1FB9B would crash foot ([#][]).
[1901]: https://codeberg.org/dnkl/foot/issues/1901
### Security
### Contributors
## 1.20.0
### Added
@ -69,6 +97,8 @@
host clipboard access via the OSC-52 escape sequence
([#1867][1867]).
[1867]: https://codeberg.org/dnkl/foot/issues/1867
### Changed

View file

@ -1445,8 +1445,8 @@ parse_section_colors(struct context *ctx)
if (!value_to_float(ctx, &alpha))
return false;
if (alpha < 0. || alpha > 1.) {
LOG_CONTEXTUAL_ERR("not in range 0.0-1.0");
if (alpha < 0. || alpha >= 1.) {
LOG_CONTEXTUAL_ERR("not in range 0.0-0.999");
return false;
}

View file

@ -10,7 +10,7 @@
#include <fcntl.h>
#define LOG_MODULE "notify"
#define LOG_ENABLE_DBG 1
#define LOG_ENABLE_DBG 0
#include "log.h"
#include "config.h"
#include "spawn.h"

2
osc.c
View file

@ -8,7 +8,7 @@
#include <sys/epoll.h>
#define LOG_MODULE "osc"
#define LOG_ENABLE_DBG 1
#define LOG_ENABLE_DBG 0
#include "log.h"
#include "base64.h"
#include "config.h"

View file

@ -817,14 +817,14 @@ render_cell(struct terminal *term, pixman_image_t *pix, pixman_region32_t *damag
size_t count;
size_t idx;
if (base >= GLYPH_OCTANTS_FIRST) {
arr = &term->custom_glyphs.octants;
count = GLYPH_OCTANTS_COUNT;
idx = base - GLYPH_OCTANTS_FIRST;
} else if (base >= GLYPH_LEGACY_FIRST) {
if (base >= GLYPH_LEGACY_FIRST) {
arr = &term->custom_glyphs.legacy;
count = GLYPH_LEGACY_COUNT;
idx = base - GLYPH_LEGACY_FIRST;
} else if (base >= GLYPH_OCTANTS_FIRST) {
arr = &term->custom_glyphs.octants;
count = GLYPH_OCTANTS_COUNT;
idx = base - GLYPH_OCTANTS_FIRST;
} else if (base >= GLYPH_BRAILLE_FIRST) {
arr = &term->custom_glyphs.braille;
count = GLYPH_BRAILLE_COUNT;
@ -1898,6 +1898,27 @@ render_overlay(struct terminal *term)
break;
case OVERLAY_FLASH:
/*
* A compositor will not send a frame callback for our main
* window if it is fully occluded (for example, by a fully
* opaque overlay...). This causes the overlay to stuck.
*
* For regular buffers, it _should_ be enough to *not* hint
* the compositor it's opaque. But at least some compositor
* special cases single-pixel buffers, and actually look at
* their pixel value.
*
* Thus, we have two options: implement frame callback
* handling for the overlay sub-surface, or ensure we don't
* use a fully opaque surface. Since no overlays are fully
* opaque by default, and the flash surface is the only one
* that can be configured to be opaque (colors.flash-alpha),
* and since adding frame callback handling adds a lot of
* boilerplate code... let's go with the simpler solution of
* not allowing colors.flash-alpha to be 1.0.
*/
xassert(term->conf->colors.flash_alpha != 0xffff);
color = color_hex_to_pixman_with_alpha(
term->conf->colors.flash,
term->conf->colors.flash_alpha);

View file

@ -3588,8 +3588,10 @@ term_set_app_id(struct terminal *term, const char *app_id)
{
if (app_id != NULL && *app_id == '\0')
app_id = NULL;
if (term->app_id == NULL && app_id == NULL)
return;
if (term->app_id != NULL && app_id != NULL && streq(term->app_id, app_id))
return;
@ -3604,6 +3606,19 @@ term_set_app_id(struct terminal *term, const char *app_id)
} else {
term->app_id = NULL;
}
const size_t length = strlen(app_id);
if (length > 2048) {
/*
* Not sure if there's a limit in the protocol, or the
* libwayland implementation, or e.g. wlroots, but too long
* app-id's (not e.g. title) causes at least river and sway to
* peg the CPU at 100%, and stop sending e.g. frame callbacks.
*
*/
term->app_id[2048] = '\0';
}
render_refresh_app_id(term);
render_refresh_icon(term);
}

View file

@ -482,8 +482,8 @@ struct terminal {
struct {
struct fcft_glyph **box_drawing;
struct fcft_glyph **braille;
struct fcft_glyph **legacy;
struct fcft_glyph **octants;
struct fcft_glyph **legacy;
#define GLYPH_BOX_DRAWING_FIRST 0x2500
#define GLYPH_BOX_DRAWING_LAST 0x259F
@ -495,15 +495,15 @@ struct terminal {
#define GLYPH_BRAILLE_COUNT \
(GLYPH_BRAILLE_LAST - GLYPH_BRAILLE_FIRST + 1)
#define GLYPH_LEGACY_FIRST 0x1FB00
#define GLYPH_LEGACY_LAST 0x1FB9B
#define GLYPH_LEGACY_COUNT \
(GLYPH_LEGACY_LAST - GLYPH_LEGACY_FIRST + 1)
#define GLYPH_OCTANTS_FIRST 0x1CD00
#define GLYPH_OCTANTS_LAST 0x1CDE5
#define GLYPH_OCTANTS_COUNT \
(GLYPH_OCTANTS_LAST - GLYPH_OCTANTS_FIRST + 1)
#define GLYPH_LEGACY_FIRST 0x1FB00
#define GLYPH_LEGACY_LAST 0x1FB9B
#define GLYPH_LEGACY_COUNT \
(GLYPH_LEGACY_LAST - GLYPH_LEGACY_FIRST + 1)
} custom_glyphs;
bool is_sending_paste_data;

27
themes/iterm Normal file
View file

@ -0,0 +1,27 @@
# -*- conf -*-
# this foot theme is based on alacritty iterm theme:
# https://github.com/alacritty/alacritty-theme/blob/master/themes/iterm.toml
[colors]
foreground=fffbf6
background=101421
## Normal/regular colors (color palette 0-7)
regular0=2e2e2e # black
regular1=eb4129 # red
regular2=abe047 # green
regular3=f6c744 # yellow
regular4=47a0f3 # blue
regular5=7b5cb0 # magenta
regular6=64dbed # cyan
regular7=e5e9f0 # white
## Bright colors (color palette 8-15)
bright0=565656 # bright black
bright1=ec5357 # bright red
bright2=c0e17d # bright green
bright3=f9da6a # bright yellow
bright4=49a4f8 # bright blue
bright5=a47de9 # bright magenta
bright6=99faf2 # bright cyan
bright7=ffffff # bright white