From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Switch back from graphical mode to text mode
Date: Sun, 10 Feb 2008 18:59:25 +0000 [thread overview]
Message-ID: <20080210185925.GJ4427@implementation> (raw)
Hello,
Thanks for merging the ncurses interface, that'll be very useful!
However there is a small bug when switching back from graphical mode to
text mode in vga.c: in graphical mode, the text screen is resized to
60x3 so as to display a message, but nothing is done to make sure that
it will be reset back to e.g. 80x25 when switching back to text mode.
The attached patch fixes that by recording when a message is displayed
(and thus fake resize performed), and when going back to text mode,
force the resize.
Samuel
Index: hw/vga.c
===================================================================
RCS file: /sources/qemu/qemu/hw/vga.c,v
retrieving revision 1.60
diff -u -p -r1.60 vga.c
--- hw/vga.c 10 Feb 2008 16:33:14 -0000 1.60
+++ hw/vga.c 10 Feb 2008 18:58:17 -0000
@@ -1152,7 +1152,7 @@ static void vga_draw_text(VGAState *s, i
}
if (width != s->last_width || height != s->last_height ||
- cw != s->last_cw || cheight != s->last_ch) {
+ cw != s->last_cw || cheight != s->last_ch || s->message_screen) {
s->last_scr_width = width * cw;
s->last_scr_height = height * cheight;
dpy_resize(s->ds, s->last_scr_width, s->last_scr_height);
@@ -1160,6 +1160,7 @@ static void vga_draw_text(VGAState *s, i
s->last_height = height;
s->last_ch = cheight;
s->last_cw = cw;
+ s->message_screen = 0;
full_update = 1;
}
cursor_offset = ((s->cr[0x0e] << 8) | s->cr[0x0f]) - s->start_addr;
@@ -1724,7 +1725,7 @@ static void vga_update_text(void *opaque
}
if (width != s->last_width || height != s->last_height ||
- cw != s->last_cw || cheight != s->last_ch) {
+ cw != s->last_cw || cheight != s->last_ch || s->message_screen) {
s->last_scr_width = width * cw;
s->last_scr_height = height * cheight;
dpy_resize(s->ds, width, height);
@@ -1732,6 +1733,7 @@ static void vga_update_text(void *opaque
s->last_height = height;
s->last_ch = cheight;
s->last_cw = cw;
+ s->message_screen = 0;
full_update = 1;
}
@@ -1806,6 +1808,7 @@ static void vga_update_text(void *opaque
/* Display a message */
dpy_cursor(s->ds, -1, -1);
dpy_resize(s->ds, 60, 3);
+ s->message_screen = 1;
for (dst = chardata, i = 0; i < 60 * 3; i ++)
console_write_ch(dst ++, ' ');
Index: hw/vga_int.h
===================================================================
RCS file: /sources/qemu/qemu/hw/vga_int.h,v
retrieving revision 1.16
diff -u -p -r1.16 vga_int.h
--- hw/vga_int.h 10 Feb 2008 16:33:14 -0000 1.16
+++ hw/vga_int.h 10 Feb 2008 18:58:17 -0000
@@ -129,6 +129,7 @@
uint32_t line_compare; \
uint32_t start_addr; \
uint32_t plane_updated; \
+ int message_screen; \
uint8_t last_cw, last_ch; \
uint32_t last_width, last_height; /* in chars or pixels */ \
uint32_t last_scr_width, last_scr_height; /* in pixels */ \
next reply other threads:[~2008-02-10 18:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-10 18:59 Samuel Thibault [this message]
2008-02-11 0:13 ` [Qemu-devel] Switch back from graphical mode to text mode 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=20080210185925.GJ4427@implementation \
--to=samuel.thibault@ens-lyon.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.