From 069b11c14c732ca3863c65e68e23c93d8cee4b80 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Mon, 24 Oct 2022 23:45:38 -0500 Subject: [PATCH] Issue #2022 - Part 1 - Fix transparent windows on MacOS 13 Ventura. During the BaseWindow creation contenView is nil on Ventura... So create a NSView with the requested dimensions and set is as the contenView. --- widget/cocoa/nsCocoaWindow.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm index a437504fd1..c15874715c 100644 --- a/widget/cocoa/nsCocoaWindow.mm +++ b/widget/cocoa/nsCocoaWindow.mm @@ -2903,6 +2903,10 @@ static NSMutableSet *gSwizzledFrameViewClasses = nil; { mDrawsIntoWindowFrame = NO; [super initWithContentRect:aContentRect styleMask:aStyle backing:aBufferingType defer:aFlag]; + // MacOS 13 Ventura, doesn't seem to create the contentView... so create it ourselves + if(![super contentView]) { + [super setContentView:[[NSView alloc] initWithFrame:aContentRect]]; + } mState = nil; mActiveTitlebarColor = nil; mInactiveTitlebarColor = nil;