summaryrefslogtreecommitdiff
path: root/www/nspluginwrapper-devel/files
diff options
context:
space:
mode:
Diffstat (limited to 'www/nspluginwrapper-devel/files')
-rw-r--r--www/nspluginwrapper-devel/files/patch-ignore-flash-button355
1 files changed, 55 insertions, 0 deletions
diff --git a/www/nspluginwrapper-devel/files/patch-ignore-flash-button3 b/www/nspluginwrapper-devel/files/patch-ignore-flash-button3
new file mode 100644
index 000000000000..1788efb06ed5
--- /dev/null
+++ b/www/nspluginwrapper-devel/files/patch-ignore-flash-button3
@@ -0,0 +1,55 @@
+--- src/npw-wrapper.c.orig 2009-01-02 09:22:29.000000000 -0500
++++ src/npw-wrapper.c 2011-03-31 12:34:33.000000000 -0400
+@@ -2560,6 +2561,35 @@
+ return ret;
+ }
+
++#define NPW_ADOBE_FLASH_PLUGIN "Shockwave Flash"
++
++struct flash_version {
++ unsigned int major;
++ unsigned int minor;
++};
++
++// Detect Adobe Flash plugin version
++static void adobe_flash_version(struct flash_version *vers)
++{
++ static struct flash_version fv = { 0, 0 };
++ static bool tested = false;
++
++ if (!tested) {
++ if (g_plugin.name != NULL && g_plugin.description != NULL &&
++ strcmp(g_plugin.name, NPW_ADOBE_FLASH_PLUGIN) == 0 &&
++ strncmp(g_plugin.description, NPW_ADOBE_FLASH_PLUGIN,
++ strlen(NPW_ADOBE_FLASH_PLUGIN)) == 0) {
++ char *ptr, *endp;
++ ptr = g_plugin.description + strlen(NPW_ADOBE_FLASH_PLUGIN);
++ fv.major = strtol(ptr, &endp, 10);
++ if (*endp == '.')
++ fv.minor = strtol(endp + 1, NULL, 10);
++ }
++ tested = true;
++ }
++ *vers = fv;
++}
++
+ static int16 g_NPP_HandleEvent(NPP instance, void *event)
+ {
+ if (instance == NULL)
+@@ -2569,6 +2599,16 @@
+ if (plugin == NULL)
+ return NPERR_INVALID_INSTANCE_ERROR;
+
++ if (((NPEvent *)event)->type == ButtonPress && ((XButtonEvent *)event)->button == Button3) {
++ static struct flash_version vers;
++ adobe_flash_version(&vers);
++ /* XXX: work around "right click" hang with Flash plugin 10.1 and later */
++ if ((vers.major == 10 && vers.minor >= 1) || vers.major > 10) {
++ D(bug("NPP_HandleEvent instance=%p, ignoring ButtonPress event for "
++ NPW_ADOBE_FLASH_PLUGIN " %u.%u\n", instance, vers.major, vers.minor));
++ return false;
++ }
++ }
+ if (((NPEvent *)event)->type == GraphicsExpose) {
+ /* XXX: flush the X output buffer so that the call to
+ gdk_pixmap_foreign_new() in the viewer can work */