From 988278b8c380fc72df1001bb0e5bf38c0a1a655a Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Mon, 2 Oct 2023 15:54:22 +0300 Subject: SL-20358 restore focus after opening recent emoji panel --- indra/newview/llfloaterimsessiontab.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 7a0de78ac5..a44303f72c 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -453,12 +453,19 @@ void LLFloaterIMSessionTab::onInputEditorClicked() void LLFloaterIMSessionTab::onEmojiRecentPanelToggleBtnClicked(LLFloaterIMSessionTab* self) { + bool restore_focus = (gFocusMgr.getLastKeyboardFocus() == self->mInputEditor); + BOOL show = !self->mEmojiRecentPanel->getVisible(); if (show) { - self->initEmojiRecentPanel(true); + self->initEmojiRecentPanel(!restore_focus); } self->mEmojiRecentPanel->setVisible(show); + + if (restore_focus) + { + self->mInputEditor->setFocus(true); + } } void LLFloaterIMSessionTab::onEmojiPickerToggleBtnClicked(LLFloaterIMSessionTab* self) -- cgit v1.2.3