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

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

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
This commit is contained in:
trop[bot] 2024-04-10 13:20:44 +02:00 committed by GitHub
parent 73fd29195f
commit 3ea26fb9d0
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>