Add node-descriptor for wlr_scene_nodes

Support identification of wlr_scene_node role to enable simplification
of codebase including the avoidance of iterating over lists of
layer-surface, menuitems, and so on.

Use node-descriptors for xdg toplevels and popups
This commit is contained in:
Johan Malm 2022-02-25 22:31:24 +00:00
parent 4c981b845f
commit 2891ff245e
7 changed files with 92 additions and 6 deletions

View file

@ -8,6 +8,7 @@
*/
#include "labwc.h"
#include "node-descriptor.h"
struct view_child {
struct wlr_surface *surface;
@ -93,6 +94,8 @@ xdg_popup_create(struct view *view, struct wlr_xdg_popup *wlr_popup)
struct wlr_scene_node *parent_node = parent->surface->data;
wlr_popup->base->surface->data =
wlr_scene_xdg_surface_create(parent_node, wlr_popup->base);
node_descriptor_create(wlr_popup->base->surface->data,
LAB_NODE_DESC_XDG_POPUP, view);
popup_unconstrain(view, wlr_popup);
}