From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [Qemu-devel] Re: [PATCH] Fix display breakage when resizing the screen Date: Sun, 05 Apr 2009 18:35:33 +0300 Message-ID: <49D8CFC5.2070203@redhat.com> References: <1238842115-31236-1-git-send-email-avi@redhat.com> <49D8B5C2.4090901@codemonkey.ws> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020806080100080501030900" Cc: kvm@vger.kernel.org To: qemu-devel@nongnu.org Return-path: Received: from mx2.redhat.com ([66.187.237.31]:49167 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750918AbZDEPfg (ORCPT ); Sun, 5 Apr 2009 11:35:36 -0400 In-Reply-To: <49D8B5C2.4090901@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: This is a multi-part message in MIME format. --------------020806080100080501030900 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------020806080100080501030900 Content-Type: text/x-patch; name="delta.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="delta.patch" 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; --------------020806080100080501030900--