From 4a4704a7d0c23b5450ab26f3996d9645c08349e7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Fri, 13 Sep 2013 11:28:51 +0200 Subject: [PATCH] Minor improvement of weston-terminal resizing --- clients/terminal.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clients/terminal.c b/clients/terminal.c index 1c60eba..ee2baf0 100644 --- a/clients/terminal.c +++ b/clients/terminal.c @@ -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 */ -- 2.7.4