From 20221c8e77824068d4a54885f5c57ace1c9660a2 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 28 Nov 2011 12:51:15 -0800 Subject: EXP-1485 FIX -- Viewer should have a minimum size moved min size logic into LLWindow --- indra/llwindow/llwindowsdl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llwindow/llwindowsdl.cpp') diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index da2222ad51..c75b6c2dce 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -966,7 +966,7 @@ BOOL LLWindowSDL::setPosition(const LLCoordScreen position) return TRUE; } -BOOL LLWindowSDL::setSize(const LLCoordScreen size) +BOOL LLWindowSDL::setSizeImpl(const LLCoordScreen size) { if(mWindow) { -- cgit v1.2.3 From 9a5a96aadc5fe5e8582663bd616b457def749b5b Mon Sep 17 00:00:00 2001 From: Seth ProductEngine 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 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'indra/llwindow/llwindowsdl.cpp') 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; } -- cgit v1.2.3 From 1a7e49ece8e9811ef2fceaebd38178c6ae7b8a46 Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Wed, 30 Nov 2011 01:01:22 +0200 Subject: EXP-1580 FIXED applying "MinWindowWidth" and "MinWindowHeight" settings to Linux viewer window. Added minimum size setting method for X11 viewer window on Linux. --- indra/llwindow/llwindowsdl.cpp | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) (limited to 'indra/llwindow/llwindowsdl.cpp') 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; -- cgit v1.2.3 From 1e2d424f9e82a1d75a4b78b06910400f55c5169a Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 5 Dec 2011 23:35:29 +0100 Subject: STORM-1713: Mouse pointer flickers when hovering over any active/clickable UI item --- indra/llwindow/llwindowsdl.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'indra/llwindow/llwindowsdl.cpp') diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 8acb52516a..f8c6697432 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -1920,6 +1920,8 @@ void LLWindowSDL::gatherInput() break; } } + + updateCursor(); #if LL_X11 // This is a good time to stop flashing the icon if our mFlashTimer has @@ -2006,7 +2008,7 @@ static SDL_Cursor *makeSDLCursorFromBMP(const char *filename, int hotx, int hoty return sdlcursor; } -void LLWindowSDL::setCursor(ECursorType cursor) +void LLWindowSDL::updateCursor() { if (ATIbug) { // cursor-updating is very flaky when this bug is @@ -2014,11 +2016,11 @@ void LLWindowSDL::setCursor(ECursorType cursor) return; } - if (mCurrentCursor != cursor) + if (mCurrentCursor != mNextCursor) { - if (cursor < UI_CURSOR_COUNT) + if (mNextCursor < UI_CURSOR_COUNT) { - SDL_Cursor *sdlcursor = mSDLCursors[cursor]; + SDL_Cursor *sdlcursor = mSDLCursors[mNextCursor]; // Try to default to the arrow for any cursors that // did not load correctly. if (!sdlcursor && mSDLCursors[UI_CURSOR_ARROW]) @@ -2026,9 +2028,9 @@ void LLWindowSDL::setCursor(ECursorType cursor) if (sdlcursor) SDL_SetCursor(sdlcursor); } else { - llwarns << "Tried to set invalid cursor number " << cursor << llendl; + llwarns << "Tried to set invalid cursor number " << mNextCursor << llendl; } - mCurrentCursor = cursor; + mCurrentCursor = mNextCursor; } } -- cgit v1.2.3 From 1c71b9030062985c307704bdf42925e0c7cb97b6 Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Tue, 6 Dec 2011 21:43:58 +0200 Subject: EXP-1651 FIXED Added saving window size after each reshape. Fixed broken resize indicator on Linux viewer window (EXP-1580). --- indra/llwindow/llwindowsdl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llwindow/llwindowsdl.cpp') diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index aed035569d..6d593c807e 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -1034,9 +1034,9 @@ void LLWindowSDL::setMouseClipping( BOOL b ) } // virtual -void LLWindowSDL::setMinSize(U32 min_width, U32 min_height) +void LLWindowSDL::setMinSize(U32 min_width, U32 min_height, bool enforce_immediately) { - LLWindow::setMinSize(min_width, min_height); + LLWindow::setMinSize(min_width, min_height, enforce_immediately); #if LL_X11 // Set the minimum size limits for X11 window -- cgit v1.2.3