Centralize retained node teardown

This commit is contained in:
2026-06-12 16:15:43 +02:00
parent 9ac2c541dc
commit adb61795a6
7 changed files with 31 additions and 10 deletions

View File

@@ -127,7 +127,7 @@ kEventResult NodePanelFloating::handle_event(Event* e)
{
m_outline->SetPosition(c->m_pos);
m_outline->SetSize(c->m_size);
m_drop_placeholder->remove_from_parent();
pp::panopainter::detach_legacy_node_from_parent(*m_drop_placeholder);
int i = 0;
float y = 0;
for (; i < c->m_children.size(); i++)
@@ -154,7 +154,7 @@ kEventResult NodePanelFloating::handle_event(Event* e)
}
}
if (!docked && m_drop_placeholder->m_parent)
m_drop_placeholder->remove_from_parent();
pp::panopainter::detach_legacy_node_from_parent(*m_drop_placeholder);
}
else if (m_action == kDragAction::Reheight)
{
@@ -184,8 +184,8 @@ kEventResult NodePanelFloating::handle_event(Event* e)
{
if (m_drop_placeholder->m_parent)
drop_pos = std::max(0, m_drop_placeholder->m_parent->get_child_index(m_drop_placeholder.get()));
m_drop_placeholder->destroy();
m_drop_placeholder->remove_from_parent();
pp::panopainter::destroy_legacy_node(*m_drop_placeholder);
pp::panopainter::detach_legacy_node_from_parent(*m_drop_placeholder);
}
bool docked = false;
if (m_droppable)
@@ -226,7 +226,7 @@ kEventResult NodePanelFloating::handle_event(Event* e)
m_outline = nullptr;
m_drop_placeholder = nullptr;
}
mouse_release();
pp::panopainter::release_legacy_mouse_capture(*this);
ret = kEventResult::Consumed;
break;
default: