aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llviewerwindow.cpp')
-rw-r--r--linden/indra/newview/llviewerwindow.cpp74
1 files changed, 59 insertions, 15 deletions
diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp
index 7aaf9c0..d8f182c 100644
--- a/linden/indra/newview/llviewerwindow.cpp
+++ b/linden/indra/newview/llviewerwindow.cpp
@@ -31,6 +31,7 @@
31 31
32#include "llviewerprecompiledheaders.h" 32#include "llviewerprecompiledheaders.h"
33 33
34#include "llpanellogin.h"
34#include "llviewerwindow.h" 35#include "llviewerwindow.h"
35 36
36// system library includes 37// system library includes
@@ -105,6 +106,7 @@
105#include "llfloatermap.h" 106#include "llfloatermap.h"
106#include "llfloatermute.h" 107#include "llfloatermute.h"
107#include "llfloaternamedesc.h" 108#include "llfloaternamedesc.h"
109#include "llfloaterpreference.h"
108#include "llfloatersnapshot.h" 110#include "llfloatersnapshot.h"
109#include "llfloatertools.h" 111#include "llfloatertools.h"
110#include "llfloaterworldmap.h" 112#include "llfloaterworldmap.h"
@@ -161,6 +163,7 @@
161#include "llvieweruictrlfactory.h" 163#include "llvieweruictrlfactory.h"
162#include "lluploaddialog.h" 164#include "lluploaddialog.h"
163#include "llurldispatcher.h" // SLURL from other app instance 165#include "llurldispatcher.h" // SLURL from other app instance
166#include "llvieweraudio.h"
164#include "llviewercamera.h" 167#include "llviewercamera.h"
165#include "llviewergesture.h" 168#include "llviewergesture.h"
166#include "llviewerimagelist.h" 169#include "llviewerimagelist.h"
@@ -178,7 +181,9 @@
178#include "llworldmapview.h" 181#include "llworldmapview.h"
179#include "moviemaker.h" 182#include "moviemaker.h"
180#include "pipeline.h" 183#include "pipeline.h"
181#include "viewer.h" 184#include "llappviewer.h"
185#include "llurlsimstring.h"
186#include "llviewerdisplay.h"
182 187
183#if LL_WINDOWS 188#if LL_WINDOWS
184#include "llwindebug.h" 189#include "llwindebug.h"
@@ -240,6 +245,12 @@ BOOL gbCapturing = FALSE;
240MovieMaker gMovieMaker; 245MovieMaker gMovieMaker;
241#endif 246#endif
242 247
248// HUD display lines in lower right
249BOOL gDisplayWindInfo = FALSE;
250BOOL gDisplayCameraPos = FALSE;
251BOOL gDisplayNearestWater = FALSE;
252BOOL gDisplayFOV = FALSE;
253
243S32 CHAT_BAR_HEIGHT = 28; 254S32 CHAT_BAR_HEIGHT = 28;
244S32 OVERLAY_BAR_HEIGHT = 20; 255S32 OVERLAY_BAR_HEIGHT = 20;
245 256
@@ -1192,14 +1203,14 @@ BOOL LLViewerWindow::handleCloseRequest(LLWindow *window)
1192{ 1203{
1193 // User has indicated they want to close, but we may need to ask 1204 // User has indicated they want to close, but we may need to ask
1194 // about modified documents. 1205 // about modified documents.
1195 app_user_quit(); 1206 LLAppViewer::instance()->userQuit();
1196 // Don't quit immediately 1207 // Don't quit immediately
1197 return FALSE; 1208 return FALSE;
1198} 1209}
1199 1210
1200void LLViewerWindow::handleQuit(LLWindow *window) 1211void LLViewerWindow::handleQuit(LLWindow *window)
1201{ 1212{
1202 app_force_quit(NULL); 1213 LLAppViewer::instance()->forceQuit();
1203} 1214}
1204 1215
1205void LLViewerWindow::handleResize(LLWindow *window, S32 width, S32 height) 1216void LLViewerWindow::handleResize(LLWindow *window, S32 width, S32 height)
@@ -1212,6 +1223,8 @@ void LLViewerWindow::handleFocus(LLWindow *window)
1212{ 1223{
1213 gFocusMgr.setAppHasFocus(TRUE); 1224 gFocusMgr.setAppHasFocus(TRUE);
1214 LLModalDialog::onAppFocusGained(); 1225 LLModalDialog::onAppFocusGained();
1226
1227 gAgent.onAppFocusGained();
1215 if (gToolMgr) 1228 if (gToolMgr)
1216 { 1229 {
1217 gToolMgr->onAppFocusGained(); 1230 gToolMgr->onAppFocusGained();
@@ -1315,7 +1328,7 @@ BOOL LLViewerWindow::handleActivate(LLWindow *window, BOOL activated)
1315 gAgent.clearAFK(); 1328 gAgent.clearAFK();
1316 if (mWindow->getFullscreen() && !mIgnoreActivate) 1329 if (mWindow->getFullscreen() && !mIgnoreActivate)
1317 { 1330 {
1318 if (!gQuit) 1331 if (!LLApp::isExiting() )
1319 { 1332 {
1320 if (LLStartUp::getStartupState() >= STATE_STARTED) 1333 if (LLStartUp::getStartupState() >= STATE_STARTED)
1321 { 1334 {
@@ -1505,7 +1518,7 @@ LLViewerWindow::LLViewerWindow(
1505 llwarns << "Unable to create window, be sure screen is set at 32-bit color in Control Panels->Display->Settings" 1518 llwarns << "Unable to create window, be sure screen is set at 32-bit color in Control Panels->Display->Settings"
1506 << llendl; 1519 << llendl;
1507#endif 1520#endif
1508 app_force_exit(1); 1521 LLAppViewer::instance()->forceExit(1);
1509 } 1522 }
1510 1523
1511 // Get the real window rect the window was created with (since there are various OS-dependent reasons why 1524 // Get the real window rect the window was created with (since there are various OS-dependent reasons why
@@ -1892,7 +1905,6 @@ void LLViewerWindow::initWorldUI()
1892 // TODO: Move instance management into class 1905 // TODO: Move instance management into class
1893 gFloaterMap = new LLFloaterMap("Map"); 1906 gFloaterMap = new LLFloaterMap("Map");
1894 gFloaterMap->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); 1907 gFloaterMap->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT);
1895 gFloaterMap->setVisible( gSavedSettings.getBOOL("ShowMiniMap") );
1896 1908
1897 // keep onscreen 1909 // keep onscreen
1898 gFloaterView->adjustToFitScreen(gFloaterMap, FALSE); 1910 gFloaterView->adjustToFitScreen(gFloaterMap, FALSE);
@@ -2107,7 +2119,7 @@ void LLViewerWindow::reshape(S32 width, S32 height)
2107 // reshape messages. We don't care about these, and we 2119 // reshape messages. We don't care about these, and we
2108 // don't want to send messages because the message system 2120 // don't want to send messages because the message system
2109 // may have been destructed. 2121 // may have been destructed.
2110 if (!gQuit) 2122 if (!LLApp::isExiting())
2111 { 2123 {
2112 if (gNoRender) 2124 if (gNoRender)
2113 { 2125 {
@@ -2193,13 +2205,22 @@ void LLViewerWindow::reshape(S32 width, S32 height)
2193void LLViewerWindow::setNormalControlsVisible( BOOL visible ) 2205void LLViewerWindow::setNormalControlsVisible( BOOL visible )
2194{ 2206{
2195 if ( gBottomPanel ) 2207 if ( gBottomPanel )
2208 {
2196 gBottomPanel->setVisible( visible ); 2209 gBottomPanel->setVisible( visible );
2210 gBottomPanel->setEnabled( visible );
2211 }
2197 2212
2198 if ( gMenuBarView ) 2213 if ( gMenuBarView )
2214 {
2199 gMenuBarView->setVisible( visible ); 2215 gMenuBarView->setVisible( visible );
2200 2216 gMenuBarView->setEnabled( visible );
2217 }
2218
2201 if ( gStatusBar ) 2219 if ( gStatusBar )
2202 gStatusBar->setVisible( visible ); 2220 {
2221 gStatusBar->setVisible( visible );
2222 gStatusBar->setEnabled( visible );
2223 }
2203} 2224}
2204 2225
2205 2226
@@ -2408,6 +2429,18 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
2408 toggle_debug_menus(NULL); 2429 toggle_debug_menus(NULL);
2409 } 2430 }
2410 2431
2432 // Explicit hack for debug menu.
2433 if ((mask == (MASK_SHIFT | MASK_CONTROL)) &&
2434 ('G' == key || 'g' == key))
2435 {
2436 if (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP) //on splash page
2437 {
2438 BOOL visible = ! gSavedSettings.getBOOL("ForceShowGrid");
2439 gSavedSettings.setBOOL("ForceShowGrid", visible);
2440 LLPanelLogin::loadLoginPage();
2441 }
2442 }
2443
2411 // Example "bug" for bug reporter web page 2444 // Example "bug" for bug reporter web page
2412 if ((MASK_SHIFT & mask) 2445 if ((MASK_SHIFT & mask)
2413 && (MASK_ALT & mask) 2446 && (MASK_ALT & mask)
@@ -2439,6 +2472,11 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
2439 { 2472 {
2440 return TRUE; 2473 return TRUE;
2441 } 2474 }
2475 // let menus handle navigation keys
2476 if (gLoginMenuBarView && gLoginMenuBarView->handleKey(key, mask, TRUE))
2477 {
2478 return TRUE;
2479 }
2442 2480
2443 // Traverses up the hierarchy 2481 // Traverses up the hierarchy
2444 LLUICtrl* keyboard_focus = gFocusMgr.getKeyboardFocus(); 2482 LLUICtrl* keyboard_focus = gFocusMgr.getKeyboardFocus();
@@ -2544,6 +2582,12 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
2544 { 2582 {
2545 return TRUE; 2583 return TRUE;
2546 } 2584 }
2585
2586 // give menus a chance to handle keys
2587 if (gLoginMenuBarView && gLoginMenuBarView->handleAcceleratorKey(key, mask))
2588 {
2589 return TRUE;
2590 }
2547 2591
2548 // don't pass keys on to world when something in ui has focus 2592 // don't pass keys on to world when something in ui has focus
2549 return gFocusMgr.childHasKeyboardFocus(mRootView) 2593 return gFocusMgr.childHasKeyboardFocus(mRootView)
@@ -2831,7 +2875,7 @@ BOOL LLViewerWindow::handlePerFrameHover()
2831 // *NOTE: sometimes tools handle the mouse as a captor, so this 2875 // *NOTE: sometimes tools handle the mouse as a captor, so this
2832 // logic is a little confusing 2876 // logic is a little confusing
2833 LLTool *tool = NULL; 2877 LLTool *tool = NULL;
2834 if (gToolMgr && gHoverView) 2878 if (gToolMgr && gHoverView && gCamera)
2835 { 2879 {
2836 tool = gToolMgr->getCurrentTool(); 2880 tool = gToolMgr->getCurrentTool();
2837 2881
@@ -2904,8 +2948,8 @@ BOOL LLViewerWindow::handlePerFrameHover()
2904 mToolTip->setVisible( TRUE ); 2948 mToolTip->setVisible( TRUE );
2905 } 2949 }
2906 } 2950 }
2907 2951
2908 if (tool != gToolNull && tool != gToolInspect && tool != gToolDragAndDrop && !gSavedSettings.getBOOL("FreezeTime")) 2952 if (tool && tool != gToolNull && tool != gToolInspect && tool != gToolDragAndDrop && !gSavedSettings.getBOOL("FreezeTime"))
2909 { 2953 {
2910 LLMouseHandler *captor = gFocusMgr.getMouseCapture(); 2954 LLMouseHandler *captor = gFocusMgr.getMouseCapture();
2911 // With the null, inspect, or drag and drop tool, don't muck 2955 // With the null, inspect, or drag and drop tool, don't muck
@@ -4715,9 +4759,9 @@ void LLViewerWindow::stopGL(BOOL save_state)
4715 llinfos << "Shutting down GL..." << llendl; 4759 llinfos << "Shutting down GL..." << llendl;
4716 4760
4717 // Pause texture decode threads (will get unpaused during main loop) 4761 // Pause texture decode threads (will get unpaused during main loop)
4718 gTextureCache->pause(); 4762 LLAppViewer::getTextureCache()->pause();
4719 gImageDecodeThread->pause(); 4763 LLAppViewer::getImageDecodeThread()->pause();
4720 gTextureFetch->pause(); 4764 LLAppViewer::getTextureFetch()->pause();
4721 4765
4722 gSky.destroyGL(); 4766 gSky.destroyGL();
4723 stop_glerror(); 4767 stop_glerror();