summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2007-05-01 21:39:25 +0000
committerDon Kjer <don@lindenlab.com>2007-05-01 21:39:25 +0000
commit4ecb9cb63e4993b3b4bc65d73ed255139b5c3f75 (patch)
tree48d9bb9a1ae468ecdbd53cf21a598d66ee8eced3 /indra/newview/llviewerwindow.cpp
parentf5e9ce7e47694e349a4eb28b052016b11e1bdf81 (diff)
svn merge -r 59163:61099 svn+ssh://svn/svn/linden/branches/release-candidate into release
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r--indra/newview/llviewerwindow.cpp81
1 files changed, 60 insertions, 21 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index f11f9fb1be..1b3c0193f4 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -610,22 +610,19 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask
// Topmost view gets a chance before the hierarchy
LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl();
+ BOOL mouse_over_top_ctrl = FALSE;
if (top_ctrl)
{
S32 local_x, local_y;
top_ctrl->screenPointToLocal( x, y, &local_x, &local_y );
if (top_ctrl->pointInView(local_x, local_y))
{
+ mouse_over_top_ctrl = TRUE;
if(top_ctrl->handleMouseDown(local_x, local_y, mask))
{
return TRUE;
}
}
- else if (top_ctrl->hasFocus())
- {
- // always defocus top view if we click off of it
- top_ctrl->setFocus(FALSE);
- }
}
// Give the UI views a chance to process the click
@@ -636,6 +633,11 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask
llinfos << "Left Mouse Down" << LLView::sMouseHandlerMessage << llendl;
LLView::sMouseHandlerMessage = "";
}
+ if (top_ctrl && top_ctrl->hasFocus() && !mouse_over_top_ctrl)
+ {
+ // always defocus top view if we click off of it
+ top_ctrl->setFocus(FALSE);
+ }
return TRUE;
}
else if (LLView::sDebugMouseHandling)
@@ -643,6 +645,12 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask
llinfos << "Left Mouse Down not handled by view" << llendl;
}
+ if (top_ctrl && top_ctrl->hasFocus() && !mouse_over_top_ctrl)
+ {
+ // always defocus top view if we click off of it
+ top_ctrl->setFocus(FALSE);
+ }
+
if (gDisconnected)
{
return FALSE;
@@ -699,24 +707,19 @@ BOOL LLViewerWindow::handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK ma
// Check for hit on UI.
LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl();
+ BOOL mouse_over_top_ctrl = FALSE;
if (top_ctrl)
{
S32 local_x, local_y;
top_ctrl->screenPointToLocal( x, y, &local_x, &local_y );
if (top_ctrl->pointInView(local_x, local_y))
{
+ mouse_over_top_ctrl = TRUE;
if(top_ctrl->handleDoubleClick(local_x, local_y, mask))
{
return TRUE;
}
}
- else
- {
- if (top_ctrl->hasFocus())
- {
- top_ctrl->setFocus(FALSE);
- }
- }
}
if (mRootView->handleDoubleClick(x, y, mask))
@@ -726,6 +729,11 @@ BOOL LLViewerWindow::handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK ma
llinfos << "Left Mouse Down" << LLView::sMouseHandlerMessage << llendl;
LLView::sMouseHandlerMessage = "";
}
+ if (top_ctrl && top_ctrl->hasFocus() && !mouse_over_top_ctrl)
+ {
+ // always defocus top view if we click off of it
+ top_ctrl->setFocus(FALSE);
+ }
return TRUE;
}
else if (LLView::sDebugMouseHandling)
@@ -733,7 +741,13 @@ BOOL LLViewerWindow::handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK ma
llinfos << "Left Mouse Down not handled by view" << llendl;
}
- // Why is this here? JC 9/3/2002
+ if (top_ctrl && top_ctrl->hasFocus() && !mouse_over_top_ctrl)
+ {
+ // always defocus top view if we click off of it
+ top_ctrl->setFocus(FALSE);
+ }
+
+ // Why is this here? JC 9/3/2002
if (gNoRender)
{
return TRUE;
@@ -903,24 +917,19 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK
}
LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl();
+ BOOL mouse_over_top_ctrl = FALSE;
if (top_ctrl)
{
S32 local_x, local_y;
top_ctrl->screenPointToLocal( x, y, &local_x, &local_y );
if (top_ctrl->pointInView(local_x, local_y))
{
+ mouse_over_top_ctrl = TRUE;
if(top_ctrl->handleRightMouseDown(local_x, local_y, mask))
{
return TRUE;
}
}
- else
- {
- if (top_ctrl->hasFocus())
- {
- top_ctrl->setFocus(FALSE);
- }
- }
}
if( mRootView->handleRightMouseDown(x, y, mask) )
@@ -930,6 +939,11 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK
llinfos << "Right Mouse Down" << LLView::sMouseHandlerMessage << llendl;
LLView::sMouseHandlerMessage = "";
}
+ if (top_ctrl && top_ctrl->hasFocus() && !mouse_over_top_ctrl)
+ {
+ // always defocus top view if we click off of it
+ top_ctrl->setFocus(FALSE);
+ }
return TRUE;
}
else if (LLView::sDebugMouseHandling)
@@ -937,6 +951,12 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK
llinfos << "Right Mouse Down not handled by view" << llendl;
}
+ if (top_ctrl && top_ctrl->hasFocus() && !mouse_over_top_ctrl)
+ {
+ // always defocus top view if we click off of it
+ top_ctrl->setFocus(FALSE);
+ }
+
if (gToolMgr)
{
if(gToolMgr->getCurrentTool()->handleRightMouseDown( x, y, mask ) )
@@ -1464,8 +1484,27 @@ LLViewerWindow::LLViewerWindow(
// stuff like AGP if we think that it'll crash the viewer.
//
gFeatureManagerp->initGraphicsFeatureMasks();
+
+ // The ATI Mobility Radeon with 1.15.0 causes crashes in FMOD on startup for
+ // unknown reasons, but only if you have an old settings.ini file.
+ // In this case, force the graphics settings back to recommended, but only
+ // do it once. JC
+ std::string gpu_string = gFeatureManagerp->getGPUString();
+ LLString::toLower(gpu_string);
+ bool upgrade_to_1_15 = (gSavedSettings.getString("LastRunVersion") != "1.15.0");
+ bool mobility_radeon = (gpu_string.find("mobility radeon") != std::string::npos);
+ bool mobility_radeon_upgrade_hack = upgrade_to_1_15 && mobility_radeon;
+ if (mobility_radeon_upgrade_hack)
+ {
+ llinfos << "1.15.0 update on Mobility Radeon" << llendl;
+ llinfos << "Forcing recommended graphics settings" << llendl;
+ llinfos << "Forcing audio off" << llendl;
+ gUseAudio = FALSE;
+ }
+
if (gFeatureManagerp->isSafe()
- || (gSavedSettings.getS32("LastFeatureVersion") != gFeatureManagerp->getVersion()))
+ || (gSavedSettings.getS32("LastFeatureVersion") != gFeatureManagerp->getVersion())
+ || mobility_radeon_upgrade_hack)
{
gFeatureManagerp->applyRecommendedFeatures();
}