qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ryan Harper <ryanh@us.ibm.com>
To: qemu-devel@nongnu.org
Cc: Ryan Harper <ryanh@us.ibm.com>,
	kvm@vger.kernel.org, Ian Kirk <blob@blob.co.uk>
Subject: [Qemu-devel] [PATCH 1/1][RESEND] v2: Fix text console size/resize when using curses
Date: Thu,  4 Sep 2008 11:10:38 -0500	[thread overview]
Message-ID: <1220544638-1972-2-git-send-email-ryanh@us.ibm.com> (raw)
In-Reply-To: <1220544638-1972-1-git-send-email-ryanh@us.ibm.com>

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 <ryanh@us.ibm.com>

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)

  reply	other threads:[~2008-09-04 16:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-04 16:10 [Qemu-devel] [PATCH 0/1][RESEND] v2: Fix monitor console in curses mode Ryan Harper
2008-09-04 16:10 ` Ryan Harper [this message]
2008-09-15 16:48   ` [Qemu-devel] [PATCH 1/1][RESEND] v2: Fix text console size/resize when using curses andrzej zaborowski
2008-09-15 17:35     ` Ryan Harper
2008-09-15 18:42       ` andrzej zaborowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1220544638-1972-2-git-send-email-ryanh@us.ibm.com \
    --to=ryanh@us.ibm.com \
    --cc=blob@blob.co.uk \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).