Bug 40991 - NPAPI plugins not compatible with Cocoa
Summary: NPAPI plugins not compatible with Cocoa
Status: VERIFIED REMIND
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.6
: P2 Major
Assignee: Nobody
URL: http://www.dreamfactory.com
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-22 09:48 PDT by Bill Appleton
Modified: 2010-07-02 16:05 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Appleton 2010-06-22 09:48:12 PDT
Our new NPAPI plugin is 32/64 bit pure Cocoa

Everything runs great with 32/64 bit FireFox (release candidate Minefield) and 32 bit Safari

However, on 64-bit Safari Cocoa behaves strangely with respect to dialogs

(We sometimes use a system dialog to open a file or perform page setup for printing)

This bug is easy to reproduce. Simply call [NSApp runPageLayout:nil] from any NPAPI plugin. The dialog will come up & work fine but when you click OK it always acts like you clicked Cancel. Bring the dialog up multiple times you will see: your changes are never remembered, because it thinks you clicked cancel every time. Now try the same thing with FireFox 32 or 64, it works fine.

Here is more detail on what is happening

StopModalWithCode always passes a zero to runModalForWindow, no matter what button was clicked

This would happen if we were calling StopModalWithCode on a secondary thread, but we have confirmed that this is not the case: WebKitPluginHost.app is running our plugin on the main thread.

Please fix this and/or let me know how to help.


Thanks,

Bill Appleton
CTO @ DreamFactory Software
Comment 1 Anders Carlsson 2010-06-22 10:36:00 PDT
This has been fixed in Safari 5!
Comment 2 Bill Appleton 2010-07-02 15:29:04 PDT
Hi All,

sometimes when my NPAPI plugin shows a dialog on the first event Safari 64 is thrown into modal mode and does not come out when the dialog is dismissed

i have watched this happen in the debugger, the modal mode is started when the dialog is dismissed and Safari hangs in modal mode after that

so there is some hole in modal mode when the dialog is shown early in the NPAPI plugin boot process


Best,

Bill Appleton
DreamFactory Software
Comment 3 Bill Appleton 2010-07-02 16:05:27 PDT
hi all,

OK, more information on this bug

the CFRunLoopPerformBlock is called in WKPCSetModal because the host is busy processing requests

so two WKPCSetModal calls are stacked up, one for going into modal mode, another for ending modal mode

but on exit only the WKPCSetModal(true) is used, and so Safari goes into modal mode & won't come out

the WKPCSetModal(false) is lost