aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsinanmohd <sinan@firemail.cc>2023-09-23 11:22:54 +0000
committersinanmohd <sinan@firemail.cc>2023-09-23 19:13:58 +0530
commite69ba779e5cf3bae853207bb14589cd5cc4f6634 (patch)
tree00c8af2611ddba9ab2a2e2ab496d869acfcdb777
parent4606e06d2966743cc9b50d87ccafdbfe8e20fd16 (diff)
swallow: more fixes releated to opening window on "unampped tag"
-rw-r--r--dwl.c17
1 files changed, 8 insertions, 9 deletions
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);
}