summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llpanelprimmediacontrols.cpp4
-rw-r--r--indra/newview/llviewermediafocus.cpp27
2 files changed, 28 insertions, 3 deletions
diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp
index 103faf5a03..e4b32c4820 100644
--- a/indra/newview/llpanelprimmediacontrols.cpp
+++ b/indra/newview/llpanelprimmediacontrols.cpp
@@ -595,9 +595,9 @@ void LLPanelPrimMediaControls::updateShape()
mLastCursorPos = cursor_pos_window;
}
- if(isMouseOver())
+ if(isMouseOver() || hasFocus())
{
- // Never fade the controls if the mouse is over them.
+ // Never fade the controls if the mouse is over them or they have keyboard focus.
mFadeTimer.stop();
}
else if(!mClearFaceOnFade && (mInactivityTimer.getElapsedTimeF32() < mInactiveTimeout))
diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp
index c32b3523b3..0b48461d54 100644
--- a/indra/newview/llviewermediafocus.cpp
+++ b/indra/newview/llviewermediafocus.cpp
@@ -49,6 +49,7 @@
#include "llweb.h"
#include "llmediaentry.h"
#include "llkeyboard.h"
+#include "lltoolmgr.h"
//
// LLViewerMediaFocus
@@ -116,7 +117,7 @@ void LLViewerMediaFocus::setFocusFace(LLPointer<LLViewerObject> objectp, S32 fac
}
else
{
- if(mFocusedImplID != LLUUID::null)
+ if(mFocusedImplID.notNull())
{
if(mMediaControls.get())
{
@@ -310,6 +311,30 @@ BOOL LLViewerMediaFocus::handleScrollWheel(S32 x, S32 y, S32 clicks)
void LLViewerMediaFocus::update()
{
+ if(mFocusedImplID.notNull() || mFocusedObjectID.notNull())
+ {
+ // We have a focused impl/face.
+ if(!getFocus())
+ {
+ // We've lost keyboard focus -- check to see whether the media controls have it
+ if(mMediaControls.get() && mMediaControls.get()->hasFocus())
+ {
+ // the media controls have focus -- don't clear.
+ }
+ else
+ {
+ // Someone else has focus -- back off.
+ clearFocus();
+ }
+ }
+ else if(LLToolMgr::getInstance()->inBuildMode())
+ {
+ // Build tools are selected -- clear focus.
+ clearFocus();
+ }
+ }
+
+
LLViewerMediaImpl *media_impl = getFocusedMediaImpl();
LLViewerObject *viewer_object = getFocusedObject();
S32 face = mFocusedObjectFace;