Ignore "BackgroundYieldTime" setting if file picker window is open (Improves responsiveness of said window)

This commit is contained in:
Shyotl
2016-04-26 13:42:47 -05:00
parent 55b5f60b68
commit 62ee456084
3 changed files with 9 additions and 1 deletions

View File

@@ -1332,7 +1332,7 @@ bool LLAppViewer::mainLoop()
// yield cooperatively when not running as foreground window // yield cooperatively when not running as foreground window
if ( gNoRender if ( gNoRender
|| (gViewerWindow && !gViewerWindow->getWindow()->getVisible()) || (gViewerWindow && !gViewerWindow->getWindow()->getVisible())
|| !gFocusMgr.getAppHasFocus()) || (!gFocusMgr.getAppHasFocus() && !AIFilePicker::activePicker) )
{ {
// Sleep if we're not rendering, or the window is minimized. // Sleep if we're not rendering, or the window is minimized.
S32 milliseconds_to_sleep = llclamp(gSavedSettings.getS32("BackgroundYieldTime"), 0, 1000); S32 milliseconds_to_sleep = llclamp(gSavedSettings.getS32("BackgroundYieldTime"), 0, 1000);

View File

@@ -47,6 +47,8 @@
#include "llwindowsdl.h" #include "llwindowsdl.h"
#endif #endif
AIFilePicker* AIFilePicker::activePicker = NULL;
char const* AIFilePicker::state_str_impl(state_type run_state) const char const* AIFilePicker::state_str_impl(state_type run_state) const
{ {
switch(run_state) switch(run_state)
@@ -341,6 +343,7 @@ void AIFilePicker::open(std::string const& filename, ESaveFilter filter, std::st
void AIFilePicker::initialize_impl(void) void AIFilePicker::initialize_impl(void)
{ {
activePicker = this;
mCanceled = false; mCanceled = false;
if (mFilter.empty()) if (mFilter.empty())
{ {
@@ -452,6 +455,10 @@ void AIFilePicker::multiplex_impl(state_type run_state)
void AIFilePicker::finish_impl(void) void AIFilePicker::finish_impl(void)
{ {
if (activePicker == this)
{
activePicker = NULL;
}
if (mPluginManager) if (mPluginManager)
{ {
mPluginManager->destroyPlugin(); mPluginManager->destroyPlugin();

View File

@@ -203,6 +203,7 @@ private:
public: public:
enum open_type { save, load, load_multiple }; enum open_type { save, load, load_multiple };
static AIFilePicker* activePicker;
private: private:
LLPointer<LLViewerPluginManager> mPluginManager; //!< Pointer to the plugin manager. LLPointer<LLViewerPluginManager> mPluginManager; //!< Pointer to the plugin manager.