From be94087bee418347664b6c4d84fe5933598eca0c Mon Sep 17 00:00:00 2001 From: Shyotl Date: Sat, 15 Jun 2013 20:08:05 -0500 Subject: [PATCH] Fixed a focus issue that prevented face media floater from updating on face change if said floater had current focus. --- indra/newview/llpanelmediasettingsgeneral.cpp | 2 +- indra/newview/lltool.cpp | 15 +++++++++++++++ indra/newview/lltool.h | 1 + indra/newview/lltoolpie.cpp | 9 +++++++++ indra/newview/lltoolpie.h | 1 + 5 files changed, 27 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp index d6fb6b2cc..f8ede13ba 100644 --- a/indra/newview/llpanelmediasettingsgeneral.cpp +++ b/indra/newview/llpanelmediasettingsgeneral.cpp @@ -203,7 +203,7 @@ void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable) self->mAutoPlay->clear(); self->mAutoScale->clear(); self->mAutoZoom ->clear(); - self->mCurrentURL->clear(); + self->mCurrentURL->setValue(""); self->mFirstClick->clear(); self->mHeightPixels->clear(); self->mHomeURL->clear(); diff --git a/indra/newview/lltool.cpp b/indra/newview/lltool.cpp index 6ebeb870a..0740fc38b 100644 --- a/indra/newview/lltool.cpp +++ b/indra/newview/lltool.cpp @@ -66,6 +66,21 @@ LLTool::~LLTool() } } +BOOL LLTool::handleAnyMouseClick(S32 x, S32 y, MASK mask, LLMouseHandler::EClickType clicktype, BOOL down) +{ + BOOL result = LLMouseHandler::handleAnyMouseClick(x, y, mask, clicktype, down); + + // This behavior was moved here from LLViewerWindow::handleAnyMouseClick, so it can be selectively overridden by LLTool subclasses. + if(down && result) + { + // This is necessary to force clicks in the world to cause edit + // boxes that might have keyboard focus to relinquish it, and hence + // cause a commit to update their value. JC + gFocusMgr.setKeyboardFocus(NULL); + } + + return result; +} BOOL LLTool::handleMouseDown(S32 x, S32 y, MASK mask) { diff --git a/indra/newview/lltool.h b/indra/newview/lltool.h index f954a8c24..3fec2c8e8 100644 --- a/indra/newview/lltool.h +++ b/indra/newview/lltool.h @@ -55,6 +55,7 @@ public: virtual BOOL isView() const { return FALSE; } // Virtual functions inherited from LLMouseHandler + virtual BOOL handleAnyMouseClick(S32 x, S32 y, MASK mask, LLMouseHandler::EClickType clicktype, BOOL down); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask); diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 8133066c9..e3dce440d 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -92,6 +92,15 @@ LLToolPie::LLToolPie() { } +BOOL LLToolPie::handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktype, BOOL down) +{ + BOOL result = LLMouseHandler::handleAnyMouseClick(x, y, mask, clicktype, down); + + // This override DISABLES the keyboard focus reset that LLTool::handleAnyMouseClick adds. + // LLToolPie will do the right thing in its pick callback. + + return result; +} BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) { diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h index f811c53c2..5f3c75c3b 100644 --- a/indra/newview/lltoolpie.h +++ b/indra/newview/lltoolpie.h @@ -46,6 +46,7 @@ public: LLToolPie( ); // Virtual functions inherited from LLMouseHandler + virtual BOOL handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktype, BOOL down); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);