more properly handling new haa semantics
authorJavier S. Pedro <maemo@javispedro.com>
Sun, 4 Apr 2010 01:12:43 +0000 (03:12 +0200)
committerJavier S. Pedro <maemo@javispedro.com>
Sun, 4 Apr 2010 01:12:43 +0000 (03:12 +0200)
platform/sdli.cpp
platform/sdlv.cpp
platform/sdlv.h

index a3c4745..5a3e7bf 100644 (file)
@@ -142,6 +142,8 @@ static void processMouse(unsigned int x, unsigned int y, int pressed = 0)
 
 static void processEvent(const SDL_Event& event)
 {
+       if (videoEventFilter(event)) return;
+
        switch (event.type) 
        {
                case SDL_KEYDOWN:
@@ -165,10 +167,6 @@ static void processEvent(const SDL_Event& event)
                case SDL_QUIT:
                        Config.quitting = true;
                        break;
-               case SDL_ACTIVEEVENT:
-               case SDL_SYSWMEVENT:
-                       processVideoEvent(event);
-                       break;
        }
 }
 
index fe5cfb7..9896494 100644 (file)
@@ -207,7 +207,7 @@ void S9xVideoToggleFullscreen()
        drawOnscreenControls();
 }
 
-void processVideoEvent(const SDL_Event& event)
+bool videoEventFilter(const SDL_Event& event)
 {
        // If we're in power save mode, and this is a defocus event, quit.
        if (Config.saver) {
@@ -215,13 +215,15 @@ void processVideoEvent(const SDL_Event& event)
                   (event.active.state & SDL_APPINPUTFOCUS) &&
                   !event.active.gain) {
                        S9xDoAction(kActionQuit);
-                       return;
+                       return true;
                }
        }
 
        // Forward video event to the active scaler, if any.
        if (scaler)
-               scaler->filter(event);
+               return scaler->filter(event);
+       else
+               return false;
 }
 
 // This is here for completeness, but palette mode is mostly useless (slow).
index 7629b03..4258623 100644 (file)
@@ -42,7 +42,7 @@ extern SDL_Surface* screen;
 /** The current scaler object */
 extern Scaler* scaler;
 
-void processVideoEvent(const SDL_Event& event);
+bool videoEventFilter(const SDL_Event& event);
 
 #if CONF_EXIT_BUTTON
 void ExitBtnReset();