terminal: fix tiling artifacts in shrinked window

When shriking the terminal window, the view must be shrinked before
shriking the pixel buffer. Otherwise, when the buffer becomes smaller
than the view, nitpicker fills the excess view area with tiled content
of the buffer, which looks funny.

Related to issue #5350
This commit is contained in:
Norman Feske 2024-10-22 16:54:21 +02:00 committed by Christian Helmuth
parent 8985d8200e
commit 5e3b6ee08f

View File

@ -116,7 +116,17 @@ struct Terminal::Main : Character_consumer
void _handle_mode_change()
{
Rect const orig_win_rect = _win_rect;
_win_rect = _gui_window_rect();
/* shrink view before shrinking the buffer to prevent tiling artifacts */
Rect const intersection = Rect::intersect(orig_win_rect, _win_rect);
if (intersection != orig_win_rect) {
_gui.enqueue<Gui::Session::Command::Geometry>(_view, intersection);
_gui.execute();
}
_handle_config();
}