term: flash: work around Sway sub-surface unmap bug

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
This commit is contained in:
Daniel Eklöf 2022-04-26 17:24:55 +02:00
parent 1e87dbc4dc
commit 398d96fdb2
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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;
}