console: fix invalid cursor state after resize

Set cursor state to next valid position on resize to avoid invalid cursor
states.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-07-14 20:00:06 +02:00
parent 59e82152d3
commit bdf032898e

View File

@ -544,6 +544,11 @@ int kmscon_console_resize(struct kmscon_console *con, unsigned int x,
con->margin_top = 0;
con->margin_bottom = con->size_y - 1;
if (con->cursor_x >= con->size_x)
con->cursor_x = con->size_x - 1;
if (con->cursor_y >= con->size_y)
con->cursor_y = con->size_y - 1;
return 0;
}