From 1e87dbc4dc87c9567a7851135d91728796b0696f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 25 Apr 2022 19:55:00 +0200 Subject: [PATCH 1/3] search: work around Sway sub-surface unmap bug Unmapping a sub-surface in Sway does not damage the underlying surface. As a result, "committing" a scrollback search will typically leave most of the foot window dimmed. It can be seen when "cancelling" a search as well, but there it's less obvious - only the margins are left dimmed. This is because cancelling a search damaged the current viewport (something that shouldn't be needed). Out of sway, river, weston and mutter, only Sway needs this workaround. This is a workaround for https://github.com/swaywm/sway/issues/6960 --- search.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/search.c b/search.c index 09b59d50..72c589f2 100644 --- a/search.c +++ b/search.c @@ -116,6 +116,11 @@ search_cancel_keep_selection(struct terminal *term) term_xcursor_update(term); render_refresh(term); + + /* Work around Sway bug - unmapping a sub-surface does not damage + * the underlying surface */ + term_damage_margins(term); + term_damage_view(term); } void @@ -795,7 +800,6 @@ execute_binding(struct seat *seat, struct terminal *term, grid->view = ensure_view_is_allocated( term, term->search.original_view); } - term_damage_view(term); search_cancel(term); return true; From 398d96fdb2a18f7652c116639dc17741f5e24404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 26 Apr 2022 17:24:55 +0200 Subject: [PATCH 2/3] term: flash: work around Sway sub-surface unmap bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unmapping a sub-surface in Sway does not damage the underlying surface. As a result, the OSC-555 escape (“flash”) will leave yellow margins on ~every second frame. Out of sway, river, weston and mutter, only Sway needs this workaround. This is a workaround for https://github.com/swaywm/sway/issues/6960 Closes #1046 --- terminal.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/terminal.c b/terminal.c index 7d230cdf..9199aa31 100644 --- a/terminal.c +++ b/terminal.c @@ -355,8 +355,12 @@ fdm_flash(struct fdm *fdm, int fd, int events, void *data) (unsigned long long)expiration_count); term->flash.active = false; - term_damage_view(term); render_refresh(term); + + /* Work around Sway bug - unmapping a sub-surface does not damage + * the underlying surface */ + term_damage_margins(term); + term_damage_view(term); return true; } From 3abb23c81c5da902587b5b639eff555fcab5a337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 26 Apr 2022 17:28:36 +0200 Subject: [PATCH 3/3] changelog: workaround for Sway bug #6960 --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89c19a0e..47ca1107 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,15 @@ ## Unreleased ### Added + +* Workaround for Sway bug [#6960][sway-6960]: scrollback search and + the OSC-555 (“flash”) escape sequence leaves dimmed (search )and + yellow (flash) artifacts ([#1046][1046]). + +[sway-6960]: https://github.com/swaywm/sway/issues/6960 +[1046]: https://codeberg.org/dnkl/foot/issues/1046 + + ### Changed ### Deprecated ### Removed