Minor improvement of weston-terminal resizing

This commit is contained in:
José Bollo 2013-09-13 11:28:51 +02:00 committed by Kristian Høgsberg
parent b502126e19
commit 4a4704a7d0
1 changed files with 6 additions and 0 deletions

View File

@ -762,6 +762,11 @@ terminal_resize_cells(struct terminal *terminal, int width, int height)
if (terminal->height > height) {
total_rows = height;
i = 1 + terminal->row - height;
if (i > 0) {
terminal->start = (terminal->start + i) % terminal->height;
terminal->row = terminal->row - i;
}
} else {
total_rows = terminal->height;
}
@ -789,6 +794,7 @@ terminal_resize_cells(struct terminal *terminal, int width, int height)
terminal->data = data;
terminal->data_attr = data_attr;
terminal->tab_ruler = tab_ruler;
terminal->start = 0;
terminal_init_tabs(terminal);
/* Update the window size */