From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KbHW0-0003sI-1e for qemu-devel@nongnu.org; Thu, 04 Sep 2008 12:17:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KbHVz-0003r3-6L for qemu-devel@nongnu.org; Thu, 04 Sep 2008 12:16:59 -0400 Received: from [199.232.76.173] (port=40444 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KbHVx-0003qo-8Y for qemu-devel@nongnu.org; Thu, 04 Sep 2008 12:16:57 -0400 Received: from e1.ny.us.ibm.com ([32.97.182.141]:42480) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KbHVx-0007B8-4m for qemu-devel@nongnu.org; Thu, 04 Sep 2008 12:16:57 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e1.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id m84GAe74030665 for ; Thu, 4 Sep 2008 12:10:40 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m84GAeue074568 for ; Thu, 4 Sep 2008 12:10:40 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m84GAevQ010557 for ; Thu, 4 Sep 2008 12:10:40 -0400 From: Ryan Harper Date: Thu, 4 Sep 2008 11:10:38 -0500 Message-Id: <1220544638-1972-2-git-send-email-ryanh@us.ibm.com> In-Reply-To: <1220544638-1972-1-git-send-email-ryanh@us.ibm.com> References: <1220544638-1972-1-git-send-email-ryanh@us.ibm.com> Subject: [Qemu-devel] [PATCH 1/1][RESEND] v2: Fix text console size/resize when using curses 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: Ryan Harper , kvm@vger.kernel.org, Ian Kirk v2: drop initial size adjustment, not needed. Resize events fail to ensure that both the text console and curses display areas are the same size; this causes broken output like: QEMU 0.9.1 monitor - type 'help' for more information (qemu) (qemu) (qemu) To fix this, ensure that the display width and the text area width are sync for text consoles on refresh; also force a resize event whenever we invalidate the text console. Signed-off-by: Ryan Harper diff --git a/console.c b/console.c index 1c94980..89bdc52 100644 --- a/console.c +++ b/console.c @@ -608,6 +608,9 @@ static void console_refresh(TextConsole *s) s->text_y[0] = 0; s->text_x[1] = s->width - 1; s->text_y[1] = s->height - 1; + /* ensure that textconsole area is the same size as the display */ + s->g_width = s->ds->width; + s->g_height = s->ds->height; s->cursor_invalidate = 1; return; } @@ -1158,6 +1161,8 @@ static void text_console_invalidate(void *opaque) TextConsole *s = (TextConsole *) opaque; console_refresh(s); + /* resize if needed */ + text_console_resize(s); } static void text_console_update(void *opaque, console_ch_t *chardata)