aboutsummaryrefslogtreecommitdiff
path: root/sdl.c
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-03-13 19:20:33 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-03-13 19:20:33 +0000
commitf442e08b418785e13b1161edfa9e0c72cc324c41 (patch)
tree1d70820bd63eaeb9c97adb62dbfb65a100ef5438 /sdl.c
parent4c44bdcb704945980898a04c556d1377c267a3f1 (diff)
Slowdown SDL while minimized
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. (Samuel Thibault) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4050 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'sdl.c')
-rw-r--r--sdl.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sdl.c b/sdl.c
index 05a394c784..431e527119 100644
--- a/sdl.c
+++ b/sdl.c
@@ -510,6 +510,15 @@ static void sdl_refresh(DisplayState *ds)
!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;