Mercurial > sdl-ios-xcode
diff src/video/SDL_video.c @ 5282:8e421890cdb8
Fixed bug #1117
There's a new event that's always sent when the window changes size, and that event is what the renderers listen for to determine if they need to rebind their context.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 12 Feb 2011 19:02:14 -0800 |
parents | bad04e4710f6 |
children |
line wrap: on
line diff
--- a/src/video/SDL_video.c Sat Feb 12 17:51:47 2011 -0800 +++ b/src/video/SDL_video.c Sat Feb 12 19:02:14 2011 -0800 @@ -1431,10 +1431,15 @@ /* FIXME: Should this change fullscreen modes? */ if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { + window->w = w; + window->h = h; if (_this->SetWindowSize) { _this->SetWindowSize(_this, window); } - SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, w, h); + if (window->w == w && window->h == h) { + /* We didn't get a SDL_WINDOWEVENT_RESIZED event (by design) */ + SDL_OnWindowResized(window); + } } } @@ -1706,6 +1711,7 @@ SDL_OnWindowResized(SDL_Window * window) { window->surface_valid = SDL_FALSE; + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_SIZE_CHANGED, window->w, window->h); } void