From e4e4977f5eab5aac24c32b569c5273c4be926cb2 Mon Sep 17 00:00:00 2001 From: callum Date: Fri, 11 Nov 2011 12:29:04 -0800 Subject: EXP-1527 FIX Debug values for windowwidth and windowheight can be set below minimum required values and EXP-1528 Launching viewer with a settings.xml file with windowwidth and windowheight set below minimum values, launches to those values not minimum window size --- indra/newview/llviewerwindow.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index cf21ac4e5d..140cbb4e04 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2161,8 +2161,18 @@ void LLViewerWindow::reshape(S32 width, S32 height) if (!maximized && mWindow->getSize(&window_size)) { - gSavedSettings.setS32("WindowWidth", window_size.mX); - gSavedSettings.setS32("WindowHeight", window_size.mY); + U32 min_window_width=gSavedSettings.getU32("MinWindowWidth"); + if ( window_size.mX < min_window_width ) + window_size.mX=min_window_width; + gSavedSettings.setU32("WindowWidth", window_size.mX); + + U32 min_window_height=gSavedSettings.getU32("MinWindowHeight"); + if ( window_size.mY < min_window_height ) + window_size.mY=min_window_height; + gSavedSettings.setU32("WindowHeight", window_size.mY); + + // tell the OS specific window code about min windoow size + mWindow->setMinSize(min_window_width, min_window_height); } LLViewerStats::getInstance()->setStat(LLViewerStats::ST_WINDOW_WIDTH, (F64)width); -- cgit v1.2.3 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/newview/llviewerwindow.cpp | 70 +++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 37 deletions(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 140cbb4e04..f24bab29a6 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -838,6 +838,20 @@ void LLViewerWindow::updateDebugText() // LLViewerWindow // +LLViewerWindow::Params::Params() +: title("title"), + name("name"), + x("x"), + y("y"), + width("width"), + height("height"), + min_width("min_width"), + min_height("min_height"), + fullscreen("fullscreen", false), + ignore_pixel_depth("ignore_pixel_depth", false) +{} + + BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK mask, LLMouseHandler::EClickType clicktype, BOOL down) { const char* buttonname = ""; @@ -1531,18 +1545,13 @@ std::string LLViewerWindow::translateString(const char* tag, // // Classes // -LLViewerWindow::LLViewerWindow( - const std::string& title, const std::string& name, - S32 x, S32 y, - S32 width, S32 height, - BOOL fullscreen, BOOL ignore_pixel_depth) // fullscreen is no longer used - : - mWindow(NULL), +LLViewerWindow::LLViewerWindow(const Params& p) +: mWindow(NULL), mActive(true), mUIVisible(true), - mWindowRectRaw(0, height, width, 0), - mWindowRectScaled(0, height, width, 0), - mWorldViewRectRaw(0, height, width, 0), + mWindowRectRaw(0, p.height, p.width, 0), + mWindowRectScaled(0, p.height, p.width, 0), + mWorldViewRectRaw(0, p.height, p.width, 0), mLeftMouseDown(FALSE), mMiddleMouseDown(FALSE), mRightMouseDown(FALSE), @@ -1578,12 +1587,12 @@ LLViewerWindow::LLViewerWindow( // create window mWindow = LLWindowManager::createWindow(this, - title, name, x, y, width, height, 0, - fullscreen, + p.title, p.name, p.x, p.y, p.width, p.height, 0, + p.fullscreen, gHeadlessClient, gSavedSettings.getBOOL("DisableVerticalSync"), !gHeadlessClient, - ignore_pixel_depth, + p.ignore_pixel_depth, gSavedSettings.getBOOL("RenderDeferred") ? 0 : gSavedSettings.getU32("RenderFSAASamples")); //don't use window level anti-aliasing if FBOs are enabled if (NULL == mWindow) @@ -1610,10 +1619,11 @@ LLViewerWindow::LLViewerWindow( LL_WARNS("Window") << " Someone took over my signal/exception handler (post createWindow)!" << LL_ENDL; } + mWindow->setMinSize(p.min_width, p.min_height); LLCoordScreen scr; mWindow->getSize(&scr); - if(fullscreen && ( scr.mX!=width || scr.mY!=height)) + if(p.fullscreen && ( scr.mX!=p.width || scr.mY!=p.height)) { llwarns << "Fullscreen has forced us in to a different resolution now using "<getMaximized(); gSavedSettings.setBOOL("WindowMaximized", maximized); - LLCoordScreen window_size; - if (!maximized - && mWindow->getSize(&window_size)) + if (!maximized) { U32 min_window_width=gSavedSettings.getU32("MinWindowWidth"); - if ( window_size.mX < min_window_width ) - window_size.mX=min_window_width; - gSavedSettings.setU32("WindowWidth", window_size.mX); - U32 min_window_height=gSavedSettings.getU32("MinWindowHeight"); - if ( window_size.mY < min_window_height ) - window_size.mY=min_window_height; - gSavedSettings.setU32("WindowHeight", window_size.mY); - - // tell the OS specific window code about min windoow size + // tell the OS specific window code about min window size mWindow->setMinSize(min_window_width, min_window_height); } @@ -4099,25 +4099,21 @@ void LLViewerWindow::resetSnapshotLoc() sSnapshotDir.clear(); } -static S32 BORDERHEIGHT = 0; -static S32 BORDERWIDTH = 0; - // static void LLViewerWindow::movieSize(S32 new_width, S32 new_height) { - LLCoordScreen size; + LLCoordWindow size; gViewerWindow->getWindow()->getSize(&size); - if ( (size.mX != new_width + BORDERWIDTH) - ||(size.mY != new_height + BORDERHEIGHT)) + if ( size.mX != new_width + || size.mY != new_height) { // use actual display dimensions, not virtual UI dimensions S32 x = gViewerWindow->getWindowWidthRaw(); S32 y = gViewerWindow->getWindowHeightRaw(); - BORDERWIDTH = size.mX - x; - BORDERHEIGHT = size.mY- y; - LLCoordScreen new_size(new_width + BORDERWIDTH, - new_height + BORDERHEIGHT); - gViewerWindow->getWindow()->setSize(new_size); + LLCoordWindow new_size(new_width, new_height); + LLCoordScreen screen_size; + gViewerWindow->getWindow()->convertCoords(new_size, &screen_size); + gViewerWindow->getWindow()->setSize(screen_size); } } -- cgit v1.2.3 From f5159294f1c67503a1137f1fe31a41954643a7d7 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 28 Nov 2011 15:21:01 -0800 Subject: build fix --- indra/newview/llviewerwindow.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index f24bab29a6..2479006eeb 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4107,9 +4107,6 @@ void LLViewerWindow::movieSize(S32 new_width, S32 new_height) if ( size.mX != new_width || size.mY != new_height) { - // use actual display dimensions, not virtual UI dimensions - S32 x = gViewerWindow->getWindowWidthRaw(); - S32 y = gViewerWindow->getWindowHeightRaw(); LLCoordWindow new_size(new_width, new_height); LLCoordScreen screen_size; gViewerWindow->getWindow()->convertCoords(new_size, &screen_size); -- cgit v1.2.3 From d089e6c26452a61fa3b33b71735bc39d90701865 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 28 Nov 2011 19:16:49 -0800 Subject: bumped up MSVC warning level to 3 to catch more stuff that gcc catches --- indra/newview/llviewerwindow.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 2479006eeb..7bc4248053 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4107,6 +4107,7 @@ 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); -- cgit v1.2.3 From a16bc265da9229bebc7ced7aeccdf56693b88a80 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 28 Nov 2011 22:30:57 -0800 Subject: build fix --- indra/newview/llviewerwindow.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llviewerwindow.cpp') 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); -- cgit v1.2.3 From ff32ef773b19a6d0f7826c7edf7962e2fde492e6 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 29 Nov 2011 23:53:28 -0800 Subject: fix for crash on startup (font system not initialized when first creating fonts) --- indra/newview/llviewerwindow.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 2479006eeb..22076417a6 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4745,6 +4745,9 @@ void LLViewerWindow::initFonts(F32 zoom_factor) { LLFontGL::destroyAllGL(); // Initialize with possibly different zoom factor + + LLFontManager::initClass(); + LLFontGL::initClass( gSavedSettings.getF32("FontScreenDPI"), mDisplayScale.mV[VX] * zoom_factor, mDisplayScale.mV[VY] * zoom_factor, -- cgit v1.2.3