From 254f799fde51faf71ce3ec5e7af75826f4263d81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Fri, 18 Mar 2022 01:02:50 -0600 Subject: [PATCH] do not create borders for unmanaged clients --- dwl.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dwl.c b/dwl.c index 392cec1..8f6e816 100644 --- a/dwl.c +++ b/dwl.c @@ -1323,17 +1323,11 @@ mapnotify(struct wl_listener *listener, void *data) ? 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; - for (i = 0; i < 4; i++) { - 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); - } if (client_is_unmanaged(c)) { client_get_geometry(c, &c->geom); - /* Floating, no border */ + /* Floating */ wlr_scene_node_reparent(c->scene, layers[LyrFloat]); - c->bw = 0; wlr_scene_node_set_position(c->scene, c->geom.x + borderpx, c->geom.y + borderpx); @@ -1342,6 +1336,13 @@ mapnotify(struct wl_listener *listener, void *data) return; } + for (i = 0; i < 4; i++) { + 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 */ client_set_tiled(c, WLR_EDGE_TOP | WLR_EDGE_BOTTOM | WLR_EDGE_LEFT | WLR_EDGE_RIGHT); client_get_geometry(c, &c->geom);