#include <wlr/types/wlr_scene.h>
struct wlr_scene_rect *lab_wlr_scene_get_rect(struct wlr_scene_node *node);
+struct wlr_scene_tree *lab_scene_tree_from_node(struct wlr_scene_node *node);
struct wlr_surface *lab_wlr_surface_from_node(struct wlr_scene_node *node);
return (struct wlr_scene_rect *)node;
}
+struct wlr_scene_tree *
+lab_scene_tree_from_node(struct wlr_scene_node *node)
+{
+ assert(node->type == WLR_SCENE_NODE_TREE);
+ return (struct wlr_scene_tree *)node;
+}
+
struct wlr_surface *
lab_wlr_surface_from_node(struct wlr_scene_node *node)
{
printf("%*c%s\n", pos + 4 + INDENT_SIZE, ' ', "<skipping children>");
return;
}
- struct wlr_scene_node *child;
- wl_list_for_each(child, &node->children, link) {
- dump_tree(server, child, pos + INDENT_SIZE,
- x + child->x, y + child->y);
+
+ if (node->type == WLR_SCENE_NODE_TREE) {
+ struct wlr_scene_node *child;
+ struct wlr_scene_tree *tree = lab_scene_tree_from_node(node);
+ wl_list_for_each(child, &tree->children, link) {
+ dump_tree(server, child, pos + INDENT_SIZE,
+ x + child->x, y + child->y);
+ }
}
}
destroy_osd_nodes(struct output *output)
{
struct wlr_scene_node *child, *next;
- struct wl_list *children = &output->osd_tree->node.children;
+ struct wl_list *children = &output->osd_tree->children;
wl_list_for_each_safe(child, next, children, link) {
wlr_scene_node_destroy(child);
}
struct ssd_sub_tree *subtree;
FOR_EACH_STATE(view, subtree) {
if (subtree->tree->node.enabled) {
+ /*
+ * TODO: This function makes too many magic assumptions:
+ * - It expects the returned part to be the tree for the button
+ * - It expects the last node in that tree to be the hover overlay
+ *
+ * Both assumptions are valid as long as ssd_parts.c isn't changing
+ * the way a button is created but this cries for introducing bugs
+ * in the future if the button creation process or ssd_get_part()
+ * lookup routine would ever change.
+ */
part = ssd_get_part(&subtree->parts, type);
if (!part) {
wlr_log(WLR_ERROR, "hover enable failed to find button");
return NULL;
}
struct wlr_scene_node *child;
- wl_list_for_each_reverse(child, &part->node->children, link) {
+ struct wlr_scene_tree *button = lab_scene_tree_from_node(part->node);
+ wl_list_for_each_reverse(child, &button->children, link) {
if (child->type == WLR_SCENE_NODE_RECT) {
wlr_scene_node_set_enabled(child, true);
return child;
[wrap-git]
url = https://gitlab.freedesktop.org/wlroots/wlroots.git
-revision = cb2dbc327e4d695c2a60a386e116a7dc20b29107
+revision = 71f8a48d380701de1e3331d53d470bd76f5f643b
[provide]
dependency_names = wlroots