Skip to content

Commit

Permalink
fix(window/apple): set 'contentView' before adding title bar buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
jwerle committed May 8, 2024
1 parent e46e272 commit 6ee86d0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/window/apple.mm
Expand Up @@ -1148,6 +1148,9 @@ - (void) webView: (WKWebView*) webview
this->window.collectionBehavior = NSWindowCollectionBehaviorFullScreenAuxiliary;
}

// Add webview to window
this->window.contentView = this->webview;

if (opts.frameless) {
this->window.titlebarAppearsTransparent = YES;
this->window.movableByWindowBackground = YES;
Expand Down Expand Up @@ -1214,7 +1217,7 @@ - (void) webView: (WKWebView*) webview
this->window.windowControlOffsets = NSMakePoint(x, y);
this->window.titleBarView = titleBarView;

[this->window.contentView addSubview: titleBarView];
[this->webview addSubview: titleBarView];
} else {
NSLog(@"Failed to retrieve standard window buttons.");
}
Expand Down Expand Up @@ -1258,9 +1261,6 @@ - (void) webView: (WKWebView*) webview
this->window.backgroundColor = NSColor.windowBackgroundColor;
}

// Add webview to window
this->window.contentView = this->webview;

// Position window in center of screen
[this->window center];

Expand Down

0 comments on commit 6ee86d0

Please sign in to comment.