aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-05-24 14:37:55 -0500
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-05-25 17:12:44 -0500
commit52e0d00942584b4a8a9ca1f59ffdea26277604ed (patch)
tree6457b32482e04554d4bacc27ba45d3040fc1aa31
parent7018b9b65c35ece131823069d887c0a6386c8e08 (diff)
check client_surface() returning NULL
now client_surface()->data is a pointer to the wlr_scene_tree of clients which allows us to not call wlr_scene_node_lower_to_bottom() for every clients
-rw-r--r--dwl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/dwl.c b/dwl.c
index 7de82f9..d0f5afc 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1376,10 +1376,12 @@ mapnotify(struct wl_listener *listener, void *data)
/* Create scene tree for this client and its border */
c->scene = &wlr_scene_tree_create(layers[LyrTile])->node;
- c->scene_surface = client_surface(c)->data = c->type == XDGShell
+ c->scene_surface = c->type == XDGShell
? wlr_scene_xdg_surface_create(c->scene, c->surface.xdg)
: wlr_scene_subsurface_tree_create(c->scene, client_surface(c));
- c->scene_surface->data = c;
+ if (client_surface(c))
+ client_surface(c)->data = c->scene;
+ c->scene->data = c->scene_surface->data = c;
if (client_is_unmanaged(c)) {
client_get_geometry(c, &c->geom);
@@ -1394,7 +1396,6 @@ mapnotify(struct wl_listener *listener, void *data)
c->border[i] = wlr_scene_rect_create(c->scene, 0, 0, bordercolor);
c->border[i]->node.data = c;
wlr_scene_rect_set_color(c->border[i], bordercolor);
- wlr_scene_node_lower_to_bottom(&c->border[i]->node);
}
/* Initialize client geometry with room for border */