From 18c0346ddf402dedcf6faa6a699a8e31bf21f6b5 Mon Sep 17 00:00:00 2001 From: thickbrick Date: Tue, 14 Sep 2010 01:11:19 +0200 Subject: 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. --- linden/indra/newview/lltoolmgr.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'linden/indra/newview') 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() gBasicToolset->addTool( LLToolCompInspect::getInstance() ); gFaceEditToolset->addTool( LLToolCamera::getInstance() ); + // In case window focus was lost before we got here + clearSavedTool(); // On startup, use "select" tool setCurrentToolset(gBasicToolset); @@ -188,9 +190,11 @@ LLTool* LLToolMgr::getCurrentTool() } else { - mOverrideTool = mBaseTool ? mBaseTool->getOverrideTool(override_mask) : NULL; + // due to window management weirdness we can get here with gToolNull + bool can_override = mBaseTool && (mBaseTool != gToolNull); + mOverrideTool = can_override ? mBaseTool->getOverrideTool(override_mask) : NULL; - // use override tool if available otherwise drop back to base tool + // use keyboard-override tool if available otherwise drop back to base tool cur_tool = mOverrideTool ? mOverrideTool : mBaseTool; } -- cgit v1.1