summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2010-01-11 16:02:57 -0800
committerLeyla Farazha <leyla@lindenlab.com>2010-01-11 16:02:57 -0800
commit8440d99e4498882dfc61459a91eba746ad717000 (patch)
tree8e40873c4ba47babc1ce3896e807a71cb1d9b34b /indra
parentc1f4dc33c3c1a173cab1083af3f0a60767d09933 (diff)
EXT-4077 Clicking motd link opens two web browser windows
Fixed click handling weirdness. On mouse up, mTopCtrl was being passed the mouse click, and then again the mRootView regardless of whether the first handled it. Also if mRootView didn't handle a mouse up, it was traversed again to handle the mouse up. reviewed by Richard
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llviewerwindow.cpp34
1 files changed, 7 insertions, 27 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 83cbc8a1f9..ddaf4a221c 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -604,7 +604,6 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK
{
const char* buttonname = "";
const char* buttonstatestr = "";
- BOOL handled = FALSE;
S32 x = pos.mX;
S32 y = pos.mY;
x = llround((F32)x / mDisplayScale.mV[VX]);
@@ -699,7 +698,10 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK
}
else
{
- handled = top_ctrl->pointInView(local_x, local_y) && top_ctrl->handleMouseUp(local_x, local_y, mask);
+ if (top_ctrl->pointInView(local_x, local_y) && top_ctrl->handleMouseUp(local_x, local_y, mask))
+ {
+ return TRUE;
+ }
}
}
@@ -717,34 +719,12 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK
llinfos << buttonname << " Mouse " << buttonstatestr << " not handled by view" << llendl;
}
- if (down)
+ // Do not allow tool manager to handle mouseclicks if we have disconnected
+ if(!gDisconnected && LLToolMgr::getInstance()->getCurrentTool()->handleAnyMouseClick( x, y, mask, clicktype, down ) )
{
- if (gDisconnected)
- {
- return FALSE;
- }
-
- if(LLToolMgr::getInstance()->getCurrentTool()->handleAnyMouseClick( x, y, mask, clicktype, down ) )
- {
- return TRUE;
- }
+ return TRUE;
}
- else
- {
- if( !handled )
- {
- handled = mRootView->handleAnyMouseClick(x, y, mask, clicktype, down);
- }
- if( !handled )
- {
- LLTool *tool = LLToolMgr::getInstance()->getCurrentTool();
- if (tool)
- {
- handled = tool->handleAnyMouseClick(x, y, mask, clicktype, down);
- }
- }
- }
// If we got this far on a down-click, it wasn't handled.
// Up-clicks, though, are always handled as far as the OS is concerned.