diff --git a/extras/browser plugins/demo/build/mac/JuceBrowserPluginDemo.xcodeproj/project.pbxproj b/extras/browser plugins/demo/build/mac/JuceBrowserPluginDemo.xcodeproj/project.pbxproj index a04f6ce16b..b50c8c9bb6 100644 --- a/extras/browser plugins/demo/build/mac/JuceBrowserPluginDemo.xcodeproj/project.pbxproj +++ b/extras/browser plugins/demo/build/mac/JuceBrowserPluginDemo.xcodeproj/project.pbxproj @@ -300,7 +300,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; - SDKROOT = macosx10.5; }; name = Debug; }; diff --git a/extras/browser plugins/wrapper/juce_NPAPI_GlueCode.cpp b/extras/browser plugins/wrapper/juce_NPAPI_GlueCode.cpp index 56e3e5d397..79f0331966 100644 --- a/extras/browser plugins/wrapper/juce_NPAPI_GlueCode.cpp +++ b/extras/browser plugins/wrapper/juce_NPAPI_GlueCode.cpp @@ -459,12 +459,25 @@ public: { const ScopedAutoReleasePool pool; + log ("setWindow"); + NSView* parentView = 0; - WindowRef windowRef = window != 0 ? ((NP_CGContext*) window->window)->window : 0; + NP_CGContext* const cgContext = (window != 0) ? (NP_CGContext*) window->window : 0; + log ("NP_CGContext: " + String::toHexString ((pointer_sized_int) cgContext)); + +#ifndef __LP64__ + WindowRef windowRef = cgContext != 0 ? (WindowRef) cgContext->window : 0; if (windowRef != 0) { NSWindow* win = [[[NSWindow alloc] initWithWindowRef: windowRef] autorelease]; +#else + NSWindow* win = cgContext != 0 ? (NSWindow*) cgContext->window : 0; + + if (win != 0) + { +#endif + log ("window: " + nsStringToJuce ([win description])); const Rectangle clip (window->clipRect.left, window->clipRect.top, window->clipRect.right - window->clipRect.left, @@ -480,6 +493,7 @@ public: if (! intersection.isEmpty()) { NSView* content = [win contentView]; + log ("content: " + nsStringToJuce ([content description])); float wx = (float) intersection.getCentreX(); float wy = (float) intersection.getCentreY(); @@ -943,7 +957,12 @@ NPError NPP_New (NPMIMEType pluginType, NPP npp, ::uint16 mode, ::int16 argc, ch #if JUCE_MAC browser.setvalue (npp, (NPPVariable) NPNVpluginDrawingModel, (void*) NPDrawingModelCoreGraphics); + + #ifdef __LP64__ + browser.setvalue (npp, (NPPVariable) 1001 /*NPPVpluginEventModel*/, (void*) 1 /*NPEventModelCocoa*/); + #else browser.setvalue (npp, (NPPVariable) 1001 /*NPPVpluginEventModel*/, 0 /*NPEventModelCarbon*/); + #endif #endif if (numPluginInstances++ == 0)