]> Git Repo - qemu.git/blobdiff - sdl.c
Solaris/SPARC host port (Ben Taylor)
[qemu.git] / sdl.c
diff --git a/sdl.c b/sdl.c
index d99505ef162b31febe7524664a7db2cbe4f26058..38d75536ddeb8d5393d85480ec00f49ea5995134 100644 (file)
--- a/sdl.c
+++ b/sdl.c
@@ -447,10 +447,18 @@ static void sdl_refresh(DisplayState *ds)
                         gui_key_modifier_pressed = 0;
                         if (gui_keysym == 0) {
                             /* exit/enter grab if pressing Ctrl-Alt */
-                            if (!gui_grab)
-                                sdl_grab_start();
-                            else
+                            if (!gui_grab) {
+                                /* if the application is not active,
+                                   do not try to enter grab state. It
+                                   prevents
+                                   'SDL_WM_GrabInput(SDL_GRAB_ON)'
+                                   from blocking all the application
+                                   (SDL bug). */
+                                if (SDL_GetAppState() & SDL_APPACTIVE)
+                                    sdl_grab_start();
+                            } else {
                                 sdl_grab_end();
+                            }
                             /* SDL does not send back all the
                                modifiers key, so we must correct it */
                             reset_keys();
This page took 0.023164 seconds and 4 git commands to generate.