aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-07-19 20:13:56 -0500
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-07-19 20:13:56 -0500
commit90a12c90a0aa0ac16327b0816de4d9dff69b357e (patch)
tree475cc52b6ce103f1ab04d9122dc73c65e47df9b7 /dwl.c
parente0822926068e84b0fc391e0306f66ea0ec16cf47 (diff)
always set the same monitor and tags for child clients of a client
fixes #272
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/dwl.c b/dwl.c
index 65d7e24..727e6e1 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1388,7 +1388,7 @@ void
mapnotify(struct wl_listener *listener, void *data)
{
/* Called when the surface is mapped, or ready to display on-screen. */
- Client *c = wl_container_of(listener, c, map);
+ Client *p, *c = wl_container_of(listener, c, map);
int i;
/* Create scene tree for this client and its border */
@@ -1432,7 +1432,14 @@ mapnotify(struct wl_listener *listener, void *data)
wl_list_insert(&fstack, &c->flink);
/* Set initial monitor, tags, floating status, and focus */
- applyrules(c);
+ if ((p = client_get_parent(c))) {
+ /* Set the same monitor and tags than its parent */
+ c->isfloating = 1;
+ wlr_scene_node_reparent(c->scene, layers[LyrFloat]);
+ setmon(c, p->mon, p->tags);
+ } else {
+ applyrules(c);
+ }
printstatus();
if (c->isfullscreen)