summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowsdl.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2011-11-30 17:57:09 -0800
committerRichard Linden <none@none>2011-11-30 17:57:09 -0800
commitc191f523a915888b9d388e1736554dec64f7d887 (patch)
tree1a41f168db2dc9a70ea2890e120281c0d1f5410d /indra/llwindow/llwindowsdl.cpp
parentf5a94e0f8196c5c068995090cd57bb27e97aaac9 (diff)
parent0323a37ac6c55e3ed599f60f4950c49e0e084c4a (diff)
Automated merge with http://hg.secondlife.com/viewer-development
Diffstat (limited to 'indra/llwindow/llwindowsdl.cpp')
-rw-r--r--indra/llwindow/llwindowsdl.cpp30
1 files changed, 23 insertions, 7 deletions
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index 8acb52516a..aed035569d 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;
@@ -966,7 +963,7 @@ BOOL LLWindowSDL::setPosition(const LLCoordScreen position)
return TRUE;
}
-BOOL LLWindowSDL::setSize(const LLCoordScreen size)
+BOOL LLWindowSDL::setSizeImpl(const LLCoordScreen size)
{
if(mWindow)
{
@@ -1036,6 +1033,25 @@ void LLWindowSDL::setMouseClipping( BOOL b )
//SDL_WM_GrabInput(b ? SDL_GRAB_ON : SDL_GRAB_OFF);
}
+// virtual
+void LLWindowSDL::setMinSize(U32 min_width, U32 min_height)
+{
+ LLWindow::setMinSize(min_width, min_height);
+
+#if LL_X11
+ // 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
+}
+
BOOL LLWindowSDL::setCursorPosition(const LLCoordWindow position)
{
BOOL result = TRUE;
@@ -1849,8 +1865,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);
@@ -1866,7 +1882,7 @@ void LLWindowSDL::gatherInput()
}
break;
}
-
+
mCallbacks->handleResize(this, width, height);
break;
}