diff options
author | thickbrick | 2010-09-14 01:11:19 +0200 |
---|---|---|
committer | thickbrick | 2010-09-14 01:11:19 +0200 |
commit | 18c0346ddf402dedcf6faa6a699a8e31bf21f6b5 (patch) | |
tree | 9dd5ee3d452e79ac7731233cfc39f4ef0cfd4142 /linden/indra/newview/lltoolmgr.cpp | |
parent | Merge remote branch 'elektra/weekly' into weekly (diff) | |
download | meta-impy-18c0346ddf402dedcf6faa6a699a8e31bf21f6b5.zip meta-impy-18c0346ddf402dedcf6faa6a699a8e31bf21f6b5.tar.gz meta-impy-18c0346ddf402dedcf6faa6a699a8e31bf21f6b5.tar.bz2 meta-impy-18c0346ddf402dedcf6faa6a699a8e31bf21f6b5.tar.xz |
SNOW-282: prevent the toolbox from showing up uninvited and grabbing in-world click events
after login.
Window focus changes can leave gToolNull as the active tool (it should only be active
when the window is unfocused.) This prevents doing keyboard override in that case.
Diffstat (limited to 'linden/indra/newview/lltoolmgr.cpp')
-rw-r--r-- | linden/indra/newview/lltoolmgr.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/linden/indra/newview/lltoolmgr.cpp b/linden/indra/newview/lltoolmgr.cpp index 5ba7217..3a776d1 100644 --- a/linden/indra/newview/lltoolmgr.cpp +++ b/linden/indra/newview/lltoolmgr.cpp | |||
@@ -105,6 +105,8 @@ void LLToolMgr::initTools() | |||
105 | gBasicToolset->addTool( LLToolCompInspect::getInstance() ); | 105 | gBasicToolset->addTool( LLToolCompInspect::getInstance() ); |
106 | gFaceEditToolset->addTool( LLToolCamera::getInstance() ); | 106 | gFaceEditToolset->addTool( LLToolCamera::getInstance() ); |
107 | 107 | ||
108 | // In case window focus was lost before we got here | ||
109 | clearSavedTool(); | ||
108 | // On startup, use "select" tool | 110 | // On startup, use "select" tool |
109 | setCurrentToolset(gBasicToolset); | 111 | setCurrentToolset(gBasicToolset); |
110 | 112 | ||
@@ -188,9 +190,11 @@ LLTool* LLToolMgr::getCurrentTool() | |||
188 | } | 190 | } |
189 | else | 191 | else |
190 | { | 192 | { |
191 | mOverrideTool = mBaseTool ? mBaseTool->getOverrideTool(override_mask) : NULL; | 193 | // due to window management weirdness we can get here with gToolNull |
194 | bool can_override = mBaseTool && (mBaseTool != gToolNull); | ||
195 | mOverrideTool = can_override ? mBaseTool->getOverrideTool(override_mask) : NULL; | ||
192 | 196 | ||
193 | // use override tool if available otherwise drop back to base tool | 197 | // use keyboard-override tool if available otherwise drop back to base tool |
194 | cur_tool = mOverrideTool ? mOverrideTool : mBaseTool; | 198 | cur_tool = mOverrideTool ? mOverrideTool : mBaseTool; |
195 | } | 199 | } |
196 | 200 | ||