diff options
-rw-r--r-- | dwl.c | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -483,8 +483,8 @@ applyrules(Client *c) mon = m; } } - wlr_scene_node_reparent(&c->scene->node, layers[c->isfloating ? LyrFloat : LyrTile]); - setmon(c, mon, newtags); + c->mon = mon; + c->tags = newtags; } void @@ -1665,11 +1665,10 @@ mapnotify(struct wl_listener *listener, void *data) if (c->type == XDGShell && (p = client_get_parent(c))) { c->isfloating = 1; wlr_scene_node_reparent(&c->scene->node, layers[LyrFloat]); - setmon(c, p->mon, p->tags); } else { applyrules(c); + wlr_scene_node_reparent(&c->scene->node, layers[c->isfloating ? LyrFloat : LyrTile]); } - printstatus(); if (!c->noswallow && !client_is_float_type(c)) { p = termforwin(c); @@ -1681,11 +1680,12 @@ mapnotify(struct wl_listener *listener, void *data) swallow(c,p); wl_list_remove(&p->link); wl_list_remove(&p->flink); - if (c->isfullscreen) - setfullscreen(c, c->isfullscreen); } } + setmon(c, c->mon, c->tags); + printstatus(); + unset_fullscreen: m = c->mon ? c->mon : xytomon(c->geom.x, c->geom.y); wl_list_for_each(w, &clients, link) @@ -2185,8 +2185,6 @@ setmon(Client *c, Monitor *m, uint32_t newtags) { Monitor *oldmon = c->mon; - if (oldmon == m) - return; c->mon = m; c->prev = c->geom; @@ -2197,11 +2195,12 @@ setmon(Client *c, Monitor *m, uint32_t newtags) /* Make sure window actually overlaps with the monitor */ resize(c, c->geom, 0); c->tags = newtags ? newtags : m->tagset[m->seltags]; /* assign tags of target monitor */ - setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */ setfloating(c, c->isfloating); } if (c->swallowedby) setmon(c->swallowedby, m, newtags); + if (m) + setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */ focusclient(focustop(selmon), 1); } |