Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NPP_HandleEvent not called for windows plugins?

56 views
Skip to first unread message

Rudi Sherry

unread,
Sep 25, 2012, 8:14:12 PM9/25/12
to dev-tech...@lists.mozilla.org
Before I enter a bug, I want to make sure there hasn't been a change in the specification for which the document hasn't been updated.

I have a simple windows plug-in that's loaded within an HTML page, being embedded using <OBJECT> (it has height and width). It does not create any hwnds, it just is an empty shell that returns NPERR_NO_ERROR (or 'true' or whatever success indicates) for everything.

It's NPP_HandleEvent() function is never called (it is set in NP_GetEntryPoints()).

Is there something specific I need to do in order to get NPP_HandleEvents to be called? On the mac, it is called repeatedly for all sorts of events. The code is almost the same; one difference is that on the mac, NPP_New negotiates (using NPN_SetValue) the Cocoa Event Model.

Is there some event model that needs negotiating on Windows?

Thanks,
Rudi

Benjamin Smedberg

unread,
Sep 25, 2012, 8:19:54 PM9/25/12
to Rudi Sherry, dev-tech...@lists.mozilla.org
On 9/25/12 5:14 PM, Rudi Sherry wrote:
> Before I enter a bug, I want to make sure there hasn't been a change in the specification for which the document hasn't been updated.
>
> I have a simple windows plug-in that's loaded within an HTML page, being embedded using <OBJECT> (it has height and width). It does not create any hwnds, it just is an empty shell that returns NPERR_NO_ERROR (or 'true' or whatever success indicates) for everything.
>
> It's NPP_HandleEvent() function is never called (it is set in NP_GetEntryPoints()).
This is correct. NPP_HandleEvent is only called for windowless plugins.
By default plugins on Windows are run in windowed mode where you
subclass the window from NPP_SetWindow and handle the messages directly.

If you want to do a windowless-mode plugin you need to explicitly tell
the browser that decision:

NPN_SetValue(instance, NPPVpluginWindowBool, (void*)false);

You should check first to make sure that the browser supports windowless
mode. See
http://mxr.mozilla.org/mozilla-central/source/dom/plugins/test/testplugin/nptest.cpp#939
for some sample code from our testplugin.

--BDS

Rudi Sherry

unread,
Sep 25, 2012, 8:35:21 PM9/25/12
to Benjamin Smedberg, dev-tech...@lists.mozilla.org
Thanks!
0 new messages