From 62ee4560848909e703ea9405a6e388f49de98c76 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Tue, 26 Apr 2016 13:42:47 -0500 Subject: [PATCH] Ignore "BackgroundYieldTime" setting if file picker window is open (Improves responsiveness of said window) --- indra/newview/llappviewer.cpp | 2 +- indra/newview/statemachine/aifilepicker.cpp | 7 +++++++ indra/newview/statemachine/aifilepicker.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 214a7f424..d3338c14d 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1332,7 +1332,7 @@ bool LLAppViewer::mainLoop() // yield cooperatively when not running as foreground window if ( gNoRender || (gViewerWindow && !gViewerWindow->getWindow()->getVisible()) - || !gFocusMgr.getAppHasFocus()) + || (!gFocusMgr.getAppHasFocus() && !AIFilePicker::activePicker) ) { // Sleep if we're not rendering, or the window is minimized. S32 milliseconds_to_sleep = llclamp(gSavedSettings.getS32("BackgroundYieldTime"), 0, 1000); diff --git a/indra/newview/statemachine/aifilepicker.cpp b/indra/newview/statemachine/aifilepicker.cpp index 4a392a13f..0eff19599 100644 --- a/indra/newview/statemachine/aifilepicker.cpp +++ b/indra/newview/statemachine/aifilepicker.cpp @@ -47,6 +47,8 @@ #include "llwindowsdl.h" #endif +AIFilePicker* AIFilePicker::activePicker = NULL; + char const* AIFilePicker::state_str_impl(state_type run_state) const { switch(run_state) @@ -341,6 +343,7 @@ void AIFilePicker::open(std::string const& filename, ESaveFilter filter, std::st void AIFilePicker::initialize_impl(void) { + activePicker = this; mCanceled = false; if (mFilter.empty()) { @@ -452,6 +455,10 @@ void AIFilePicker::multiplex_impl(state_type run_state) void AIFilePicker::finish_impl(void) { + if (activePicker == this) + { + activePicker = NULL; + } if (mPluginManager) { mPluginManager->destroyPlugin(); diff --git a/indra/newview/statemachine/aifilepicker.h b/indra/newview/statemachine/aifilepicker.h index 08e218f71..402b26c25 100644 --- a/indra/newview/statemachine/aifilepicker.h +++ b/indra/newview/statemachine/aifilepicker.h @@ -203,6 +203,7 @@ private: public: enum open_type { save, load, load_multiple }; + static AIFilePicker* activePicker; private: LLPointer mPluginManager; //!< Pointer to the plugin manager.