Skip to content

Commit

Permalink
set to device layer the same background color as the window have
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeevPavel committed Mar 14, 2023
1 parent befd7f0 commit 3602767
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions skiko/src/awtMain/objectiveC/macos/MetalRedrawer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,16 @@ JNIEXPORT jlong JNICALL Java_org_jetbrains_skiko_redrawer_MetalRedrawer_createMe
device.layer.pixelFormat = MTLPixelFormatBGRA8Unorm;
device.layer.contentsGravity = kCAGravityTopLeft;

CGFloat transparent[] = { 0.0f, 0.0f, 0.0f, 0.0f };
device.layer.backgroundColor = CGColorCreate(CGColorSpaceCreateDeviceRGB(), transparent);
device.layer.opaque = NO;
NSWindow* window = (__bridge NSWindow*) (void *) windowPtr;

device.layer.opaque = NO;
if (transparency)
{
NSWindow* window = (__bridge NSWindow*) (void *) windowPtr;
CGFloat transparent[] = { 0.0f, 0.0f, 0.0f, 0.0f };
device.layer.backgroundColor = CGColorCreate(CGColorSpaceCreateDeviceRGB(), transparent);
window.hasShadow = NO;
} else {
device.layer.backgroundColor = window.backgroundColor.CGColor;
}

return (jlong) (__bridge_retained void *) device;
Expand Down

0 comments on commit 3602767

Please sign in to comment.