Skip to content

Commit

Permalink
- fixed invalid context warnings with Cocoa backend
Browse files Browse the repository at this point in the history
A bunch of 'CGContext<...>: invalid context 0x0' messages were printed to console during OpenGL view creation and resizing
  • Loading branch information
alexey-lysiuk committed Jan 7, 2020
1 parent 7e05001 commit 442f953
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/posix/cocoa/i_video.mm
Expand Up @@ -187,8 +187,15 @@ @implementation OpenGLCocoaView

- (void)drawRect:(NSRect)dirtyRect
{
[NSColor.blackColor setFill];
NSRectFill(dirtyRect);
if ([NSGraphicsContext currentContext])
{
[NSColor.blackColor setFill];
NSRectFill(dirtyRect);
}
else if (self.layer != nil)
{
self.layer.backgroundColor = CGColorGetConstantColor(kCGColorBlack);
}
}

- (void)resetCursorRects
Expand Down

0 comments on commit 442f953

Please sign in to comment.