From 3b41379be43a21a00a776d0d136c5d1b2fe4007e Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 25 Apr 2023 21:33:45 +0200 Subject: quirks: sway does not damage surface beneath sub-surface, when unmapped MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When unmapping a sub-surface, Sway <= 1.8 does not damage the surface beneath the sub-surface. https://github.com/swaywm/sway/issues/6960 The workaround is to manually damage the main surface. Previously, this was done when exiting scrollback search, and after the ‘flash’ OSC. But other sub-surfaces, that may also be unmapped, did not. This patch adds a quirk handler that does this, and calls it when: * Exiting scrollback search * Ending the ‘flash’ OSC * Exiting unicode input mode * Clearing URL labels * Removing the scrollback position indicator Closes #1335 --- render.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'render.c') diff --git a/render.c b/render.c index 521c8b7f..f1e80392 100644 --- a/render.c +++ b/render.c @@ -1527,6 +1527,10 @@ render_overlay(struct terminal *term) wl_surface_commit(overlay->surf); term->render.last_overlay_style = OVERLAY_NONE; term->render.last_overlay_buf = NULL; + + /* Work around Sway bug - unmapping a sub-surface does not + * damage the underlying surface */ + quirk_sway_subsurface_unmap(term); } return; } @@ -2374,8 +2378,13 @@ render_scrollback_position(struct terminal *term) struct wl_window *win = term->window; if (term->grid->view == term->grid->offset) { - if (win->scrollback_indicator.surf != NULL) + if (win->scrollback_indicator.surf != NULL) { wayl_win_subsurface_destroy(&win->scrollback_indicator); + + /* Work around Sway bug - unmapping a sub-surface does not damage + * the underlying surface */ + quirk_sway_subsurface_unmap(term); + } return; } -- cgit v1.3