Closed
Bug 591311
Opened 15 years ago
Closed 9 years ago
plugin development: setting NPPVpluginWindowBool to false does not fire NPP_SetWindow anymore
Categories
(Core Graveyard :: Plug-ins, defect)
Tracking
(Not tracked)
RESOLVED
INCOMPLETE
People
(Reporter: tiberiu.dragulinescu, Unassigned)
Details
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.33 Safari/534.3
Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:2.0b5pre) Gecko/20100824 Minefield/4.0b5pre
setting NPPVpluginWindowBool to false in NPP_New does not fire NPP_SetWindow anymore.
Not setting NPPVpluginWindowBool to false fires NPP_SetWindow, but getting browser hwnd with NPNVnetscapeWindow returns 0
Reproducible: Always
Steps to Reproduce:
static NPError
nevv(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char *argn[], char *argv[], NPSavedData *saved) {
inst = instance;
logmsg("npsimple: new\n");
npnfuncs->setvalue(inst,NPPVpluginWindowBool,false);
return NPERR_NO_ERROR;
}
static NPError
setWindow(NPP instance, NPWindow* pNPWindow) {
char s[100];
unsigned int msgid=256;
unsigned int wparam=122;
unsigned int lparam=2228225;
inst = instance;
logmsg("npsimple: setWindow\n");
npnfuncs->getvalue(inst,NPNVnetscapeWindow,&browserhwnd);
sprintf(s,"hwnd=%d\n",browserhwnd);
logmsg(s);
SendMessageW(browserhwnd,msgid,wparam,lparam);
return NPERR_NO_ERROR;
}
the same code calls NPP_SetWindow when NPPVpluginWindowBool is set to false in Chromium 7.0.504.0 (57040)
Updated•15 years ago
|
Component: General → Plug-ins
Product: Firefox → Core
QA Contact: general → plugins
Comment 1•15 years ago
|
||
We don't send NPP_SetWindow until we're about to paint the plugin, IIRC. Why should we send it sooner?
Comment 2•15 years ago
|
||
(In reply to comment #0)
> User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.3
> (KHTML, like Gecko) Chrome/6.0.472.33 Safari/534.3
> Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:2.0b5pre) Gecko/20100824
> Minefield/4.0b5pre
>
> setting NPPVpluginWindowBool to false in NPP_New does not fire NPP_SetWindow
> anymore.
>
..
> the same code calls NPP_SetWindow when NPPVpluginWindowBool is set to false in
> Chromium 7.0.504.0 (57040)
"anymore", implying we used to do this in previous versions of the browser? Just trying to confirm since looking at the code base, NPPVpluginWindowBool just sets a flag, it doesn't trigger a set window callback. (Are you comparing fx 'in general' to Chrome?)
> Not setting NPPVpluginWindowBool to false fires NPP_SetWindow, but getting
> browser hwnd with NPNVnetscapeWindow returns 0
Hmm, looking at PluginInstanceChild's set window:
http://mxr.mozilla.org/mozilla-central/source/dom/plugins/PluginInstanceChild.cpp#856
I don't see how this is possible, since we create the window in the first set window call, before we call into the plugin. But there might be a bug someplace, will test.
Forgive me for not being clear: when _not_ setting NPPVpluginWindowBool to false the NPP_SetWindow is called, setting it to false it is not... anymore.
Now the full story: all I want is to get the hwnd of the browser. I 've done that by calling NPN_GetValue with the NPPVpluginWindowBool parameter.
Calling NPN_GetValue in NPP_New returns 0, calling it in NPP_SetWindow I get the right handle (hwnd). But setting NPPVpluginWindowBool to false, the NPP_SetWindow function is not called ... anymore :)
I don't know how to edit a comment and I made a mistake in the previous comment:
"...by calling NPN_GetValue with the NPPVpluginWindowBool parameter." is to be read "...by calling NPN_GetValue with the NPNVnetscapeWindow parameter."
Updated•9 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → INCOMPLETE
Updated•4 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•