Skip to content

Commit

Permalink
SL-19891 Make sure focusable elements clear focus on destruction
Browse files Browse the repository at this point in the history
  • Loading branch information
akleshchev committed Jul 17, 2023
1 parent 37f4139 commit bc3f2d5
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 7 deletions.
21 changes: 14 additions & 7 deletions indra/llcharacter/llkeyframemotion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,13 +497,20 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact
// request asset
mAssetStatus = ASSET_FETCHED;

LL_DEBUGS("Animation") << "Requesting data fetch for: " << mID << LL_ENDL;
character_id = new LLUUID(mCharacter->getID());
gAssetStorage->getAssetData(mID,
LLAssetType::AT_ANIMATION,
onLoadComplete,
(void *)character_id,
FALSE);
if (mID.notNull())
{
LL_DEBUGS("Animation") << "Requesting data fetch for: " << mID << LL_ENDL;
character_id = new LLUUID(mCharacter->getID());
gAssetStorage->getAssetData(mID,
LLAssetType::AT_ANIMATION,
onLoadComplete,
(void*)character_id,
FALSE);
}
else
{
LL_INFOS("Animation") << "Attempted to fetch animation " << mName << " with null id for character " << mCharacter->getID() << LL_ENDL;
}

return STATUS_HOLD;
case ASSET_FETCHED:
Expand Down
1 change: 1 addition & 0 deletions indra/llui/lldraghandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ LLDragHandle::LLDragHandle(const LLDragHandle::Params& p)

LLDragHandle::~LLDragHandle()
{
gFocusMgr.removeKeyboardFocusWithoutCallback(this);
removeChild(mTitleBox);
delete mTitleBox;
}
Expand Down
1 change: 1 addition & 0 deletions indra/llui/llfolderviewitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)
LLFolderViewItem::~LLFolderViewItem()
{
mViewModelItem = NULL;
gFocusMgr.removeKeyboardFocusWithoutCallback(this);
}

BOOL LLFolderViewItem::postBuild()
Expand Down
2 changes: 2 additions & 0 deletions indra/llui/lllayoutstack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ LLLayoutPanel::~LLLayoutPanel()
// probably not necessary, but...
delete mResizeBar;
mResizeBar = NULL;

gFocusMgr.removeKeyboardFocusWithoutCallback(this);
}

F32 LLLayoutPanel::getAutoResizeFactor() const
Expand Down
5 changes: 5 additions & 0 deletions indra/llui/llresizehandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ LLResizeHandle::LLResizeHandle(const LLResizeHandle::Params& p)
}
}

LLResizeHandle::~LLResizeHandle()
{
gFocusMgr.removeKeyboardFocusWithoutCallback(this);
}


BOOL LLResizeHandle::handleMouseDown(S32 x, S32 y, MASK mask)
{
Expand Down
1 change: 1 addition & 0 deletions indra/llui/llresizehandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class LLResizeHandle : public LLView
Params();
};

~LLResizeHandle();
protected:
LLResizeHandle(const LLResizeHandle::Params&);
friend class LLUICtrlFactory;
Expand Down
1 change: 1 addition & 0 deletions indra/newview/llviewermediafocus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ LLViewerMediaFocus::~LLViewerMediaFocus()
{
// The destructor for LLSingletons happens at atexit() time, which is too late to do much.
// Clean up in cleanupClass() instead.
gFocusMgr.removeKeyboardFocusWithoutCallback(this);
}

void LLViewerMediaFocus::setFocusFace(LLPointer<LLViewerObject> objectp, S32 face, viewer_media_t media_impl, LLVector3 pick_normal)
Expand Down

0 comments on commit bc3f2d5

Please sign in to comment.