From 5228c2d3b40d976f451831a8a8b3092c37f44747 Mon Sep 17 00:00:00 2001 From: balrog Date: Mon, 11 Feb 2008 00:09:42 +0000 Subject: Force a resize after leaving graphical mode in curses (spotted by Samuel Thibault). git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3978 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/vga.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/hw/vga.c b/hw/vga.c index 99a31735a7..6474211dba 100644 --- a/hw/vga.c +++ b/hw/vga.c @@ -1674,8 +1674,7 @@ static void vga_update_text(void *opaque, console_ch_t *chardata) uint32_t *src; console_ch_t *dst, val; char msg_buffer[80]; - int full_update; - full_update = 0; + int full_update = 0; if (!(s->ar_index & 0x20)) { graphic_mode = GMODE_BLANK; @@ -1804,19 +1803,21 @@ static void vga_update_text(void *opaque, console_ch_t *chardata) } /* Display a message */ + s->last_width = 60; + s->last_height = height = 3; dpy_cursor(s->ds, -1, -1); - dpy_resize(s->ds, 60, 3); + dpy_resize(s->ds, s->last_width, height); - for (dst = chardata, i = 0; i < 60 * 3; i ++) + for (dst = chardata, i = 0; i < s->last_width * height; i ++) console_write_ch(dst ++, ' '); size = strlen(msg_buffer); - width = (60 - size) / 2; - dst = chardata + 60 + width; + width = (s->last_width - size) / 2; + dst = chardata + s->last_width + width; for (i = 0; i < size; i ++) console_write_ch(dst ++, 0x00200100 | msg_buffer[i]); - dpy_update(s->ds, 0, 0, 60, 3); + dpy_update(s->ds, 0, 0, s->last_width, height); } static CPUReadMemoryFunc *vga_mem_read[3] = { -- cgit v1.2.1