From b01c75cb423f07a3d3354f8bd62f265f80062b3b Mon Sep 17 00:00:00 2001 From: Adam Moss Date: Thu, 16 Apr 2009 23:45:35 +0000 Subject: svn merge -r117314:117337 svn+ssh://svn.lindenlab.com/svn/linden/branches/moss/mv13a-merge-1 QAR-1343 maint-viewer-13a+libcurlexploitfix-3-3 combo merge --- indra/llwindow/llwindowmacosx.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'indra/llwindow/llwindowmacosx.cpp') diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 4f6df0f152..65a40dcef4 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -2527,19 +2527,33 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e } mCallbacks->handleFocusLost(this); break; + case kEventWindowBoundsChanging: { + // This is where we would constrain move/resize to a particular screen + + const S32 MIN_WIDTH = 320; + const S32 MIN_HEIGHT = 240; + Rect currentBounds; Rect previousBounds; GetEventParameter(event, kEventParamCurrentBounds, typeQDRectangle, NULL, sizeof(Rect), NULL, ¤tBounds); GetEventParameter(event, kEventParamPreviousBounds, typeQDRectangle, NULL, sizeof(Rect), NULL, &previousBounds); - // This is where we would constrain move/resize to a particular screen - if(0) + + if ((currentBounds.right - currentBounds.left) < MIN_WIDTH) { - SetEventParameter(event, kEventParamCurrentBounds, typeQDRectangle, sizeof(Rect), ¤tBounds); + currentBounds.right = currentBounds.left + MIN_WIDTH; } + + if ((currentBounds.bottom - currentBounds.top) < MIN_HEIGHT) + { + currentBounds.bottom = currentBounds.top + MIN_HEIGHT; + } + + SetEventParameter(event, kEventParamCurrentBounds, typeQDRectangle, sizeof(Rect), ¤tBounds); + result = noErr; } break; @@ -2597,7 +2611,6 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e // BringToFront(mWindow); // result = noErr; break; - } break; -- cgit v1.2.3