Commit 5b31187812694ef575c20fc3fe3123685a306fde

Authored by pbrook
1 parent 38ca0f6d

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
Showing 1 changed file with 3 additions and 3 deletions
... ... @@ -404,6 +404,7 @@ static void sdl_refresh(DisplayState *ds)
404 404 mod_state = (ev->key.keysym.mod & gui_grab_code);
405 405 if (!mod_state) {
406 406 if (gui_key_modifier_pressed) {
  407 + gui_key_modifier_pressed = 0;
407 408 if (gui_keysym == 0) {
408 409 /* exit/enter grab if pressing Ctrl-Alt */
409 410 if (!gui_grab)
... ... @@ -415,7 +416,6 @@ static void sdl_refresh(DisplayState *ds)
415 416 reset_keys();
416 417 break;
417 418 }
418   - gui_key_modifier_pressed = 0;
419 419 gui_keysym = 0;
420 420 }
421 421 }
... ... @@ -456,8 +456,8 @@ static void sdl_refresh(DisplayState *ds)
456 456 }
457 457 break;
458 458 case SDL_ACTIVEEVENT:
459   - if (gui_grab && (ev->active.gain & SDL_ACTIVEEVENTMASK) == 0 &&
460   - !gui_fullscreen_initial_grab) {
  459 + if (gui_grab && ev->active.state == SDL_APPINPUTFOCUS &&
  460 + !ev->active.gain && !gui_fullscreen_initial_grab) {
461 461 sdl_grab_end();
462 462 }
463 463 break;
... ...