Try to fix long-standing crash-on-resize in Linux.

It appear's SDL's SetVideoMode can cause repeat SDL_VIDEORESIZE message and shouldn't be called again.
This commit is contained in:
Siana Gearz
2013-01-27 01:41:17 +01:00
parent 5e799b1f81
commit aed472af77

View File

@@ -1854,7 +1854,7 @@ void LLWindowSDL::gatherInput()
mCallbacks->handlePaint(this, 0, 0, mWindow->w, mWindow->h); mCallbacks->handlePaint(this, 0, 0, mWindow->w, mWindow->h);
break; break;
case SDL_VIDEORESIZE: // *FIX: handle this? case SDL_VIDEORESIZE:
{ {
llinfos << "Handling a resize event: " << event.resize.w << llinfos << "Handling a resize event: " << event.resize.w <<
"x" << event.resize.h << llendl; "x" << event.resize.h << llendl;
@@ -1862,8 +1862,10 @@ void LLWindowSDL::gatherInput()
S32 width = llmax(event.resize.w, MIN_WINDOW_WIDTH); S32 width = llmax(event.resize.w, MIN_WINDOW_WIDTH);
S32 height = llmax(event.resize.h, MIN_WINDOW_HEIGHT); S32 height = llmax(event.resize.h, MIN_WINDOW_HEIGHT);
// *FIX: I'm not sure this is necessary! if (width != mWindow->w || height != mWindow->h)
{
mWindow = SDL_SetVideoMode(width, height, 32, mSDLFlags); mWindow = SDL_SetVideoMode(width, height, 32, mSDLFlags);
}
if (!mWindow) if (!mWindow)
{ {
// *FIX: More informative dialog? // *FIX: More informative dialog?