Bug 14985 - Flash movies require double clicks when WebView is embedded in a Carbon application.
Summary: Flash movies require double clicks when WebView is embedded in a Carbon appli...
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL: http://lists.apple.com/archives/webki...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2007-08-16 10:32 PDT by Chris Perkins
Modified: 2011-05-23 11:46 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Perkins 2007-08-16 10:32:20 PDT
In a mixed Carbon/Cocoa Mac OS X application, mouse click events are not properly received by Flash. Mouse over / Roll over / Drag works fine. The first click in the Flash window works fine. After the first click inside Flash, a single mouse click is not picked up by Flash. A double-click will register in Flash as a single click.

See here for a full description of the problem as well as how to re-create it: http://lists.apple.com/archives/webkitsdk-dev/2007/May/msg00009.html


There are two workarounds: 
1 - don't embed the .swf in an .html file, instead pass the .swf directly to the webview.

2. override the makeFirstResponder method of the NSView and manually pass the focus to your nsview/webview and then pass the event to it.

Workaround #1 works for older WebKits, but not later ones. For instance, if a user installs Safari 3 Beta, then the double click problem returns even if using workaround #1.

Workaround #2 requires a lot of Cocoa bridging (remember, we are working in Carbon). If you are using HIWebViewCreate() in your Carbon code you won't be able to use Workaround #2.


I suspect that Workaround #2 could be used to actually fix the bug in WebView.
Comment 1 Mark Rowe (bdash) 2007-08-16 20:29:10 PDT
Chris, have you tried this in a recent nightly build of WebKit?
Comment 2 Chris Perkins 2007-08-16 20:48:01 PDT
I got it working with the instructions on the debugging page. 

I'm not debugging WebKit with XCode, just embedding it into a framework, I didn't realized those instructions would apply. I was intentionally avoiding them, trying to keep to the problem simpler. 



Comment 3 Chris Perkins 2007-08-16 20:49:07 PDT
Sorry - wrong bug.

Yes, this bug is open and still occurs.
Comment 4 David Kilzer (:ddkilzer) 2007-12-18 10:11:16 PST
<rdar://problem/5653340>
Comment 5 David Kilzer (:ddkilzer) 2011-05-23 11:43:29 PDT
Please use HICocoaView with a WebView, or use Cocoa proper for your app.
Comment 6 David Kilzer (:ddkilzer) 2011-05-23 11:46:55 PDT
(In reply to comment #5)
> Please use HICocoaView with a WebView, or use Cocoa proper for your app.

Note that HIWebView has been deprecated since WebKit 4.0:
HIWebViewCreate(HIViewRef * outControl) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0;