fix: native View
wrapper crash missing when adding child view (#43698)
fix: native View wrapper crash missing when adding child view Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
parent
8ca3b8f84e
commit
763d3983a1
3 changed files with 29 additions and 7 deletions
|
@ -15,13 +15,9 @@ DelayedNativeViewHost::~DelayedNativeViewHost() = default;
|
|||
|
||||
void DelayedNativeViewHost::ViewHierarchyChanged(
|
||||
const views::ViewHierarchyChangedDetails& details) {
|
||||
// NativeViewHost doesn't expect to have children, so filter the
|
||||
// ViewHierarchyChanged events before passing them on.
|
||||
if (details.child == this) {
|
||||
NativeViewHost::ViewHierarchyChanged(details);
|
||||
if (details.is_add && GetWidget() && !native_view())
|
||||
Attach(native_view_);
|
||||
}
|
||||
NativeViewHost::ViewHierarchyChanged(details);
|
||||
if (details.is_add && GetWidget() && !native_view())
|
||||
Attach(native_view_);
|
||||
}
|
||||
|
||||
bool DelayedNativeViewHost::OnMousePressed(const ui::MouseEvent& ui_event) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue