Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bug 583296 - Fix StartDrawingPlugin to correctly detect nested OS X O…

…OPP paint events. r=josh
  • Loading branch information...
commit bc1645aa2b8a62636abf3edc285077a58c1509f0 1 parent 6b4bdba
@bgirard bgirard authored
View
3  dom/plugins/PluginUtilsOSX.mm
@@ -72,8 +72,6 @@ - (void)setRemoteEvents:(RemoteProcessEvents) remoteEvents pluginModule:(void*)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
- // Leave out this code until we can fix painting. See bug 568513.
- /*
// Create a timer to process browser events while waiting
// on the menu. This prevents the browser from hanging
// during the lifetime of the menu.
@@ -86,7 +84,6 @@ - (void)setRemoteEvents:(RemoteProcessEvents) remoteEvents pluginModule:(void*)
// not fire during the right click menu.
[[NSRunLoop currentRunLoop] addTimer:eventTimer
forMode:NSEventTrackingRunLoopMode];
- */
NSMenu* nsmenu = reinterpret_cast<NSMenu*>(aMenu);
NSPoint screen_point = ::NSMakePoint(aX, aY);
View
1  widget/src/cocoa/nsChildView.h
@@ -431,6 +431,7 @@ class nsChildView : public nsBaseWidget,
PRPackedBool mDrawing;
PRPackedBool mPluginDrawing;
PRPackedBool mPluginIsCG; // true if this is a CoreGraphics plugin
+ PRPackedBool mIsDispatchPaint; // Is a paint event being dispatched
NP_CGContext mPluginCGContext;
#ifndef NP_NO_QUICKDRAW
View
8 widget/src/cocoa/nsChildView.mm
@@ -470,6 +470,7 @@ static void DebugPrintAllKeyboardLayouts()
, mDrawing(PR_FALSE)
, mPluginDrawing(PR_FALSE)
, mPluginIsCG(PR_FALSE)
+, mIsDispatchPaint(PR_FALSE)
, mPluginInstanceOwner(nsnull)
{
#ifdef PR_LOGGING
@@ -1250,7 +1251,7 @@ static void HideChildPluginViews(NSView* aView)
// without regressing bug 409615. See bug 435041. (StartDrawPlugin() and
// EndDrawPlugin() wrap every call to nsIPluginInstance::HandleEvent() --
// not just calls that "draw" or paint.)
- if (!mPluginIsCG || (mView != [NSView focusView])) {
+ if (!mPluginIsCG || mIsDispatchPaint) {
if (mPluginDrawing)
return NS_ERROR_FAILURE;
}
@@ -1695,9 +1696,14 @@ inline PRUint16 COLOR8TOCOLOR16(PRUint8 color8)
}
}
+ PRBool restoreIsDispatchPaint = mIsDispatchPaint;
+ mIsDispatchPaint = mIsDispatchPaint || event->eventStructType == NS_PAINT_EVENT;
+
if (mEventCallback)
aStatus = (*mEventCallback)(event);
+ mIsDispatchPaint = restoreIsDispatchPaint;
+
return NS_OK;
}
Please sign in to comment.
Something went wrong with that request. Please try again.