When SDL is invisible/minimized, there is no need to keep calling the VGA refresh 33 times per second. This patch reduces in that case the rate to 2 times per second, which should be responsive enough for the un-minimizing event.
Index: console.h =================================================================== RCS file: /sources/qemu/qemu/console.h,v retrieving revision 1.2 diff -u -p -r1.2 console.h --- console.h 10 Feb 2008 16:33:13 -0000 1.2 +++ console.h 11 Mar 2008 11:05:08 -0000 @@ -71,6 +71,7 @@ int height; void *opaque; struct QEMUTimer *gui_timer; + uint64_t gui_timer_interval; void (*dpy_update)(struct DisplayState *s, int x, int y, int w, int h); void (*dpy_resize)(struct DisplayState *s, int w, int h); Index: sdl.c =================================================================== RCS file: /sources/qemu/qemu/sdl.c,v retrieving revision 1.46 --- sdl.c 10 Mar 2008 19:34:27 -0000 1.46 +++ sdl.c 11 Mar 2008 11:05:08 -0000 @@ -506,6 +506,15 @@ !ev->active.gain && !gui_fullscreen_initial_grab) { sdl_grab_end(); } + if (ev->active.state & SDL_APPACTIVE) { + if (ev->active.gain) { + /* Back to default interval */ + ds->gui_timer_interval = 0; + } else { + /* Sleeping interval */ + ds->gui_timer_interval = 500; + } + } break; default: break; Index: vl.c =================================================================== RCS file: /sources/qemu/qemu/vl.c,v retrieving revision 1.410 --- vl.c 10 Mar 2008 19:34:27 -0000 1.410 +++ vl.c 11 Mar 2008 11:05:09 -0000 @@ -7208,7 +7200,11 @@ { DisplayState *ds = opaque; ds->dpy_refresh(ds); - qemu_mod_timer(ds->gui_timer, GUI_REFRESH_INTERVAL + qemu_get_clock(rt_clock)); + qemu_mod_timer(ds->gui_timer, + (ds->gui_timer_interval ? + ds->gui_timer_interval : + GUI_REFRESH_INTERVAL) + + qemu_get_clock(rt_clock)); } struct vm_change_state_entry {