diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2012-11-01 11:14:39 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-11-01 11:14:39 -0500 |
commit | 4ba79505f43bd0ace35c3fe42197eb02e7e0478e (patch) | |
tree | eb1ecd216c1134a88ac0e2d3bc7185319c82fb95 /ui/curses.c | |
parent | d971919f08ca300e7b3595a4c5ddaea2ce8fc3ba (diff) | |
parent | 64f735920ad319aee860e56bb9bad6cfccf4ad40 (diff) |
Merge remote-tracking branch 'kraxel/pixman.v3' into staging
* kraxel/pixman.v3: (22 commits)
pixman: drop obsolete fields from DisplaySurface
pixman/vnc: remove dead code.
pixman/vnc: remove rgb_prepare_row* functions
pixman/vnc: use pixman images in vnc.
pixman: switch screendump function.
vga: stop direct access to DisplaySurface fields.
qxl: stop direct access to DisplaySurface fields.
console: don't set PixelFormat alpha fields for 32bpp
console: make qemu_alloc_display static
pixman: add pixman image to DisplaySurface
pixman: helper functions
pixman: windup in configure & makefiles
pixman: add submodule
console: remove DisplayAllocator
console: remove dpy_gfx_fill
vga: fix text mode updating
console: init displaychangelisteners on register
console: untangle gfx & txt updates
console: s/TextConsole/QemuConsole/
console: move set_mouse + cursor_define callbacks
...
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'ui/curses.c')
-rw-r--r-- | ui/curses.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/ui/curses.c b/ui/curses.c index c2be2c641a..b40b22307d 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -95,17 +95,16 @@ static void curses_calc_pad(void) } } -static void curses_resize(DisplayState *ds) +static void curses_resize(DisplayState *ds, int width, int height) { - if (ds_get_width(ds) == gwidth && ds_get_height(ds) == gheight) + if (width == gwidth && height == gheight) { return; + } - gwidth = ds_get_width(ds); - gheight = ds_get_height(ds); + gwidth = width; + gheight = height; curses_calc_pad(); - ds->surface->width = width * FONT_WIDTH; - ds->surface->height = height * FONT_HEIGHT; } #ifndef _WIN32 @@ -167,8 +166,6 @@ static void curses_refresh(DisplayState *ds) clear(); refresh(); curses_calc_pad(); - ds->surface->width = FONT_WIDTH * width; - ds->surface->height = FONT_HEIGHT * height; vga_hw_invalidate(); invalidate = 0; } @@ -195,8 +192,6 @@ static void curses_refresh(DisplayState *ds) refresh(); curses_calc_pad(); curses_update(ds, 0, 0, width, height); - ds->surface->width = FONT_WIDTH * width; - ds->surface->height = FONT_HEIGHT * height; continue; } #endif @@ -355,13 +350,11 @@ void curses_display_init(DisplayState *ds, int full_screen) #endif dcl = (DisplayChangeListener *) g_malloc0(sizeof(DisplayChangeListener)); - dcl->dpy_update = curses_update; - dcl->dpy_resize = curses_resize; + dcl->dpy_text_update = curses_update; + dcl->dpy_text_resize = curses_resize; dcl->dpy_refresh = curses_refresh; dcl->dpy_text_cursor = curses_cursor_position; register_displaychangelistener(ds, dcl); - qemu_free_displaysurface(ds); - ds->surface = qemu_create_displaysurface_from(640, 400, 0, 0, (uint8_t*) screen); invalidate = 1; } |