diff options
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 65 |
1 files changed, 13 insertions, 52 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 43e803fe7a..cc10d08f3a 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1606,8 +1606,6 @@ BOOL LLViewerWindow::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 { if (ui_scale_factor >= MIN_UI_SCALE && ui_scale_factor <= MAX_UI_SCALE) { - gSavedSettings.setF32("LastSystemUIScaleFactor", ui_scale_factor); - gSavedSettings.setF32("UIScaleFactor", ui_scale_factor); LLViewerWindow::reshape(window_width, window_height); mResDirty = true; return TRUE; @@ -1619,6 +1617,14 @@ BOOL LLViewerWindow::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 } } +BOOL LLViewerWindow::handleWindowDidChangeScreen(LLWindow *window) +{ + LLCoordScreen window_rect; + mWindow->getSize(&window_rect); + reshape(window_rect.mX, window_rect.mY); + return TRUE; +} + void LLViewerWindow::handlePingWatchdog(LLWindow *window, const char * msg) { LLAppViewer::instance()->pingMainloopTimeout(msg); @@ -1681,8 +1687,7 @@ LLViewerWindow::LLViewerWindow(const Params& p) mResDirty(false), mStatesDirty(false), mCurrResolutionIndex(0), - mProgressView(NULL), - mSystemUIScaleFactorChanged(false) + mProgressView(NULL) { // gKeyboard is still NULL, so it doesn't do LLWindowListener any good to // pass its value right now. Instead, pass it a nullary function that @@ -1758,31 +1763,9 @@ LLViewerWindow::LLViewerWindow(const Params& p) LLCoordScreen scr; mWindow->getSize(&scr); - if(p.fullscreen && ( scr.mX!=p.width || scr.mY!=p.height)) - { - LL_WARNS() << "Fullscreen has forced us in to a different resolution now using "<<scr.mX<<" x "<<scr.mY<<LL_ENDL; - gSavedSettings.setS32("FullScreenWidth",scr.mX); - gSavedSettings.setS32("FullScreenHeight",scr.mY); - } - - - F32 system_scale_factor = mWindow->getSystemUISize(); - if (system_scale_factor < MIN_UI_SCALE || system_scale_factor > MAX_UI_SCALE) - { - // reset to default; - system_scale_factor = 1.f; - } - if (p.first_run || gSavedSettings.getF32("LastSystemUIScaleFactor") != system_scale_factor) - { - mSystemUIScaleFactorChanged = !p.first_run; - gSavedSettings.setF32("LastSystemUIScaleFactor", system_scale_factor); - gSavedSettings.setF32("UIScaleFactor", system_scale_factor); - } - - // Get the real window rect the window was created with (since there are various OS-dependent reasons why // the size of a window or fullscreen context may have been adjusted slightly...) - F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE); + F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE) * mWindow->getSystemUISize(); mDisplayScale.setVec(llmax(1.f / mWindow->getPixelAspectRatio(), 1.f), llmax(mWindow->getPixelAspectRatio(), 1.f)); mDisplayScale *= ui_scale_factor; @@ -1875,33 +1858,11 @@ LLViewerWindow::LLViewerWindow(const Params& p) mWorldViewRectScaled = calcScaledRect(mWorldViewRectRaw, mDisplayScale); } -//static -void LLViewerWindow::showSystemUIScaleFactorChanged() -{ - LLNotificationsUtil::add("SystemUIScaleFactorChanged", LLSD(), LLSD(), onSystemUIScaleFactorChanged); -} - std::string LLViewerWindow::getLastSnapshotDir() { return sSnapshotDir; } -//static -bool LLViewerWindow::onSystemUIScaleFactorChanged(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if(option == 0) - { - LLFloaterReg::toggleInstanceOrBringToFront("preferences"); - LLFloater* pref_floater = LLFloaterReg::getInstance("preferences"); - LLTabContainer* tab_container = pref_floater->getChild<LLTabContainer>("pref core"); - tab_container->selectTabByName("advanced1"); - - } - return false; -} - - void LLViewerWindow::initGLDefaults() { gGL.setSceneBlendType(LLRender::BT_ALPHA); @@ -3028,12 +2989,12 @@ void LLViewerWindow::moveCursorToCenter() S32 x = getWorldViewWidthScaled() / 2; S32 y = getWorldViewHeightScaled() / 2; + LLUI::setMousePositionScreen(x, y); + //on a forced move, all deltas get zeroed out to prevent jumping mCurrentMousePoint.set(x,y); mLastMousePoint.set(x,y); mCurrentMouseDelta.set(0,0); - - LLUI::setMousePositionScreen(x, y); } } @@ -5377,7 +5338,7 @@ F32 LLViewerWindow::getWorldViewAspectRatio() const void LLViewerWindow::calcDisplayScale() { - F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE); + F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE) * mWindow->getSystemUISize(); LLVector2 display_scale; display_scale.setVec(llmax(1.f / mWindow->getPixelAspectRatio(), 1.f), llmax(mWindow->getPixelAspectRatio(), 1.f)); display_scale *= ui_scale_factor; |