From 86e9309808ae147dff0ac3884148d53b2c3edf2b Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 6 May 2020 16:16:45 +0200 Subject: scene: add wlr_scene_node_toggle This allows compositors to easily enable or disable a scene-graph node. This can be used to show/hide a surface when the xdg_surface is mapped/unmapped. --- include/wlr/types/wlr_scene.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/wlr/types/wlr_scene.h b/include/wlr/types/wlr_scene.h index 953b1b87..b5690575 100644 --- a/include/wlr/types/wlr_scene.h +++ b/include/wlr/types/wlr_scene.h @@ -35,6 +35,7 @@ struct wlr_scene_node_state { struct wl_list children; // wlr_scene_node_state.link + bool enabled; int x, y; // relative to parent }; @@ -68,6 +69,11 @@ struct wlr_scene_surface { * Immediately destroy the scene-graph node. */ void wlr_scene_node_destroy(struct wlr_scene_node *node); +/** + * Enable or disable this node. If a node is disabled, all of its children are + * implicitly disabled as well. + */ +void wlr_scene_node_set_enabled(struct wlr_scene_node *node, bool enabled); /** * Set the position of the node relative to its parent. */ -- cgit v1.2.3