head	1.2;
access;
symbols;
locks; strict;
comment	@# @;


1.2
date	2011.04.26.18.56.14;	author jkim;	state dead;
branches;
next	1.1;

1.1
date	2011.03.31.17.10.11;	author jkim;	state Exp;
branches;
next	;


desc
@@


1.2
log
@- Update to 1.3.2 and remove obsolete local patches.
- Replace the defunct URL with a new upstream location.  Now this project has
a new maintainer:

https://www.redhat.com/archives/nspluginwrapper-devel-list/2011-April/msg00003.html

For more information about this release, please see the following thread:

https://www.redhat.com/archives/nspluginwrapper-devel-list/2011-April/msg00006.html

Prodded by:	Benjamin Kaduk (kaduk at MIT dot EDU), arundel
@
text
@--- 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 */
@


1.1
log
@Add a temporary workaround for long standing and very annoying "right-click
hang" problem of Adobe Flash plugin 10.1 and above.  For now, we completely
ignore ButtonPress event from Button3 and always return false as Adobe Flash
10.0 plugin does.  Opera and Chromium seem to do something similar.
@
text
@@

