diff options
author | Leslie Linden <leslie@lindenlab.com> | 2011-12-02 12:33:51 -0800 |
---|---|---|
committer | Leslie Linden <leslie@lindenlab.com> | 2011-12-02 12:33:51 -0800 |
commit | ef0552a090123974682790afdafec68218578113 (patch) | |
tree | a67ef723145d4d646289354918dd008412ab6eb3 | |
parent | 4d14bb02b908c37f73e915af811027c1d193b667 (diff) |
EXP-1642 FIX -- Viewer crash on startup on Mac
Minimum window size setting no longer forces propagation to the OS before root view is initialized.
-rw-r--r-- | indra/llwindow/llwindow.cpp | 14 | ||||
-rw-r--r-- | indra/llwindow/llwindow.h | 2 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 3 |
3 files changed, 11 insertions, 8 deletions
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp index 4919605afd..0e17cffc9d 100644 --- a/indra/llwindow/llwindow.cpp +++ b/indra/llwindow/llwindow.cpp @@ -193,20 +193,22 @@ BOOL LLWindow::setSize(LLCoordScreen size) // virtual -void LLWindow::setMinSize(U32 min_width, U32 min_height) +void LLWindow::setMinSize(U32 min_width, U32 min_height, bool enforce_immediately) { mMinWindowWidth = min_width; mMinWindowHeight = min_height; - LLCoordScreen cur_size; - if (!getMaximized() && getSize(&cur_size)) + if (enforce_immediately) { - if (cur_size.mX < mMinWindowWidth || cur_size.mY < mMinWindowHeight) + LLCoordScreen cur_size; + if (!getMaximized() && getSize(&cur_size)) { - setSizeImpl(LLCoordScreen(llmin(cur_size.mX, mMinWindowWidth), llmin(cur_size.mY, mMinWindowHeight))); + if (cur_size.mX < mMinWindowWidth || cur_size.mY < mMinWindowHeight) + { + setSizeImpl(LLCoordScreen(llmin(cur_size.mX, mMinWindowWidth), llmin(cur_size.mY, mMinWindowHeight))); + } } } - } //virtual diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index 77a9e88287..ec41f24465 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -73,7 +73,7 @@ public: virtual BOOL getSize(LLCoordWindow *size) = 0; virtual BOOL setPosition(LLCoordScreen position) = 0; BOOL setSize(LLCoordScreen size); - virtual void setMinSize(U32 min_width, U32 min_height); + virtual void setMinSize(U32 min_width, U32 min_height, bool enforce_immediately = true); virtual BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) = 0; virtual BOOL setCursorPosition(LLCoordWindow position) = 0; virtual BOOL getCursorPosition(LLCoordWindow *position) = 0; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index c38eda5d30..eb72a8657f 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1597,7 +1597,8 @@ LLViewerWindow::LLViewerWindow(const Params& p) LL_WARNS("Window") << " Someone took over my signal/exception handler (post createWindow)!" << LL_ENDL; } - mWindow->setMinSize(p.min_width, p.min_height); + const bool do_not_enforce = false; + mWindow->setMinSize(p.min_width, p.min_height, do_not_enforce); // root view not set LLCoordScreen scr; mWindow->getSize(&scr); |