aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lltool.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:54 -0500
committerJacek Antonelli2008-08-15 23:44:54 -0500
commitb2afb8800bb033a04bb3ecdf0363068d56648ef1 (patch)
tree3568129b5bbddb47cd39d622b4137a8fbff4abaf /linden/indra/newview/lltool.cpp
parentSecond Life viewer sources 1.14.0.1 (diff)
downloadmeta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.zip
meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.gz
meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.bz2
meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.xz
Second Life viewer sources 1.15.0.2
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/lltool.cpp23
1 files changed, 5 insertions, 18 deletions
diff --git a/linden/indra/newview/lltool.cpp b/linden/indra/newview/lltool.cpp
index 9489a2b..82d8fb9 100644
--- a/linden/indra/newview/lltool.cpp
+++ b/linden/indra/newview/lltool.cpp
@@ -4,6 +4,7 @@
4 * 4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 * 6 *
7 * Second Life Viewer Source Code
7 * The source code in this file ("Source Code") is provided by Linden Lab 8 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0 9 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement 10 * ("GPL"), unless you have obtained a separate licensing agreement
@@ -53,7 +54,7 @@ LLTool::LLTool( const LLString& name, LLToolComposite* composite ) :
53 54
54LLTool::~LLTool() 55LLTool::~LLTool()
55{ 56{
56 if( gFocusMgr.getMouseCapture() == this ) 57 if( hasMouseCapture() )
57 { 58 {
58 llwarns << "Tool deleted holding mouse capture. Mouse capture removed." << llendl; 59 llwarns << "Tool deleted holding mouse capture. Mouse capture removed." << llendl;
59 gFocusMgr.removeMouseCaptureWithoutCallback( this ); 60 gFocusMgr.removeMouseCaptureWithoutCallback( this );
@@ -132,12 +133,12 @@ void LLTool::setMouseCapture( BOOL b )
132{ 133{
133 if( b ) 134 if( b )
134 { 135 {
135 gViewerWindow->setMouseCapture(mComposite ? mComposite : this, &LLTool::onMouseCaptureLost ); 136 gViewerWindow->setMouseCapture(mComposite ? mComposite : this );
136 } 137 }
137 else 138 else
138 if( hasMouseCapture() ) 139 if( hasMouseCapture() )
139 { 140 {
140 gViewerWindow->setMouseCapture( NULL, NULL ); 141 gViewerWindow->setMouseCapture( NULL );
141 } 142 }
142} 143}
143 144
@@ -147,7 +148,7 @@ void LLTool::draw()
147 148
148BOOL LLTool::hasMouseCapture() 149BOOL LLTool::hasMouseCapture()
149{ 150{
150 return gViewerWindow->hasMouseCapture(mComposite ? mComposite : this); 151 return gFocusMgr.getMouseCapture() == (mComposite ? mComposite : this);
151} 152}
152 153
153BOOL LLTool::handleKey(KEY key, MASK mask) 154BOOL LLTool::handleKey(KEY key, MASK mask)
@@ -163,17 +164,3 @@ LLTool* LLTool::getOverrideTool(MASK mask)
163 } 164 }
164 return NULL; 165 return NULL;
165} 166}
166
167// static
168void LLTool::onMouseCaptureLost( LLMouseHandler* old_captor )
169{
170 LLTool* self = (LLTool*) old_captor;
171 if( self->mComposite )
172 {
173 self->mComposite->onMouseCaptureLost();
174 }
175 else
176 {
177 self->onMouseCaptureLost();
178 }
179}