From 95ecad54c6f037910a5a22f7ef30026cf628fe80 Mon Sep 17 00:00:00 2001 From: callum Date: Tue, 28 Sep 2010 16:52:56 -0700 Subject: EXP-112 Enable fullscreen mode (with mode switch, not resize to desktop) as per 1.x viewer. --- indra/llwindow/llwindowwin32.cpp | 22 +++++++++++++++++++++- indra/newview/app_settings/cmd_line.xml | 8 ++++++++ indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llappviewer.cpp | 2 +- indra/newview/llviewerwindow.cpp | 11 ++++++++++- 5 files changed, 51 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 87075c7318..ab089081e6 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -544,7 +544,27 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, if (closest_refresh == 0) { LL_WARNS("Window") << "Couldn't find display mode " << width << " by " << height << " at " << BITS_PER_PIXEL << " bits per pixel" << LL_ENDL; - success = FALSE; + //success = FALSE; + + if (!EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dev_mode)) + { + success = FALSE; + } + else + { + if (dev_mode.dmBitsPerPel == BITS_PER_PIXEL) + { + LL_WARNS("Window") << "Current BBP is OK falling back to that" << LL_ENDL; + window_rect.right=width=dev_mode.dmPelsWidth; + window_rect.bottom=height=dev_mode.dmPelsHeight; + success = TRUE; + } + else + { + LL_WARNS("Window") << "Current BBP is BAD" << LL_ENDL; + success = FALSE; + } + } } // If we found a good resolution, use it. diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml index 962c4e9d36..aa2f1c41d2 100644 --- a/indra/newview/app_settings/cmd_line.xml +++ b/indra/newview/app_settings/cmd_line.xml @@ -391,5 +391,13 @@ CrashOnStartup + fullscreen + + desc + Force full screen mode + map-to + WindowFullScreen + + diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index a83291b530..9c19d2c638 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -11684,6 +11684,17 @@ Boolean Value 1 + + WindowFullScreen + + Comment + SL viewer window full screen + Persist + 1 + Type + Boolean + Value + 0 WindowHeight diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 02a8c3e674..956f67df86 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2386,7 +2386,7 @@ bool LLAppViewer::initWindow() VIEWER_WINDOW_CLASSNAME, gSavedSettings.getS32("WindowX"), gSavedSettings.getS32("WindowY"), gSavedSettings.getS32("WindowWidth"), gSavedSettings.getS32("WindowHeight"), - FALSE, ignorePixelDepth); + gSavedSettings.getBOOL("WindowFullScreen"), ignorePixelDepth); // Need to load feature table before cheking to start watchdog. const S32 NEVER_SUBMIT_REPORT = 2; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index fb43b51deb..ea32adf5b6 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1349,8 +1349,17 @@ LLViewerWindow::LLViewerWindow( if (!LLAppViewer::instance()->restoreErrorTrap()) { LL_WARNS("Window") << " Someone took over my signal/exception handler (post createWindow)!" << LL_ENDL; - } + } + + LLCoordScreen scr; + mWindow->getSize(&scr); + if(fullscreen && ( scr.mX!=width || scr.mY!=height)) + { + llwarns << "Fullscreen has forced us in to a different resolution now using "<