From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LqUNp-0001UK-CU for qemu-devel@nongnu.org; Sun, 05 Apr 2009 11:35:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LqUNj-0001Om-Rj for qemu-devel@nongnu.org; Sun, 05 Apr 2009 11:35:40 -0400 Received: from [199.232.76.173] (port=37575 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LqUNj-0001OZ-I5 for qemu-devel@nongnu.org; Sun, 05 Apr 2009 11:35:35 -0400 Received: from mx2.redhat.com ([66.187.237.31]:38611) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LqUNj-00076m-2o for qemu-devel@nongnu.org; Sun, 05 Apr 2009 11:35:35 -0400 Message-ID: <49D8CFC5.2070203@redhat.com> Date: Sun, 05 Apr 2009 18:35:33 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH] Fix display breakage when resizing the screen References: <1238842115-31236-1-git-send-email-avi@redhat.com> <49D8B5C2.4090901@codemonkey.ws> In-Reply-To: <49D8B5C2.4090901@codemonkey.ws> Content-Type: multipart/mixed; boundary="------------020806080100080501030900" Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org 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--