Clear the alt screen graphics buffer when switching away from it as well as to it

This commit is contained in:
Kovid Goyal 2017-10-08 23:14:56 +05:30
parent 747f7b076d
commit b4b6968e07
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -434,9 +434,9 @@ screen_handle_graphics_command(Screen *self, const GraphicsCommand *cmd, const u
void void
screen_toggle_screen_buffer(Screen *self) { screen_toggle_screen_buffer(Screen *self) {
bool to_alt = self->linebuf == self->main_linebuf; bool to_alt = self->linebuf == self->main_linebuf;
grman_clear(self->alt_grman); // always clear the alt buffer graphics to free up resources, since it has to be cleared when switching back to it anyway
if (to_alt) { if (to_alt) {
linebuf_clear(self->alt_linebuf, BLANK_CHAR); linebuf_clear(self->alt_linebuf, BLANK_CHAR);
grman_clear(self->alt_grman);
screen_save_cursor(self); screen_save_cursor(self);
self->linebuf = self->alt_linebuf; self->linebuf = self->alt_linebuf;
self->tabstops = self->alt_tabstops; self->tabstops = self->alt_tabstops;