git.lucas.co / cce-gallery
widget gallery and compositor test bench

commit8d1ec51fea7954c29145e4442043ce2c04978274
parent61dfd74953
authorLucas Galante <lsgalante12@gmail.com>
date2026-10-09 00:54
refactor: a parent check by id

cce-ui's registry owns its widgets (owning registry, phase 5); its raw-pointer tree accessors are crate-private.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

 src/main.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main.rs b/src/main.rs
index 6cd15fa..26c136c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1149,7 +1149,7 @@ impl cce_ui::engine::Application for State {
         // over everything else it painted, whatever its own order.)
         for i in 0..self.roster.len() {
             let w = self.roster.get_dyn(&self.ui_context, i);
-            if !self.is_widget_visible(i) || self.ui_context.tree.parent_ptr(w.base().id()).is_some() {
+            if !self.is_widget_visible(i) || self.ui_context.tree.parent_id(w.base().id()).is_some_and(|p| self.ui_context.tree.is_registered(p)) {
                 continue;
             }
             let mut walk = cce_ui::scene::paint::PaintCtx::new();
@@ -1232,7 +1232,7 @@ impl cce_ui::engine::Application for State {
             // A widget with a ui-tree parent (the page selector under the status bar) is
             // covered by that parent's walk — emitting it here too would draw its text
             // twice. Text inside a popover is culled; panel children clip to the panel.
-            if self.ui_context.tree.parent_ptr(w.base().id()).is_some() {
+            if self.ui_context.tree.parent_id(w.base().id()).is_some_and(|p| self.ui_context.tree.is_registered(p)) {
                 continue;
             }
             // Text is cut at the foot of the wall: geometry slides under the rim,