mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-23 11:04:44 +00:00
SDL: Send EVENT_SCREEN_CHANGED after receiving SDL_VIDEORESIZE when necessary.
This fixes some ugly crashes when resizing the window in OpenGL mode.
This commit is contained in:
parent
ed180f6b67
commit
53f9c0d69b
@ -391,8 +391,17 @@ bool SdlEventSource::dispatchSDLEvent(SDL_Event &ev, Common::Event &event) {
|
||||
return false;
|
||||
|
||||
case SDL_VIDEORESIZE:
|
||||
if (_graphicsManager)
|
||||
if (_graphicsManager) {
|
||||
_graphicsManager->notifyResize(ev.resize.w, ev.resize.h);
|
||||
|
||||
// If the screen changed, send an Common::EVENT_SCREEN_CHANGED
|
||||
int screenID = ((OSystem_SDL *)g_system)->getGraphicsManager()->getScreenChangeID();
|
||||
if (screenID != _lastScreenID) {
|
||||
_lastScreenID = screenID;
|
||||
event.type = Common::EVENT_SCREEN_CHANGED;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
case SDL_QUIT:
|
||||
|
Loading…
x
Reference in New Issue
Block a user