aboutsummaryrefslogtreecommitdiff
path: root/sdl.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-06-13 12:03:53 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-06-13 12:03:53 +0000
commitc66b0d4cf4ef84325d3f579c0e3ea5254d7b348a (patch)
tree12438420729bc667cf36528435bfd057370bf378 /sdl.c
parent8785a8ddcc6e772d82744279447bb9541da5a407 (diff)
downloadqemu-c66b0d4cf4ef84325d3f579c0e3ea5254d7b348a.zip
qemu-c66b0d4cf4ef84325d3f579c0e3ea5254d7b348a.tar.gz
qemu-c66b0d4cf4ef84325d3f579c0e3ea5254d7b348a.tar.bz2
avoid stopping QEMU when switching desktops with Ctrl-Alt-x
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1954 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'sdl.c')
-rw-r--r--sdl.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sdl.c b/sdl.c
index d99505e..38d7553 100644
--- 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();