summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/media_plugins/webkit/CMakeLists.txt10
-rw-r--r--indra/media_plugins/webkit/linux_volume_catcher.cpp5
-rw-r--r--indra/media_plugins/webkit/media_plugin_webkit.cpp24
-rw-r--r--indra/newview/llstartup.h2
4 files changed, 35 insertions, 6 deletions
diff --git a/indra/media_plugins/webkit/CMakeLists.txt b/indra/media_plugins/webkit/CMakeLists.txt
index 1a559ed39c..d576638dd7 100644
--- a/indra/media_plugins/webkit/CMakeLists.txt
+++ b/indra/media_plugins/webkit/CMakeLists.txt
@@ -50,8 +50,10 @@ set(media_plugin_webkit_LINK_LIBRARIES
)
# Select which VolumeCatcher implementation to use
-if (LINUX AND PULSEAUDIO)
- list(APPEND media_plugin_webkit_SOURCE_FILES linux_volume_catcher.cpp)
+if (LINUX)
+ if (PULSEAUDIO)
+ list(APPEND media_plugin_webkit_SOURCE_FILES linux_volume_catcher.cpp)
+ endif (PULSEAUDIO)
list(APPEND media_plugin_webkit_LINK_LIBRARIES
${UI_LIBRARIES} # for glib/GTK
)
@@ -65,10 +67,10 @@ elseif (DARWIN)
)
elseif (WINDOWS)
list(APPEND media_plugin_webkit_SOURCE_FILES windows_volume_catcher.cpp)
-else (LINUX AND PULSEAUDIO)
+else (LINUX)
# All other platforms use the dummy volume catcher for now.
list(APPEND media_plugin_webkit_SOURCE_FILES dummy_volume_catcher.cpp)
-endif (LINUX AND PULSEAUDIO)
+endif (LINUX)
set_source_files_properties(${media_plugin_webkit_HEADER_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE)
diff --git a/indra/media_plugins/webkit/linux_volume_catcher.cpp b/indra/media_plugins/webkit/linux_volume_catcher.cpp
index 2e7fda865e..5eaef0e1c3 100644
--- a/indra/media_plugins/webkit/linux_volume_catcher.cpp
+++ b/indra/media_plugins/webkit/linux_volume_catcher.cpp
@@ -47,6 +47,7 @@
extern "C" {
#include <glib.h>
+#include <glib-object.h>
#include <pulse/introspect.h>
#include <pulse/context.h>
@@ -220,6 +221,10 @@ void VolumeCatcherImpl::init()
mGotSyms = loadsyms("libpulse-mainloop-glib.so.0");
if (!mGotSyms) return;
+ // better make double-sure glib itself is initialized properly.
+ if (!g_thread_supported ()) g_thread_init (NULL);
+ g_type_init();
+
mMainloop = llpa_glib_mainloop_new(g_main_context_default());
if (mMainloop)
{
diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp
index 6990354486..3b00edec4e 100644
--- a/indra/media_plugins/webkit/media_plugin_webkit.cpp
+++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp
@@ -46,6 +46,10 @@
// set to 1 if you're using the version of llqtwebkit that's QPixmap-ified
#if LL_LINUX
# define LL_QTWEBKIT_USES_PIXMAPS 0
+extern "C" {
+# include <glib.h>
+# include <glib-object.h>
+}
#else
# define LL_QTWEBKIT_USES_PIXMAPS 0
#endif // LL_LINUX
@@ -60,7 +64,7 @@
#endif
#if LL_WINDOWS
- // *NOTE:Mani - This captures the module handle fo rthe dll. This is used below
+ // *NOTE:Mani - This captures the module handle for the dll. This is used below
// to get the path to this dll for webkit initialization.
// I don't know how/if this can be done with apr...
namespace { HMODULE gModuleHandle;};
@@ -129,6 +133,16 @@ private:
//
void update(int milliseconds)
{
+#if LL_QTLINUX_DOESNT_HAVE_GLIB
+ // pump glib generously, as Linux browser plugins are on the
+ // glib main loop, even if the browser itself isn't - ugh
+ // This is NOT NEEDED if Qt itself was built with glib
+ // mainloop integration.
+ GMainContext *mainc = g_main_context_default();
+ while(g_main_context_iteration(mainc, FALSE));
+#endif // LL_QTLINUX_DOESNT_HAVE_GLIB
+
+ // pump qt
LLQtWebKit::getInstance()->pump( milliseconds );
mVolumeCatcher.pump();
@@ -200,6 +214,14 @@ private:
}
std::string application_dir = std::string( cwd );
+#if LL_LINUX
+ // take care to initialize glib properly, because some
+ // versions of Qt don't, and we indirectly need it for (some
+ // versions of) Flash to not crash the browser.
+ if (!g_thread_supported ()) g_thread_init (NULL);
+ g_type_init();
+#endif
+
#if LL_DARWIN
// When running under the Xcode debugger, there's a setting called "Break on Debugger()/DebugStr()" which defaults to being turned on.
// This causes the environment variable USERBREAK to be set to 1, which causes these legacy calls to break into the debugger.
diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h
index 5aa46686e8..cf3c030f08 100644
--- a/indra/newview/llstartup.h
+++ b/indra/newview/llstartup.h
@@ -93,7 +93,7 @@ public:
// Load default fonts not already loaded at start screen
static void fontInit();
- static void LLStartUp::copyLibraryGestures(const std::string& same_gender_gestures);
+ static void copyLibraryGestures(const std::string& same_gender_gestures);
// outfit_folder_name can be a folder anywhere in your inventory,
// but the name must be a case-sensitive exact match.