ssd: attach LAB_NODE_SSD_ROOT to ssd->tree

This doesn't change any behaviors.

Attaching LAB_NODE_NONE node-descriptor to ssd->tree looks strange, this
patch uses new LAB_NODE_SSD_ROOT instead. The node-descriptor attached to
ssd->tree is needed for get_cursor_context() to detect cursor hovering on
borders/extents.

I also updated get_cursor_context() to make my intent clearer.
This commit is contained in:
tokyo4j 2025-09-07 21:48:51 +09:00 committed by Hiroaki Yamamoto
parent b9b23f5931
commit 574b20fbff
4 changed files with 43 additions and 16 deletions

View file

@ -146,8 +146,14 @@ ssd_create(struct view *view, bool active)
ssd->view = view;
ssd->tree = wlr_scene_tree_create(view->scene_tree);
/*
* Attach node_descriptor to the root node so that get_cursor_context()
* detect cursor hovering on borders and extents.
*/
node_descriptor_create(&ssd->tree->node,
LAB_NODE_NONE, view, /*data*/ NULL);
LAB_NODE_SSD_ROOT, view, /*data*/ NULL);
wlr_scene_node_lower_to_bottom(&ssd->tree->node);
ssd->titlebar.height = view->server->theme->titlebar_height;
ssd_shadow_create(ssd);