summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonroe Linden <monroe@lindenlab.com>2009-10-29 18:38:02 -0700
committerMonroe Linden <monroe@lindenlab.com>2009-10-29 18:38:02 -0700
commit8604c978ca3d7fdcff4849cc53f44352b237406c (patch)
treed75a8c37033574f45c983ada98f6a5f5a7447327
parent96e46f91270d9a01eabaac03d34d8faa5c9c685b (diff)
Fixes for DEV-41612, DEV-41693, DEV-41963.
Made LLViewerMediaFocus::update clear inworld media focus if LLViewerMediaFocus has lost keyboard focus to anything besides the media controls, or LLToolMgr::inBuildMode() returns true. Also, never fade the media controls if they have keyboard focus (this fixes the media controls fading out while the user is trying to type an URL).
-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;