diff options
author | Brian Smith <brian@dbsoft.org> | 2020-11-17 06:52:06 -0600 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-11-19 22:44:41 +0000 |
commit | 08cc9cd558b5dfa87f813c483f1810d300afc514 (patch) | |
tree | 95f85a501a1e946ef31a70df1160b360663669d4 /widget/cocoa | |
parent | 4f0f4aa8794ef12260d9d973b40ad3b942b69b72 (diff) | |
download | UXP-08cc9cd558b5dfa87f813c483f1810d300afc514.tar UXP-08cc9cd558b5dfa87f813c483f1810d300afc514.tar.gz UXP-08cc9cd558b5dfa87f813c483f1810d300afc514.tar.lz UXP-08cc9cd558b5dfa87f813c483f1810d300afc514.tar.xz UXP-08cc9cd558b5dfa87f813c483f1810d300afc514.zip |
Issue #1667 - Part 3: Fix OpenGL load and runtime issues on Big Sur
This fix is included in NSPR 4.27 and Mozilla bug 1652330.
Also put a main thread check in the cocoa draw callback.
Diffstat (limited to 'widget/cocoa')
-rw-r--r-- | widget/cocoa/nsChildView.mm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index 95547a13e..868687fe1 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -3564,10 +3564,16 @@ NSEvent* gLastDragMouseDownEvent = nil; // This method is called from mPixelHostingView's drawRect handler. - (void)doDrawRect:(NSRect)aRect { - CGContextRef cgContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; + if (!NS_IsMainThread()) { + // In the presence of CoreAnimation, this method can sometimes be called on + // a non-main thread. Ignore those calls because Gecko can only react to + // them on the main thread. + return; + } if (!mGeckoChild || !mGeckoChild->IsVisible()) return; + CGContextRef cgContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; if ([self isUsingOpenGL]) { // Since this view is usually declared as opaque, the window's pixel |