From a16bc265da9229bebc7ced7aeccdf56693b88a80 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Mon, 28 Nov 2011 22:30:57 -0800
Subject: build fix

---
 indra/newview/llviewerwindow.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 7bc4248053..2479006eeb 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -4107,7 +4107,6 @@ void LLViewerWindow::movieSize(S32 new_width, S32 new_height)
 	if ( size.mX != new_width
 		|| size.mY != new_height)
 	{
-		S32 x = 0;
 		LLCoordWindow new_size(new_width, new_height);
 		LLCoordScreen screen_size;
 		gViewerWindow->getWindow()->convertCoords(new_size, &screen_size);
-- 
cgit v1.2.3


From 9a5a96aadc5fe5e8582663bd616b457def749b5b Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Tue, 29 Nov 2011 16:45:10 +0200
Subject: EXP-1580 FIXED resize indicator on Linux showing Viewer window can be
 resized below minimum size. Fixed using minimum window dimensions configured
 in debug settings.

---
 indra/llwindow/llwindowsdl.cpp | 29 ++++++++++++++++++++++++-----
 indra/llwindow/llwindowsdl.h   |  1 +
 2 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index c75b6c2dce..a70791d39f 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -63,9 +63,6 @@ extern BOOL gDebugWindowProc;
 
 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; 
 
@@ -182,6 +179,20 @@ Display* LLWindowSDL::get_SDL_Display(void)
 	}
 	return NULL;
 }
+
+void LLWindowSDL::setXWindowMinSize()
+{
+	// Set the minimum size limits for X11 window
+	// so the window manager doesn't allow resizing below those limits.
+	XSizeHints* hints = XAllocSizeHints();
+	hints->flags |= PMinSize;
+	hints->min_width = mMinWindowWidth;
+	hints->min_height = mMinWindowHeight;
+
+	XSetWMNormalHints(mSDL_Display, mSDL_XWindowID, hints);
+
+	XFree(hints);
+}
 #endif // LL_X11
 
 
@@ -741,6 +752,8 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
 			mSDL_XWindowID = info.info.x11.wmwindow;
 			Lock_Display = info.info.x11.lock_func;
 			Unlock_Display = info.info.x11.unlock_func;
+
+			setXWindowMinSize();
 		}
 		else
 		{
@@ -1850,8 +1863,8 @@ void LLWindowSDL::gatherInput()
 		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);
+		S32 width = llmax(event.resize.w, (S32)mMinWindowWidth);
+		S32 height = llmax(event.resize.h, (S32)mMinWindowHeight);
 
 		// *FIX: I'm not sure this is necessary!
 		mWindow = SDL_SetVideoMode(width, height, 32, mSDLFlags);
@@ -1868,6 +1881,12 @@ void LLWindowSDL::gatherInput()
                 break;
 		}
 		
+#if LL_X11
+		// The minimum size limits should be reset after
+		// each successful SDL_SetVideoMode() call.
+		setXWindowMinSize();
+#endif
+
 		mCallbacks->handleResize(this, width, height);
                 break;
             }
diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h
index 03dbfc22e0..a98b1b74bd 100644
--- a/indra/llwindow/llwindowsdl.h
+++ b/indra/llwindow/llwindowsdl.h
@@ -140,6 +140,7 @@ public:
 #if LL_X11
 	static Window get_SDL_XWindowID(void);
 	static Display* get_SDL_Display(void);
+	void setXWindowMinSize();
 #endif // LL_X11	
 
 protected:
-- 
cgit v1.2.3