[Webkit-unassigned] [Bug 70739] New: NPAPI plugins with Cocoa event model don't get correct focusChanged events

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 24 10:36:28 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=70739

           Summary: NPAPI plugins with Cocoa event model don't get correct
                    focusChanged events
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh Intel
        OS/Version: Mac OS X 10.6
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: Plug-ins
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: rsherry at adobe.com


Created an attachment (id=112210)
 --> (https://bugs.webkit.org/attachment.cgi?id=112210&action=review)
WebKit plugin for *.pluginbug served as application/vnd.pluginbug

When a plugin gets loaded and uses the Cocoa Event model, it becomes the focus but never gets the cocoa event "NPCocoaEventFocusChanged"; same when clicking into the plugin area after the focus is in the URL bar.

Our plugin needs to know exactly when it is, and isn't, the focus so we can enable our controls, blink our cursor, etc.

I've included a plugin that responds to files with extension 'pluginbug' served with MIME type 'application/vnd.pluginbug' (target 10.6 SDK). All it does is do the logging of events and calls, and the output below is what we get.

I've tried this in Safari 5.1.1 as well as a nightly from late last week.

NP_Initialize
NP_GetEntryPoints
NPP_New
NPP_SetWindow
NPP_HandleEvent NPCocoaEventWindowFocusChanged OFF
NPP_HandleEvent NPCocoaEventWindowFocusChanged OFF
NPP_NewStream
NPP_StreamAsFile
NPP_DestroyStream
NPP_HandleEvent NPCocoaEventDrawRect
NPP_GetValue 15

We were never told that we got the focus specifically, only that the window got the focus. The keyboard focus is actually in the plug-in (that is, keys sent to the browser are forwarded to the plug-in.


In addition clicking in the plug-in, then clicking in the URL bar, which should remove focus from the plugin, does not fire any focus-changed events.

...moved the mouse to the plug-in area and clicked (which fires the getFocus finally);

NPP_HandleEvent NPCocoaEventMouseEntered
NPP_HandleEvent NPCocoaEventFocusChanged ON 
NPP_HandleEvent NPCocoaEventFocusChanged ON
NPP_HandleEvent NPCocoaEventMouseDown
NPP_HandleEvent NPCocoaEventMouseUp


...moved mouse to URL bar and clicked (which never fires a loseFocus):

NPP_HandleEvent NPCocoaEventMouseExited


... moved mouse back to plugin and clicked

NPP_HandleEvent NPCocoaEventMouseEntered
NPP_HandleEvent NPCocoaEventMouseDown
NPP_HandleEvent NPCocoaEventMouseUp

... hit apple-Quit

NPP_HandleEvent NPCocoaEventFlagsChanged
NPP_HandleEvent NPCocoaEventKeyDown
NPP_Destroy
NP_Shutdown

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list