Commits

paulgproductengine  committed d282923

EXP-1822 FIXED (After deleting an item from inventory and confirming "ok" to delete, focus leaves inventory)

- Return focus to the previously focused root view

  • Participants
  • Parent commits 21e539d

Comments (0)

Files changed (1)

File indra/newview/lltoastalertpanel.cpp

 	// save currently focused view, so that return focus to it
 	// on destroying this toast.
 	LLView* current_selection = dynamic_cast<LLView*>(gFocusMgr.getKeyboardFocus());
-	if (current_selection)
+	while(current_selection)
 	{
-		mPreviouslyFocusedView = current_selection->getHandle();
+		if (current_selection->isFocusRoot())
+		{
+			mPreviouslyFocusedView = current_selection->getHandle();
+			break;
+		}
+		current_selection = current_selection->getParent();
 	}
 
 	const LLFontGL* font = LLFontGL::getFontSansSerif();
 	// return focus to the previously focused view
 	if (mPreviouslyFocusedView.get())
 	{
-		gFocusMgr.setKeyboardFocus(mPreviouslyFocusedView.get());
+		mPreviouslyFocusedView.get()->setFocus(TRUE);
 	}
 }