From e69ba779e5cf3bae853207bb14589cd5cc4f6634 Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Sat, 23 Sep 2023 11:22:54 +0000 Subject: swallow: more fixes releated to opening window on "unampped tag" --- dwl.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'dwl.c') diff --git a/dwl.c b/dwl.c index f17726a..8378051 100644 --- a/dwl.c +++ b/dwl.c @@ -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); } -- cgit v1.2.3