diff options
Diffstat (limited to 'indra/newview/lltool.cpp')
-rw-r--r-- | indra/newview/lltool.cpp | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/indra/newview/lltool.cpp b/indra/newview/lltool.cpp index 1053e4a569..b31a70e917 100644 --- a/indra/newview/lltool.cpp +++ b/indra/newview/lltool.cpp @@ -34,7 +34,7 @@ LLTool::LLTool( const LLString& name, LLToolComposite* composite ) : LLTool::~LLTool() { - if( gFocusMgr.getMouseCapture() == this ) + if( hasMouseCapture() ) { llwarns << "Tool deleted holding mouse capture. Mouse capture removed." << llendl; gFocusMgr.removeMouseCaptureWithoutCallback( this ); @@ -113,12 +113,12 @@ void LLTool::setMouseCapture( BOOL b ) { if( b ) { - gViewerWindow->setMouseCapture(mComposite ? mComposite : this, &LLTool::onMouseCaptureLost ); + gViewerWindow->setMouseCapture(mComposite ? mComposite : this ); } else if( hasMouseCapture() ) { - gViewerWindow->setMouseCapture( NULL, NULL ); + gViewerWindow->setMouseCapture( NULL ); } } @@ -128,7 +128,7 @@ void LLTool::draw() BOOL LLTool::hasMouseCapture() { - return gViewerWindow->hasMouseCapture(mComposite ? mComposite : this); + return gFocusMgr.getMouseCapture() == (mComposite ? mComposite : this); } BOOL LLTool::handleKey(KEY key, MASK mask) @@ -144,17 +144,3 @@ LLTool* LLTool::getOverrideTool(MASK mask) } return NULL; } - -// static -void LLTool::onMouseCaptureLost( LLMouseHandler* old_captor ) -{ - LLTool* self = (LLTool*) old_captor; - if( self->mComposite ) - { - self->mComposite->onMouseCaptureLost(); - } - else - { - self->onMouseCaptureLost(); - } -} |