Anthony Liguori wrote:
This patch breaks VC switching with -curses.
The attached incremental fixes it, by basically replicating the previous behaviour. I'll follow up with a new combined patch.
-- error compiling committee.c: too many arguments to function
diff --git a/hw/vga.c b/hw/vga.c index 404450f..54d0246 100644 --- a/hw/vga.c +++ b/hw/vga.c @@ -1631,6 +1631,9 @@ static void vga_update_resolution_graphics(VGAState *s) s->multi_run != multi_run || s->multi_scan != multi_scan || s->want_full_update) { + if (s->ds->surface->pf.depth == 0) { + goto dont_touch_display_surface; + } #if defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) if (depth == 16 || depth == 32) { #else @@ -1647,6 +1650,7 @@ static void vga_update_resolution_graphics(VGAState *s) } else { qemu_console_resize(s->ds, disp_width, height); } + dont_touch_display_surface: s->last_scr_width = disp_width; s->last_scr_height = height; s->last_width = disp_width; @@ -1668,7 +1672,17 @@ static void vga_update_resolution_text(VGAState *s) cw != s->last_cw || cheight != s->last_ch || s->last_depth) { s->last_scr_width = width * cw; s->last_scr_height = height * cheight; - qemu_console_resize(s->ds, s->last_scr_width, s->last_scr_height); + if (s->ds->surface->pf.depth != 0) { + qemu_console_resize(s->ds, s->last_scr_width, s->last_scr_height); + } else { + /* + * curses expects width and height to be in character cell + * dimensions, not pixels. + */ + s->ds->surface->width = width; + s->ds->surface->height = height; + dpy_resize(s->ds); + } s->last_depth = 0; s->last_width = width; s->last_height = height;