fix: incorrect view ordering for customButtonsOnHover (#15564)

This commit is contained in:
Shelley Vohr 2018-12-10 11:05:30 -08:00 committed by Michelle Tilley
parent 163361ee6a
commit 45a937df0a
4 changed files with 20 additions and 18 deletions

View file

@ -62,7 +62,12 @@ void BrowserWindow::OverrideNSWindowContentView(InspectableWebContents* iwc) {
NSView* webView = iwc->GetView()->GetNativeView();
NSView* contentView = [window()->GetNativeWindow() contentView];
[webView setFrame:[contentView bounds]];
[contentView addSubview:webView];
// ensure that buttons view is floated to top of view hierarchy
NSArray* subviews = [contentView subviews];
NSView* last = subviews.lastObject;
[contentView addSubview:webView positioned:NSWindowBelow relativeTo:last];
[contentView viewDidMoveToWindow];
}