From 4a30bf58a48ed6f31f4c53473e8de70a8cd819da Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Sat, 6 Dec 2025 20:06:10 +0800 Subject: Fix SDL popup window. --- src/ui/controls/Control.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/ui/controls/Control.cpp') diff --git a/src/ui/controls/Control.cpp b/src/ui/controls/Control.cpp index 548c9726..57937da2 100644 --- a/src/ui/controls/Control.cpp +++ b/src/ui/controls/Control.cpp @@ -110,6 +110,14 @@ void Control::InsertChildAt(Control* control, Index index) { control->OnParentChanged(nullptr, this); OnChildInserted(control, index); + if (host_) { + control->TraverseDescendents( + [this](Control* control) { + control->ControlHostChangeEvent_.Raise({nullptr, host_}); + }, + true); + } + if (host_) { host_->ScheduleRelayout(); } @@ -131,6 +139,14 @@ void Control::RemoveChildAt(Index index) { control->OnParentChanged(this, nullptr); OnChildRemoved(control, index); + if (host_) { + control->TraverseDescendents( + [this](Control* control) { + control->ControlHostChangeEvent_.Raise({host_, nullptr}); + }, + true); + } + if (host_) { host_->ScheduleRelayout(); } -- cgit v1.2.3