render: overlay: fix visual glitches when double buffering

When rendering the overlay for scrollback search, the logic assumed
buffer re-use. On some compositors this isn’t happening (on
e.g. KDE/plasma we’re forced to double buffer).

This resulted in matches not being highlighted correctly.

The problem is in how we calculated the region for which areas to
clear ("un-dim"). It uses the "previous frame’s see-through area"
minus the current frame’s see-through area.

However, when we’ve detected that the current buffer isn’t the same as
the last one, we set the last frame’s see-through region to "the
entire buffer". Thus, when calculating the diff, we end up with an
empty region, and nothing is highlighted.

Fix by simply using the current frame’s see-through region as-is when
we’ve detected we’re not re-using the last frame’s buffer.
This commit is contained in:
Daniel Eklöf 2022-09-22 18:39:00 +02:00
parent 4340f8a3b4
commit 3be44fb316
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 22 additions and 10 deletions

View file

@ -74,6 +74,9 @@
* Glitchy rendering when scrolling in the scrollback, on compositors
that does not allow Wayland buffer re-use (e.g. KDE/plasma)
([#1173][1173])
* Scrollback search matches not being highlighted correctly, on
compositors that does now allow Wayland buffer re-use
(e.g. KDE/plasma).
[1173]: https://codeberg.org/dnkl/foot/issues/1173