summaryrefslogtreecommitdiff
path: root/console.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-24 03:32:33 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-24 03:32:33 +0000
commitc21bbcfa3ff4f6dc49fb01080ef598851aa424dd (patch)
tree59698825cba06921d0ac57d67e12614c4519fea9 /console.c
parent38334f76300260480e3bd3b77cb5b86fd3d66038 (diff)
downloadqemu-c21bbcfa3ff4f6dc49fb01080ef598851aa424dd.tar.gz
qemu-c21bbcfa3ff4f6dc49fb01080ef598851aa424dd.tar.bz2
qemu-c21bbcfa3ff4f6dc49fb01080ef598851aa424dd.zip
Reintroduce TEXT_CONSOLE_FIXED_SIZE and TEXT_CONSOLE for resizable vc's.
This partially reverts r4812 to fix an issue highlighted by Ryan Harper with all vc's being fixed size which prevented backends with resizable window (curses) from displaying okay. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5309 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'console.c')
-rw-r--r--console.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/console.c b/console.c
index 438a1d5fd3..bec9946c42 100644
--- a/console.c
+++ b/console.c
@@ -109,7 +109,8 @@ static int qemu_fifo_read(QEMUFIFO *f, uint8_t *buf, int len1)
typedef enum {
GRAPHIC_CONSOLE,
- TEXT_CONSOLE
+ TEXT_CONSOLE,
+ TEXT_CONSOLE_FIXED_SIZE
} console_type_t;
/* ??? This is mis-named.
@@ -1046,7 +1047,7 @@ void console_select(unsigned int index)
s = consoles[index];
if (s) {
active_console = s;
- if (s->g_width && s->g_height
+ if (s->console_type != TEXT_CONSOLE && s->g_width && s->g_height
&& (s->g_width != s->ds->width || s->g_height != s->ds->height))
dpy_resize(s->ds, s->g_width, s->g_height);
vga_hw_invalidate();
@@ -1157,6 +1158,15 @@ static void text_console_invalidate(void *opaque)
{
TextConsole *s = (TextConsole *) opaque;
+ if (s->g_width != s->ds->width || s->g_height != s->ds->height) {
+ if (s->console_type == TEXT_CONSOLE_FIXED_SIZE)
+ dpy_resize(s->ds, s->g_width, s->g_height);
+ else {
+ s->g_width = s->ds->width;
+ s->g_height = s->ds->height;
+ text_console_resize(s);
+ }
+ }
console_refresh(s);
}
@@ -1242,6 +1252,11 @@ int is_graphic_console(void)
return active_console && active_console->console_type == GRAPHIC_CONSOLE;
}
+int is_fixedsize_console(void)
+{
+ return active_console && active_console->console_type != TEXT_CONSOLE;
+}
+
void console_color_init(DisplayState *ds)
{
int i, j;
@@ -1264,14 +1279,11 @@ CharDriverState *text_console_init(DisplayState *ds, const char *p)
chr = qemu_mallocz(sizeof(CharDriverState));
if (!chr)
return NULL;
- s = new_console(ds, TEXT_CONSOLE);
+ s = new_console(ds, (p == 0) ? TEXT_CONSOLE : TEXT_CONSOLE_FIXED_SIZE);
if (!s) {
free(chr);
return NULL;
}
- if (!p)
- p = DEFAULT_MONITOR_SIZE;
-
chr->opaque = s;
chr->chr_write = console_puts;
chr->chr_send_event = console_send_event;
@@ -1345,7 +1357,8 @@ void qemu_console_resize(QEMUConsole *console, int width, int height)
}
void qemu_console_copy(QEMUConsole *console, int src_x, int src_y,
- int dst_x, int dst_y, int w, int h) {
+ int dst_x, int dst_y, int w, int h)
+{
if (active_console == console) {
if (console->ds->dpy_copy)
console->ds->dpy_copy(console->ds,