Commits

Seth ProductEngine  committed 45737ec

EXP-1488 FIXED Minimum viewer window size limited to 1024x768 on Linux.

  • Participants
  • Parent commits ad54559

Comments (0)

Files changed (1)

File indra/llwindow/llwindowsdl.cpp

 
 const S32 MAX_NUM_RESOLUTIONS = 200;
 
+const S32 MIN_WINDOW_WIDTH = 1024;
+const S32 MIN_WINDOW_HEIGHT = 768;
+
 // static variable for ATI mouse cursor crash work-around:
 static bool ATIbug = false; 
 
                 break;
 
             case SDL_VIDEORESIZE:  // *FIX: handle this?
+            {
 		llinfos << "Handling a resize event: " << event.resize.w <<
 			"x" << event.resize.h << llendl;
 
+		S32 width = llmax(event.resize.w, MIN_WINDOW_WIDTH);
+		S32 height = llmax(event.resize.h, MIN_WINDOW_HEIGHT);
+
 		// *FIX: I'm not sure this is necessary!
-		mWindow = SDL_SetVideoMode(event.resize.w, event.resize.h, 32, mSDLFlags);
+		mWindow = SDL_SetVideoMode(width, height, 32, mSDLFlags);
 		if (!mWindow)
 		{
 			// *FIX: More informative dialog?
                 break;
 		}
 		
-		mCallbacks->handleResize(this, event.resize.w, event.resize.h );
+		mCallbacks->handleResize(this, width, height);
                 break;
-
+            }
             case SDL_ACTIVEEVENT:
                 if (event.active.state & SDL_APPINPUTFOCUS)
                 {