JefChou / npapi-sdk

Automatically exported from code.google.com/p/npapi-sdk
0 stars 0 forks source link

Samples unix-basic BasicPlugin not working #12

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The unix basic plugin compiles fine shows up in firefox and chrome. 

When runing a page with the plugin it doesnt show anything but it doesnt crash 
either.

Through the command line chrome is giving this

(exe:1334): Gdk-CRITICAL **: IA__gdk_gc_new: assertion `drawable != NULL' failed

(exe:1334): Gdk-CRITICAL **: IA__gdk_gc_set_rgb_fg_color: assertion `GDK_IS_GC 
(gc)' failed

(exe:1334): Gdk-CRITICAL **: IA__gdk_draw_rectangle: assertion `GDK_IS_DRAWABLE 
(drawable)' failed

(exe:1334): Gdk-CRITICAL **: IA__gdk_gc_set_rgb_fg_color: assertion `GDK_IS_GC 
(gc)' failed

(exe:1334): Gdk-CRITICAL **: IA__gdk_gc_set_values: assertion `GDK_IS_GC (gc)' 
failed

(exe:1334): Gdk-CRITICAL **: IA__gdk_draw_rectangle: assertion `GDK_IS_DRAWABLE 
(drawable)' failed

(exe:1334): Gdk-CRITICAL **: IA__gdk_draw_layout: assertion `GDK_IS_DRAWABLE 
(drawable)' failed

(exe:1334): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT 
(object)' failed

(exe:1334): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT 
(object)' failed

Original issue reported on code.google.com by jef...@gmail.com on 20 Sep 2011 at 8:24

GoogleCodeExporter commented 8 years ago
Firefox is giving me pretty much the same problem

(<unknown>:10293): Gdk-CRITICAL **: IA__gdk_gc_new: assertion `drawable != 
NULL' failed

(<unknown>:10293): Gdk-CRITICAL **: IA__gdk_gc_set_rgb_fg_color: assertion 
`GDK_IS_GC (gc)' failed

(<unknown>:10293): Gdk-CRITICAL **: IA__gdk_draw_rectangle: assertion 
`GDK_IS_DRAWABLE (drawable)' failed

(<unknown>:10293): Gdk-CRITICAL **: IA__gdk_gc_set_rgb_fg_color: assertion 
`GDK_IS_GC (gc)' failed

(<unknown>:10293): Gdk-CRITICAL **: IA__gdk_gc_set_values: assertion `GDK_IS_GC 
(gc)' failed

(<unknown>:10293): Gdk-CRITICAL **: IA__gdk_draw_rectangle: assertion 
`GDK_IS_DRAWABLE (drawable)' failed

(<unknown>:10293): Gdk-CRITICAL **: IA__gdk_draw_layout: assertion 
`GDK_IS_DRAWABLE (drawable)' failed

(<unknown>:10293): GLib-GObject-CRITICAL **: g_object_unref: assertion 
`G_IS_OBJECT (object)' failed

(<unknown>:10293): GLib-GObject-CRITICAL **: g_object_unref: assertion 
`G_IS_OBJECT (object)' failed

Original comment by jef...@gmail.com on 20 Sep 2011 at 8:27

GoogleCodeExporter commented 8 years ago
I got the problem narrowed down I dont know the solution but the problem is 
happening on this line at least from what I can tell

GdkDrawable* gdkWindow = GDK_DRAWABLE(gdk_window_foreign_new(nativeWinId));

gdk_window_foreign_new seems to be returning null

Original comment by jef...@gmail.com on 20 Sep 2011 at 9:14

GoogleCodeExporter commented 8 years ago
Same behavios here with Mozilla Firefox 6.0.2, however Google Chrome and 
Chromium works well.
Google Chrome version: 14.0.835.186 (Official Build 101821)
Chromium version: 14.0.803.0 (Developer Build 90483) Ubuntu 11.04

Original comment by fracting@gmail.com on 4 Oct 2011 at 10:52

GoogleCodeExporter commented 8 years ago
My version is
Chromium version: 12.0.742.112 (90304) Ubuntu 11.04

Original comment by jef...@gmail.com on 4 Oct 2011 at 11:24

GoogleCodeExporter commented 8 years ago
This patch mostly fixes it. The issue was that the Drawable could be either a 
Pixmap or a Window. Newer browsers do out-of-process stuff and pass a Pixmap, 
but Firefox <4 in in-process plugin mode just passes in the Window.

This works for me in Firefox and WebKitGtk. Unfortunately, this doesn't work 
for me in Chrome for some reason. It renders, but most of the plugin ends up 
being transparent. I poked at it a bit Chrome-side but haven't figured out 
what's wrong.

(There is also another issue with QtWebKit, but it probably deserves its own 
bug. The plugin doesn't link to libgdk-x11-2.0.so.0, so QtWebKit can't load it. 
Once that's there, QtWebKit only calls gtk_init for Flash and nspluginwrapper. 
If you have one of those installed, it all works. If not, gtk_init never gets 
called. Not sure whose bug that should be considered.)

Original comment by davidben@davidben.net on 11 Oct 2011 at 4:52

Attachments:

GoogleCodeExporter commented 8 years ago
Thank you so much for spending your time fixing this it has had me going 
bonkers for quite a while. At the moment im not so worried about the chrome 
side.

Ill schedule some time in tomorrow and let you know the results. Once again 
thank you this is a big help.

Original comment by jef...@gmail.com on 11 Oct 2011 at 5:58

GoogleCodeExporter commented 8 years ago
Finally got around to it 5 am on a saturday lol. It works perfectly in firefox 
and chromium is the same as you explained chrome is its mostly transparent but 
shows the useragent. Thank you!!

Original comment by jef...@gmail.com on 15 Oct 2011 at 9:28