Anonymous avatar Anonymous committed bd5e9b1

SOCIAL-749 FIX Clicking on world to dismiss context menus causes your avatar to walk to click

Comments (0)

Files changed (3)

indra/newview/lltoolpie.cpp

 	mMouseOutsideSlop( false ),
 	mMouseSteerX(-1),
 	mMouseSteerY(-1),
-	mAbortClickToWalk(false),
+	mBlockClickToWalk(false),
 	mClickAction(0),
 	mClickActionBuyEnabled( gSavedSettings.getBOOL("ClickActionBuyEnabled") ),
 	mClickActionPayEnabled( gSavedSettings.getBOOL("ClickActionPayEnabled") )
 	if (gFocusMgr.getKeyboardFocus())
 	{
 		// don't click to walk on attempt to give focus to world
-		mAbortClickToWalk = true;
+		mBlockClickToWalk = true;
 		gFocusMgr.setKeyboardFocus(NULL);
 	}
 
 	// let media have first pass at click
 	if (handleMediaMouseUp() || LLViewerMediaFocus::getInstance()->getFocus())
 	{
-		mAbortClickToWalk = true;
+		mBlockClickToWalk = true;
 	}
 	stopCameraSteering();
 	mMouseButtonDown = false;
 	if (click_action == CLICK_ACTION_NONE				// not doing 1-click action
 		&& gSavedSettings.getBOOL("ClickToWalk")		// click to walk enabled
 		&& !gAgent.getFlying()							// don't auto-navigate while flying until that works
-		&& !mAbortClickToWalk							// another behavior hasn't cancelled click to walk
+		&& !mBlockClickToWalk							// another behavior hasn't cancelled click to walk
 		&& !mPick.mPosGlobal.isExactlyZero()			// valid coordinates for pick
 		&& (mPick.mPickType == LLPickInfo::PICK_LAND	// we clicked on land
 			|| mPick.mObjectID.notNull()))				// or on an object
 		mAutoPilotDestination->setDuration(3.f);
 
 		handle_go_to();
-		mAbortClickToWalk = false;
+		mBlockClickToWalk = false;
 
 		return TRUE;
 	}
 	LLToolMgr::getInstance()->clearTransientTool();
 	gAgentCamera.setLookAt(LOOKAT_TARGET_CONVERSATION, obj); // maybe look at object/person clicked on
 
-	mAbortClickToWalk = false;
+	mBlockClickToWalk = false;
 	return LLTool::handleMouseUp(x, y, mask);
 }
 
 
 void LLToolPie::handleSelect()
 {
-	mAbortClickToWalk = true;	
+	// tool is reselected when app gets focus, etc.
+	mBlockClickToWalk = true;	
 }
 
 void LLToolPie::handleDeselect()
 void LLToolPie::startCameraSteering()
 {
 	mMouseOutsideSlop = true;
-	mAbortClickToWalk = true;
+	mBlockClickToWalk = true;
 
 	if (gAgentCamera.getFocusOnAvatar())
 	{

indra/newview/lltoolpie.h

 	LLViewerObject*		getClickActionObject() { return mClickActionObject; }
 	LLObjectSelection*	getLeftClickSelection() { return (LLObjectSelection*)mLeftClickSelection; }
 	void 				resetSelection();
+	void				blockClickToWalk() { mBlockClickToWalk = true; }
 	
 	static void			selectionPropertiesReceived();
 
 	LLPointer<LLHUDEffectBlob>	mAutoPilotDestination;
 	LLPointer<LLHUDEffectBlob>	mMouseSteerGrabPoint;
 	bool				mClockwise;			
-	bool				mAbortClickToWalk;
+	bool				mBlockClickToWalk;
 	LLUUID				mMediaMouseCaptureID;
 	LLPickInfo			mPick;
 	LLPickInfo			mHoverPick;

indra/newview/llviewermenu.cpp

 
 BOOL LLViewerMenuHolderGL::hideMenus()
 {
-	BOOL handled = LLMenuHolderGL::hideMenus();
+	BOOL handled = FALSE;
+	
+	if (LLMenuHolderGL::hideMenus())
+	{
+		LLToolPie::instance().blockClickToWalk();
+		handled = TRUE;
+	}
 
 	// drop pie menu selection
 	mParcelSelection = NULL;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.