Clear graphics when switching to the alternate screen buffer

This commit is contained in:
Kovid Goyal 2017-10-05 23:01:47 +05:30
parent 600bff73d6
commit 480645877a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 12 additions and 0 deletions

View File

@ -266,3 +266,14 @@ take, and the default value they take when missing. All integers are 32-bit.
| `r` | Positive integer | `0` | The number of rows to display the image over
| `z` | Integer | `0` | The *z-index* vertical stacking order of the image
|===
== Interaction with screen changes
When resetting the screen, all images that are visible on the screen must be
cleared. When switching from the main screen to the alternate screen buffer
(1049 private mode) all images in the alternate screen must be cleared, just as
all text is cleared.
The commands to clear the screen and erase text must have no effect on
graphics. The dedicated delete graphics commands must be used for those.

View File

@ -436,6 +436,7 @@ screen_toggle_screen_buffer(Screen *self) {
bool to_alt = self->linebuf == self->main_linebuf;
if (to_alt) {
linebuf_clear(self->alt_linebuf, BLANK_CHAR);
grman_clear(self->alt_grman);
screen_save_cursor(self);
self->linebuf = self->alt_linebuf;
self->tabstops = self->alt_tabstops;