summaryrefslogtreecommitdiff
path: root/sdl.c
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-03-11 20:07:45 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-03-11 20:07:45 +0000
commit5b31187812694ef575c20fc3fe3123685a306fde (patch)
tree6b215bc4bd02a75a8c66c4d71d487c13f4560bbb /sdl.c
parent38ca0f6deebe286a521d6dfaf6583e9216b441ee (diff)
downloadqemu-5b31187812694ef575c20fc3fe3123685a306fde.tar.gz
qemu-5b31187812694ef575c20fc3fe3123685a306fde.tar.bz2
qemu-5b31187812694ef575c20fc3fe3123685a306fde.zip
Make sure gui_key_modifier_pressed is cleared correctly.
Use correct event fields for SDL_ACTIVEEVENT. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1780 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'sdl.c')
-rw-r--r--sdl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sdl.c b/sdl.c
index 9c7afd907c..d53f3e957e 100644
--- a/sdl.c
+++ b/sdl.c
@@ -404,6 +404,7 @@ static void sdl_refresh(DisplayState *ds)
mod_state = (ev->key.keysym.mod & gui_grab_code);
if (!mod_state) {
if (gui_key_modifier_pressed) {
+ gui_key_modifier_pressed = 0;
if (gui_keysym == 0) {
/* exit/enter grab if pressing Ctrl-Alt */
if (!gui_grab)
@@ -415,7 +416,6 @@ static void sdl_refresh(DisplayState *ds)
reset_keys();
break;
}
- gui_key_modifier_pressed = 0;
gui_keysym = 0;
}
}
@@ -456,8 +456,8 @@ static void sdl_refresh(DisplayState *ds)
}
break;
case SDL_ACTIVEEVENT:
- if (gui_grab && (ev->active.gain & SDL_ACTIVEEVENTMASK) == 0 &&
- !gui_fullscreen_initial_grab) {
+ if (gui_grab && ev->active.state == SDL_APPINPUTFOCUS &&
+ !ev->active.gain && !gui_fullscreen_initial_grab) {
sdl_grab_end();
}
break;