It seems there is an intention to clear all modifier keys (in the SDL
front-end) when the window loses focus, but it seems that it doesn't
work right. Let's just explicitly do it when we lose input focus.

Signed-off-by: Brad Jorsch <ano...@users.sourceforge.net>
---
 sdl.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/sdl.c b/sdl.c
index f6fabf1..c155113 100644
--- a/sdl.c
+++ b/sdl.c
@@ -728,6 +728,9 @@ static void sdl_refresh(DisplayState *ds)
             }
             break;
         case SDL_ACTIVEEVENT:
+            if (ev->active.state == SDL_APPINPUTFOCUS && !ev->active.gain) {
+                reset_keys();
+            }
             if (gui_grab && ev->active.state == SDL_APPINPUTFOCUS &&
                 !ev->active.gain && !gui_fullscreen_initial_grab) {
                 sdl_grab_end();
-- 
1.7.1



Reply via email to