summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-21 18:59:12 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-21 18:59:12 +0000
commit68f00996405e899688e56249fd1e7c7810f67dbb (patch)
treee7c9e0c1750eed8ef400d34b71d56c5f1ded98a8 /console.c
parentStop VM on ENOSPC error. (Gleb Natapov) (diff)
downloadqemu-kvm-68f00996405e899688e56249fd1e7c7810f67dbb.tar.gz
qemu-kvm-68f00996405e899688e56249fd1e7c7810f67dbb.tar.bz2
qemu-kvm-68f00996405e899688e56249fd1e7c7810f67dbb.zip
fix curses interface (Stefano Stabellini)
Hi all, this patch fixes the curses interface: when we switch from one console to another we need to change the displaystate width and height even though in the curses case the backing buffer remains of the same size. I am also putting back the call to text_console_resize in text_console_invalidate so that resizeable text consoles can be properly handled. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6389 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'console.c')
-rw-r--r--console.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/console.c b/console.c
index 6d0c1b3b6..4bc16e8d1 100644
--- a/console.c
+++ b/console.c
@@ -1067,8 +1067,13 @@ void console_select(unsigned int index)
if (s) {
DisplayState *ds = s->ds;
active_console = s;
- ds->surface = qemu_resize_displaysurface(ds->surface, s->g_width,
- s->g_height, 32, 4 * s->g_width);
+ if (ds_get_bits_per_pixel(s->ds)) {
+ ds->surface = qemu_resize_displaysurface(ds->surface, s->g_width,
+ s->g_height, 32, 4 * s->g_width);
+ } else {
+ s->ds->surface->width = s->width;
+ s->ds->surface->height = s->height;
+ }
dpy_resize(s->ds);
vga_hw_invalidate();
}
@@ -1186,6 +1191,11 @@ void kbd_put_keysym(int keysym)
static void text_console_invalidate(void *opaque)
{
TextConsole *s = (TextConsole *) opaque;
+ if (!ds_get_bits_per_pixel(s->ds) && s->console_type == TEXT_CONSOLE) {
+ s->g_width = ds_get_width(s->ds);
+ s->g_height = ds_get_height(s->ds);
+ text_console_resize(s);
+ }
console_refresh(s);
}