I'm developing a browser plugin for MacOS 9.x and X, using Carbon. It appears that Mozilla 1.1 final doesn't call NPP_SetWindow when the frame is scrolled. As a result, the plugin is not notified of its new position and clipping rectangle. Using: CarbonLib 1.6 MacOS 10.2.1 CodeWarrior 8.2 Mac Powerbook G4/550. The plugin SDK I found in the Mozilla tree
assigning to peterl
Is the browser supposed to call NPP_SetWindow after scrolling??? I think only nsPluginEventType_ScrollingBeginsEvent events are sent through NPP_HandleEvent which should notify you when scrolling.
I am not aware of any requirement that SetWindow will be called. In fact, IMO, SetWindow should only be called twice, once to give the plugin its window, and again when the window (plugin) is shutdown. Everytime the plugin is called the plugins coordinates and clipRect are set to reflect its location on the screen.
It appears that I incorrectly assumed that NPP_SetWindow was called anytime the clipping area or the plugin origin were changed in order to inform the plugin of this change. Apparently one needs to copy the port origin and clip region at the time of an updateEvt in order to properly render to the port during an idle event (for animation). Is it safe to keep the pointer to the NPWindow passed by NPP_SetWindow and simply refer to its contents to update the origin and clip rect at idle time? In any case, I guess this bug can be closed. Thanks.
Your window will not change during the exection of your plugin. So, yes, you can cache that information.