From 6eb68ffbd99cc48aa688e59a230b4fca98fe0cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 14 Mar 2021 10:58:13 +0100 Subject: [PATCH] sixel: max geometry should be max geometry, not current window size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit “current geometry” will report whatever value is the smallest; the max geometry or the current window size. But “max geometry” always returns the configured max geometry. This aligns foot’s behavior with XTerm. --- CHANGELOG.md | 2 ++ sixel.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cf22411..fca0439a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -89,6 +89,8 @@ background color for empty pixels instead of the default background color (https://codeberg.org/dnkl/foot/issues/391). * Sixel decoding optimized; up to 100% faster in some cases. +* Reported sixel “max geometry” from current window size, to the + configured maximum size (defaulting to 10000x10000). ### Deprecated diff --git a/sixel.c b/sixel.c index 20f15cab..96ba9214 100644 --- a/sixel.c +++ b/sixel.c @@ -1375,8 +1375,8 @@ sixel_geometry_set(struct terminal *term, unsigned width, unsigned height) void sixel_geometry_report_max(struct terminal *term) { - unsigned max_width = term->cols * term->cell_width; - unsigned max_height = term->rows * term->cell_height; + unsigned max_width = term->sixel.max_width; + unsigned max_height = term->sixel.max_height; char reply[64]; size_t n = xsnprintf(reply, sizeof(reply), "\033[?2;0;%u;%uS", max_width, max_height);