mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-09 04:25:38 +00:00
Bug 583296 - Fix StartDrawingPlugin to correctly detect nested OS X OOPP paint events. r=josh
This commit is contained in:
parent
77af6a588c
commit
32e369134b
@ -72,8 +72,6 @@ NPError mozilla::plugins::PluginUtilsOSX::ShowCocoaContextMenu(void* aMenu, int
|
||||
{
|
||||
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 @@ NPError mozilla::plugins::PluginUtilsOSX::ShowCocoaContextMenu(void* aMenu, int
|
||||
// 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);
|
||||
|
@ -431,6 +431,7 @@ protected:
|
||||
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
|
||||
|
@ -470,6 +470,7 @@ nsChildView::nsChildView() : nsBaseWidget()
|
||||
, mDrawing(PR_FALSE)
|
||||
, mPluginDrawing(PR_FALSE)
|
||||
, mPluginIsCG(PR_FALSE)
|
||||
, mIsDispatchPaint(PR_FALSE)
|
||||
, mPluginInstanceOwner(nsnull)
|
||||
{
|
||||
#ifdef PR_LOGGING
|
||||
@ -1250,7 +1251,7 @@ NS_IMETHODIMP nsChildView::StartDrawPlugin()
|
||||
// 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 @@ NS_IMETHODIMP nsChildView::DispatchEvent(nsGUIEvent* event, nsEventStatus& aStat
|
||||
}
|
||||
}
|
||||
|
||||
PRBool restoreIsDispatchPaint = mIsDispatchPaint;
|
||||
mIsDispatchPaint = mIsDispatchPaint || event->eventStructType == NS_PAINT_EVENT;
|
||||
|
||||
if (mEventCallback)
|
||||
aStatus = (*mEventCallback)(event);
|
||||
|
||||
mIsDispatchPaint = restoreIsDispatchPaint;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user