summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowsdl.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2008-04-03 19:21:14 +0000
committerSteven Bennetts <steve@lindenlab.com>2008-04-03 19:21:14 +0000
commitb5936a4b1d8780b5b8cd425998eacd2c64ffa693 (patch)
treec1581bcf34e96a897c6e1d9a4aed95f353713baa /indra/llwindow/llwindowsdl.cpp
parent55c25229b79b1755c989e5996c8e8d118f369721 (diff)
1.19.1 Viewer merge: QAR_367, QAR-374, QAR-408, QAR-426
QAR_367 (RC1) - merge Branch_1-19-1-Viewer -r 81609 : 81993 -> release QAR-374 (RC2) - merge Branch_1-19-1-Viewer -r 81993 : 82589 -> release QAR-408 (RC3) - merge Branch_1-19-1-Viewer -r 82589 : 83128 -> release QAR-426 (rc4) - merge Branch_1-19-1-Viewer -r 83125 : 83719 -> release (Actual merge: release@83793 Branch_1-19-1-Viewer-merge@83953 -> release)
Diffstat (limited to 'indra/llwindow/llwindowsdl.cpp')
-rw-r--r--indra/llwindow/llwindowsdl.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index 5597ff4334..519e0e8ec8 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -48,6 +48,7 @@
extern "C" {
# include "gtk/gtk.h"
}
+#include <locale.h>
#endif // LL_GTK
#if LL_LINUX || LL_SOLARIS
@@ -137,11 +138,11 @@ BOOL ll_try_gtk_init(void)
<< gtk_major_version << "."
<< gtk_minor_version << "."
<< gtk_micro_version << llendl;
- gchar *gtk_warning;
maybe_lock_display();
- gtk_warning = gtk_check_version(GTK_MAJOR_VERSION,
- GTK_MINOR_VERSION,
- GTK_MICRO_VERSION);
+ const gchar* gtk_warning = gtk_check_version(
+ GTK_MAJOR_VERSION,
+ GTK_MINOR_VERSION,
+ GTK_MICRO_VERSION);
maybe_unlock_display();
if (gtk_warning)
{
@@ -2028,12 +2029,16 @@ void LLWindowSDL::gatherInput()
// and crashness. (SL-35450)
std::string saved_locale = setlocale(LC_ALL, NULL);
- // Do a limited number of pumps so SL doesn't starve!
- // *TODO: this should ideally be time-limited, not count-limited.
- gtk_main_iteration_do(0); // Always do one non-blocking pump
- for (int iter=0; iter<10; ++iter)
- if (gtk_events_pending())
- gtk_main_iteration();
+ // Pump until we've nothing left to do or passed 1/15th of a
+ // second pumping for this frame.
+ static LLTimer pump_timer;
+ pump_timer.reset();
+ pump_timer.setTimerExpirySec(1.0f / 15.0f);
+ do {
+ // Always do at least one non-blocking pump
+ gtk_main_iteration_do(0);
+ } while (gtk_events_pending() &&
+ !pump_timer.hasExpired());
setlocale(LC_ALL, saved_locale.c_str() );
}