Browse Source

Handle window focus events when svid movie is playing

pull/6052/head
staphen 3 years ago committed by Anders Jenbo
parent
commit
fa0147cfa5
  1. 17
      Source/movie.cpp

17
Source/movie.cpp

@ -55,6 +55,23 @@ void play_movie(const char *pszMovie, bool userCanClose)
if (userCanClose || (event.type == SDL_KEYDOWN && event.key.keysym.sym == SDLK_ESCAPE))
movie_playing = false;
break;
#ifndef USE_SDL1
case SDL_WINDOWEVENT:
if (event.window.event == SDL_WINDOWEVENT_FOCUS_LOST)
diablo_focus_pause();
else if (event.window.event == SDL_WINDOWEVENT_FOCUS_GAINED)
diablo_focus_unpause();
break;
#else
case SDL_ACTIVEEVENT:
if ((event.active.state & SDL_APPINPUTFOCUS) != 0) {
if (event.active.gain == 0)
diablo_focus_pause();
else
diablo_focus_unpause();
}
break;
#endif
case SDL_QUIT:
SVidPlayEnd();
diablo_quit(0);

Loading…
Cancel
Save