handle window focus to disable xsp
authorJavier S. Pedro <javier@javispedro.com>
Mon, 19 Oct 2009 17:50:18 +0000 (19:50 +0200)
committerJavier S. Pedro <javier@javispedro.com>
Mon, 19 Oct 2009 17:50:18 +0000 (19:50 +0200)
platform/sdli.cpp
platform/sdlv.cpp

index 8b83934..92a2b0d 100644 (file)
@@ -141,6 +141,11 @@ static void processEvent(const SDL_Event& event)
        case SDL_MOUSEMOTION:
                processMouse(event.motion.x, event.motion.y);
                break;
+       case SDL_ACTIVEEVENT:
+               if (event.active.state & SDL_APPINPUTFOCUS) {
+                       S9xVideoOutputFocus(event.active.gain);
+               }
+               break;
        case SDL_QUIT:
                Config.quitting = true;
                break;
index e45a804..573378c 100644 (file)
@@ -722,10 +722,14 @@ void S9xVideoToggleFullscreen()
 
 void S9xVideoOutputFocus(bool hasFocus)
 {
-#if 0 // TODO
-       if (Config.xsp) {
-               setDoubling(hasFocus);
-       } 
+#if MAEMO
+       if (scaler) {
+               if (hasFocus) {
+                       scaler->resume();
+               } else {
+                       scaler->pause();
+               }
+       }
 #endif
 }