summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llwindow/llwindowsdl.cpp29
-rw-r--r--indra/llwindow/llwindowsdl.h1
-rw-r--r--indra/newview/llviewerwindow.cpp1
3 files changed, 25 insertions, 6 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:
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);