summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
authorSeth ProductEngine <slitovchuk@productengine.com>2011-11-30 01:01:22 +0200
committerSeth ProductEngine <slitovchuk@productengine.com>2011-11-30 01:01:22 +0200
commit1a7e49ece8e9811ef2fceaebd38178c6ae7b8a46 (patch)
tree7e945563ff7aae6466c4ce504d3db565f70b3384 /indra/llwindow
parentadeb71d98279fc4e8af7859cd36114be9f95e6da (diff)
EXP-1580 FIXED applying "MinWindowWidth" and "MinWindowHeight" settings to Linux viewer window.
Added minimum size setting method for X11 viewer window on Linux.
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llwindowsdl.cpp41
-rw-r--r--indra/llwindow/llwindowsdl.h2
2 files changed, 20 insertions, 23 deletions
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index a70791d39f..10f2c2f04d 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -179,20 +179,6 @@ 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
@@ -752,8 +738,6 @@ 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
{
@@ -1050,6 +1034,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;
@@ -1880,12 +1883,6 @@ 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 a98b1b74bd..76019999b1 100644
--- a/indra/llwindow/llwindowsdl.h
+++ b/indra/llwindow/llwindowsdl.h
@@ -76,6 +76,7 @@ public:
/*virtual*/ void captureMouse();
/*virtual*/ void releaseMouse();
/*virtual*/ void setMouseClipping( BOOL b );
+ /*virtual*/ void setMinSize(U32 min_width, U32 min_height);
/*virtual*/ BOOL isClipboardTextAvailable();
/*virtual*/ BOOL pasteTextFromClipboard(LLWString &dst);
@@ -140,7 +141,6 @@ public:
#if LL_X11
static Window get_SDL_XWindowID(void);
static Display* get_SDL_Display(void);
- void setXWindowMinSize();
#endif // LL_X11
protected: