From 158a4348993c0c9095db299a8c2db494ba52b000 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 16 Apr 2013 05:45:27 +0200 Subject: [PATCH] Set focus in all necessary ways, not just the keyboard alone, when tabs are changed by alt-arrows --- indra/newview/llfloaterchat.cpp | 13 +++++++++++-- indra/newview/llimpanel.cpp | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index c841278d3..01ed3f0c1 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -188,9 +188,14 @@ void LLFloaterChat::handleVisibilityChange(BOOL new_visibility) void LLFloaterChat::onFocusReceived() { LLView* chat_editor = getChildView("Chat Editor"); - if (childIsVisible("Chat Editor")) + if (getVisible() && childIsVisible("Chat Editor")) + { gFocusMgr.setKeyboardFocus(chat_editor); + LLUICtrl * ctrl = static_cast(chat_editor); + ctrl->setFocus(TRUE); + } + LLFloater::onFocusReceived(); } @@ -747,9 +752,13 @@ void LLFloaterChat::hide(LLFloater* instance, const LLSD& key) BOOL LLFloaterChat::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash ) { LLView* chat_editor = getChildView("Chat Editor"); - if (childIsVisible("Chat Editor")) + if (getVisible() && childIsVisible("Chat Editor")) { gFocusMgr.setKeyboardFocus(chat_editor); + + LLUICtrl * ctrl = static_cast(chat_editor); + ctrl->setFocus(TRUE); + return TRUE; } diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 1ec2be0df..7c9cd398a 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -2609,9 +2609,13 @@ const bool LLFloaterIMPanel::isModerator(const LLUUID& speaker_id) BOOL LLFloaterIMPanel::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash ) { LLView* chat_editor = getChildView("chat_editor"); - if (childIsVisible("chat_editor")) + if (getVisible() && childIsVisible("chat_editor")) { gFocusMgr.setKeyboardFocus(chat_editor); + + LLUICtrl * ctrl = static_cast(chat_editor); + ctrl->setFocus(TRUE); + return TRUE; } @@ -2621,8 +2625,13 @@ BOOL LLFloaterIMPanel::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash void LLFloaterIMPanel::onFocusReceived() { LLView* chat_editor = getChildView("chat_editor"); - if (childIsVisible("chat_editor")) + if (getVisible() && childIsVisible("chat_editor")) + { gFocusMgr.setKeyboardFocus(chat_editor); + LLUICtrl * ctrl = static_cast(chat_editor); + ctrl->setFocus(TRUE); + } + LLFloater::onFocusReceived(); }