From b48ea0148c5d48d79488076b1b3760394a8023be Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 18 Mar 2010 15:38:23 -0700 Subject: EXT-5849 - [crashhunters] Crash in LLView::drawChildren() attempted fix by removing gesture combo popup lists from floater view holder reviewed by Leyla --- indra/newview/llnearbychatbar.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'indra/newview/llnearbychatbar.cpp') diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 483756b16e..af711b6943 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -96,11 +96,7 @@ LLGestureComboList::LLGestureComboList(const LLGestureComboList::Params& p) params.commit_on_keyboard_movement(false); mList = LLUICtrlFactory::create(params); - - // *HACK: adding list as a child to FloaterViewHolder to make it fully visible without - // making it top control (because it would cause problems). - gViewerWindow->getFloaterViewHolder()->addChild(mList); - mList->setVisible(FALSE); + addChild(mList); //****************************Gesture Part********************************/ @@ -115,7 +111,7 @@ LLGestureComboList::LLGestureComboList(const LLGestureComboList::Params& p) setFocusLostCallback(boost::bind(&LLGestureComboList::hideList, this)); } -BOOL LLGestureComboList::handleKey(KEY key, MASK mask, BOOL called_from_parent) +BOOL LLGestureComboList::handleKeyHere(KEY key, MASK mask) { BOOL handled = FALSE; @@ -126,7 +122,7 @@ BOOL LLGestureComboList::handleKey(KEY key, MASK mask, BOOL called_from_parent) } else { - handled = mList->handleKey(key, mask, called_from_parent); + handled = mList->handleKeyHere(key, mask); } return handled; @@ -135,18 +131,17 @@ BOOL LLGestureComboList::handleKey(KEY key, MASK mask, BOOL called_from_parent) void LLGestureComboList::showList() { LLRect rect = mList->getRect(); - LLRect screen; - mButton->localRectToScreen(getRect(), &screen); + LLRect button_rect = mButton->getRect(); // Calculating amount of space between the navigation bar and gestures combo LLNavigationBar* nb = LLNavigationBar::getInstance(); S32 x, nb_bottom; - nb->localPointToScreen(0, 0, &x, &nb_bottom); + nb->localPointToOtherView(0, 0, &x, &nb_bottom, this); - S32 max_height = nb_bottom - screen.mTop; + S32 max_height = nb_bottom - button_rect.mTop; mList->calcColumnWidths(); - rect.setOriginAndSize(screen.mLeft, screen.mTop, llmax(mList->getMaxContentWidth(),mButton->getRect().getWidth()), max_height); + rect.setOriginAndSize(button_rect.mLeft, button_rect.mTop, llmax(mList->getMaxContentWidth(),mButton->getRect().getWidth()), max_height); mList->setRect(rect); mList->fitContents( llmax(mList->getMaxContentWidth(),mButton->getRect().getWidth()), max_height); @@ -156,6 +151,7 @@ void LLGestureComboList::showList() // Show the list and push the button down mButton->setToggleState(TRUE); mList->setVisible(TRUE); + LLUI::addPopup(mList); } void LLGestureComboList::onButtonCommit() @@ -188,6 +184,7 @@ void LLGestureComboList::hideList() mButton->setToggleState(FALSE); mList->setVisible(FALSE); mList->mouseOverHighlightNthItem(-1); + LLUI::removePopup(mList); gFocusMgr.setKeyboardFocus(NULL); } } -- cgit v1.2.3