fix: move BrowserWindow's WebContentsView to be a child of rootview (#41256)

This commit is contained in:
Jeremy Rose 2024-04-08 10:30:23 -07:00 committed by GitHub
parent 22c149812c
commit 76f7bbb0a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 31 additions and 34 deletions

View file

@ -469,12 +469,12 @@ void NativeWindowViews::SetGTKDarkThemeEnabled(bool use_dark_theme) {
void NativeWindowViews::SetContentView(views::View* view) {
if (content_view()) {
root_view_.RemoveChildView(content_view());
root_view_.GetMainView()->RemoveChildView(content_view());
}
set_content_view(view);
focused_view_ = view;
root_view_.AddChildView(content_view());
root_view_.DeprecatedLayoutImmediately();
root_view_.GetMainView()->AddChildView(content_view());
root_view_.GetMainView()->DeprecatedLayoutImmediately();
}
void NativeWindowViews::Close() {
@ -1664,7 +1664,7 @@ std::u16string NativeWindowViews::GetWindowTitle() const {
}
views::View* NativeWindowViews::GetContentsView() {
return &root_view_;
return root_view_.GetMainView();
}
bool NativeWindowViews::ShouldDescendIntoChildForEventHandling(
@ -1674,7 +1674,7 @@ bool NativeWindowViews::ShouldDescendIntoChildForEventHandling(
}
views::ClientView* NativeWindowViews::CreateClientView(views::Widget* widget) {
return new NativeWindowClientView{widget, GetContentsView(), this};
return new NativeWindowClientView{widget, &root_view_, this};
}
std::unique_ptr<views::NonClientFrameView>