From: Javier S. Pedro Date: Sun, 4 Apr 2010 01:12:43 +0000 (+0200) Subject: more properly handling new haa semantics X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=4486e487785be514761017cde58a65e67f26ca9b;p=drnoksnes more properly handling new haa semantics --- diff --git a/platform/sdli.cpp b/platform/sdli.cpp index a3c4745..5a3e7bf 100644 --- a/platform/sdli.cpp +++ b/platform/sdli.cpp @@ -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; } } diff --git a/platform/sdlv.cpp b/platform/sdlv.cpp index fe5cfb7..9896494 100644 --- a/platform/sdlv.cpp +++ b/platform/sdlv.cpp @@ -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). diff --git a/platform/sdlv.h b/platform/sdlv.h index 7629b03..4258623 100644 --- a/platform/sdlv.h +++ b/platform/sdlv.h @@ -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();