SameBoy/Cocoa/GBBorderView.m

27 lines
767 B
Mathematica
Raw Permalink Normal View History

#import "GBBorderView.h"
@implementation GBBorderView
- (void)awakeFromNib
{
2021-10-23 10:36:58 +00:00
self.wantsLayer = true;
}
- (BOOL)wantsUpdateLayer
{
2021-10-23 10:36:58 +00:00
return true;
}
- (void)updateLayer
{
/* Wonderful, wonderful windowserver(?) bug. Using 0,0,0 here would cause it to render garbage
on fullscreen windows on some High Sierra machines. Any other value, including the one used
here (which is rendered exactly the same due to rounding) works around this bug. */
self.layer.backgroundColor = [NSColor colorWithCalibratedRed:0
green:0
blue:1.0 / 1024.0
alpha:1.0].CGColor;
}
@end