diff options
| author | Rick Pasetto <rick@lindenlab.com> | 2009-12-02 12:17:45 -0800 |
|---|---|---|
| committer | Rick Pasetto <rick@lindenlab.com> | 2009-12-02 12:17:45 -0800 |
| commit | b5fa4a6d0d6fe6c28673e547297dd160ab56bb06 (patch) | |
| tree | db85e53222e487d4cbdb77a58d03f2d61a74d425 /indra/newview/llviewermedia.cpp | |
| parent | 6d3ca60f310e50b217a189086b652dca2e3e3854 (diff) | |
| parent | 4c3d08b665800608b4597ec28cf84cfde5e65f88 (diff) | |
Automated merge with ssh://rick@hg.lindenlab.com/skolb/media
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
| -rw-r--r-- | indra/newview/llviewermedia.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index d5fd23ac51..095430dcfc 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -45,6 +45,9 @@ #include "llviewertexturelist.h" #include "llvovolume.h" #include "llpluginclassmedia.h" +#include "llviewerwindow.h" +#include "llfocusmgr.h" +#include "llcallbacklist.h" #include "llevent.h" // LLSimpleListener #include "llnotificationsutil.h" @@ -625,7 +628,7 @@ static bool proximity_comparitor(const LLViewerMediaImpl* i1, const LLViewerMedi ////////////////////////////////////////////////////////////////////////////////////////// // static -void LLViewerMedia::updateMedia() +void LLViewerMedia::updateMedia(void *dummy_arg) { impl_list::iterator iter = sViewerMediaImplList.begin(); impl_list::iterator end = sViewerMediaImplList.end(); @@ -747,6 +750,19 @@ void LLViewerMedia::updateMedia() impl_count_total++; } + // Overrides if the window is minimized or we lost focus (taking care + // not to accidentally "raise" the priority either) + if (!gViewerWindow->getActive() /* viewer window minimized? */ + && new_priority > LLPluginClassMedia::PRIORITY_HIDDEN) + { + new_priority = LLPluginClassMedia::PRIORITY_HIDDEN; + } + else if (!gFocusMgr.getAppHasFocus() /* viewer window lost focus? */ + && new_priority > LLPluginClassMedia::PRIORITY_LOW) + { + new_priority = LLPluginClassMedia::PRIORITY_LOW; + } + pimpl->setPriority(new_priority); if(pimpl->getUsedInUI()) @@ -785,9 +801,16 @@ void LLViewerMedia::updateMedia() ////////////////////////////////////////////////////////////////////////////////////////// // static +void LLViewerMedia::initClass() +{ + gIdleCallbacks.addFunction(LLViewerMedia::updateMedia, NULL); +} + +////////////////////////////////////////////////////////////////////////////////////////// +// static void LLViewerMedia::cleanupClass() { - // This is no longer necessary, since sViewerMediaImplList is no longer smart pointers. + gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, NULL); } ////////////////////////////////////////////////////////////////////////////////////////// |
