From 3c5c5b6b513e235ee79a6c5f6173a6374f138e84 Mon Sep 17 00:00:00 2001 From: hippoz <10706925-hippoz@users.noreply.gitlab.com> Date: Tue, 26 Jul 2022 04:47:03 +0300 Subject: [PATCH] add batch in add_child --- src/Widget.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Widget.cpp b/src/Widget.cpp index c69d08d..933bc90 100644 --- a/src/Widget.cpp +++ b/src/Widget.cpp @@ -90,6 +90,10 @@ bool Widget::add_child(std::shared_ptr child) { if (child->parent()) { return false; } + + if (window()) + window()->start_batch(); + m_children.push_back(child); child->set_parent(this); @@ -98,6 +102,9 @@ bool Widget::add_child(std::shared_ptr child) { // after we call set_window() on it. child->set_window(m_window); + if (window()) + window()->end_batch(); + return true; }