aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-01-03 07:00:53 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-01-03 07:00:53 +0000
commitb66a076bf1c0398521315c52ed77d3d7fa1a222f (patch)
tree3af0b7902ff9b67a304e6f2e599df45dc06bead9
parentmeson: bump version to 1.20.0 (diff)
parentrender: fix order we're checking custom codepoints (diff)
Merge branch 'master' into releases/1.20
-rw-r--r--CHANGELOG.md30
-rw-r--r--config.c4
-rw-r--r--notify.c2
-rw-r--r--osc.c2
-rw-r--r--render.c31
-rw-r--r--terminal.c15
-rw-r--r--terminal.h12
-rw-r--r--themes/iterm27
8 files changed, 108 insertions, 15 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9b4af316..1461fa63 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
diff --git a/config.c b/config.c
index 7f1ce055..3b8ce7e8 100644
--- a/config.c
+++ b/config.c
@@ -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;
}
diff --git a/notify.c b/notify.c
index c77c0606..e8688180 100644
--- a/notify.c
+++ b/notify.c
@@ -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"
diff --git a/osc.c b/osc.c
index 2c02f53a..17639c19 100644
--- a/osc.c
+++ b/osc.c
@@ -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"
diff --git a/render.c b/render.c
index ed6b802e..5a924743 100644
--- a/render.c
+++ b/render.c
@@ -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);
diff --git a/terminal.c b/terminal.c
index a4963bc8..5a74631a 100644
--- a/terminal.c
+++ b/terminal.c
@@ -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);
}
diff --git a/terminal.h b/terminal.h
index d3c7f335..813510fe 100644
--- a/terminal.h
+++ b/terminal.h
@@ -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;
diff --git a/themes/iterm b/themes/iterm
new file mode 100644
index 00000000..45b1a0bf
--- /dev/null
+++ b/themes/iterm
@@ -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