diff options
Diffstat (limited to 'Source/WebCore/plugins/gtk')
-rw-r--r-- | Source/WebCore/plugins/gtk/PluginPackageGtk.cpp | 25 | ||||
-rw-r--r-- | Source/WebCore/plugins/gtk/gtk2xtbin.c | 2 | ||||
-rw-r--r-- | Source/WebCore/plugins/gtk/gtk2xtbin.h | 3 |
3 files changed, 30 insertions, 0 deletions
diff --git a/Source/WebCore/plugins/gtk/PluginPackageGtk.cpp b/Source/WebCore/plugins/gtk/PluginPackageGtk.cpp index a702296..26409a7 100644 --- a/Source/WebCore/plugins/gtk/PluginPackageGtk.cpp +++ b/Source/WebCore/plugins/gtk/PluginPackageGtk.cpp @@ -104,6 +104,22 @@ bool PluginPackage::fetchInfo() #endif } +#if defined(XP_UNIX) +static int webkitgtkXError(Display* xdisplay, XErrorEvent* error) +{ + gchar errorMessage[64]; + XGetErrorText(xdisplay, error->error_code, errorMessage, 63); + g_warning("The program '%s' received an X Window System error.\n" + "This probably reflects a bug in the Adobe Flash plugin.\n" + "The error was '%s'.\n" + " (Details: serial %ld error_code %d request_code %d minor_code %d)\n", + g_get_prgname(), errorMessage, + error->serial, error->error_code, + error->request_code, error->minor_code); + return 0; +} +#endif + bool PluginPackage::load() { if (m_isLoaded) { @@ -137,6 +153,15 @@ bool PluginPackage::load() m_isLoaded = true; +#if defined(XP_UNIX) + if (!g_strcmp0(baseName.get(), "libflashplayer.so")) { + // Flash plugin can produce X errors that are handled by the GDK X error handler, which + // exits the process. Since we don't want to crash due to flash bugs, we install a + // custom error handler to show a warning when a X error happens without aborting. + XSetErrorHandler(webkitgtkXError); + } +#endif + NP_InitializeFuncPtr NP_Initialize = 0; m_NPP_Shutdown = 0; diff --git a/Source/WebCore/plugins/gtk/gtk2xtbin.c b/Source/WebCore/plugins/gtk/gtk2xtbin.c index e03fad3..605e42c 100644 --- a/Source/WebCore/plugins/gtk/gtk2xtbin.c +++ b/Source/WebCore/plugins/gtk/gtk2xtbin.c @@ -46,7 +46,9 @@ #include "xembed.h" #include "gtk2xtbin.h" #include <gtk/gtk.h> +#ifdef GTK_API_VERSION_2 #include <gdk/gdkx.h> +#endif #include <glib.h> #include <assert.h> #include <sys/time.h> diff --git a/Source/WebCore/plugins/gtk/gtk2xtbin.h b/Source/WebCore/plugins/gtk/gtk2xtbin.h index 11f6e06..937cd77 100644 --- a/Source/WebCore/plugins/gtk/gtk2xtbin.h +++ b/Source/WebCore/plugins/gtk/gtk2xtbin.h @@ -41,6 +41,9 @@ #define __GTK_XTBIN_H__ #include <gtk/gtk.h> +#ifndef GTK_API_VERSION_2 +#include <gtk/gtkx.h> +#endif #include <X11/Intrinsic.h> #include <X11/Xutil.h> #include <X11/Xlib.h> |