From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [6389] fix curses interface (Stefano Stabellini)
Date: Wed, 21 Jan 2009 18:59:13 +0000 [thread overview]
Message-ID: <E1LPiID-0004LY-36@cvs.savannah.gnu.org> (raw)
Revision: 6389
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6389
Author: aliguori
Date: 2009-01-21 18:59:12 +0000 (Wed, 21 Jan 2009)
Log Message:
-----------
fix curses interface (Stefano Stabellini)
Hi all,
this patch fixes the curses interface: when we switch from one console
to another we need to change the displaystate width and height even
though in the curses case the backing buffer remains of the same size.
I am also putting back the call to text_console_resize in
text_console_invalidate so that resizeable text consoles can be properly
handled.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Modified Paths:
--------------
trunk/console.c
trunk/curses.c
Modified: trunk/console.c
===================================================================
--- trunk/console.c 2009-01-21 18:59:04 UTC (rev 6388)
+++ trunk/console.c 2009-01-21 18:59:12 UTC (rev 6389)
@@ -1067,8 +1067,13 @@
if (s) {
DisplayState *ds = s->ds;
active_console = s;
- ds->surface = qemu_resize_displaysurface(ds->surface, s->g_width,
- s->g_height, 32, 4 * s->g_width);
+ if (ds_get_bits_per_pixel(s->ds)) {
+ ds->surface = qemu_resize_displaysurface(ds->surface, s->g_width,
+ s->g_height, 32, 4 * s->g_width);
+ } else {
+ s->ds->surface->width = s->width;
+ s->ds->surface->height = s->height;
+ }
dpy_resize(s->ds);
vga_hw_invalidate();
}
@@ -1186,6 +1191,11 @@
static void text_console_invalidate(void *opaque)
{
TextConsole *s = (TextConsole *) opaque;
+ if (!ds_get_bits_per_pixel(s->ds) && s->console_type == TEXT_CONSOLE) {
+ s->g_width = ds_get_width(s->ds);
+ s->g_height = ds_get_height(s->ds);
+ text_console_resize(s);
+ }
console_refresh(s);
}
Modified: trunk/curses.c
===================================================================
--- trunk/curses.c 2009-01-21 18:59:04 UTC (rev 6388)
+++ trunk/curses.c 2009-01-21 18:59:12 UTC (rev 6389)
@@ -106,6 +106,8 @@
gheight = ds_get_height(ds);
curses_calc_pad();
+ ds->surface->width = width * FONT_WIDTH;
+ ds->surface->height = height * FONT_HEIGHT;
}
#ifndef _WIN32
@@ -367,7 +369,7 @@
dcl->dpy_text_cursor = curses_cursor_position;
register_displaychangelistener(ds, dcl);
qemu_free_displaysurface(ds->surface);
- ds->surface = qemu_create_displaysurface_from(80, 25, 0, 0, (uint8_t*) screen);
+ ds->surface = qemu_create_displaysurface_from(640, 400, 0, 0, (uint8_t*) screen);
invalidate = 1;
reply other threads:[~2009-01-21 18:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=E1LPiID-0004LY-36@cvs.savannah.gnu.org \
--to=anthony@codemonkey.ws \
--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).