From aca27552a066167a54b082be48dcfdd38ebf8fec Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Sun, 24 Sep 2023 07:19:44 +0530 Subject: swallow: fix --- dwl.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dwl.c b/dwl.c index 8378051..c844f6b 100644 --- a/dwl.c +++ b/dwl.c @@ -100,7 +100,7 @@ struct Client { /* Must keep these three elements in this order */ unsigned int type; /* XDGShell or X11* */ struct wlr_box geom; /* layout-relative, includes border */ - Monitor *mon; + Monitor *mon, *newmon; struct wlr_scene_tree *scene; struct wlr_scene_rect *border[4]; /* top, bottom, left, right */ struct wlr_scene_tree *scene_surface; @@ -483,7 +483,7 @@ applyrules(Client *c) mon = m; } } - c->mon = mon; + c->newmon = mon; c->tags = newtags; } @@ -1663,6 +1663,7 @@ mapnotify(struct wl_listener *listener, void *data) * try to apply rules for them */ /* TODO: https://github.com/djpohly/dwl/pull/334#issuecomment-1330166324 */ if (c->type == XDGShell && (p = client_get_parent(c))) { + c->newmon = NULL; c->isfloating = 1; wlr_scene_node_reparent(&c->scene->node, layers[LyrFloat]); } else { @@ -1683,7 +1684,7 @@ mapnotify(struct wl_listener *listener, void *data) } } - setmon(c, c->mon, c->tags); + setmon(c, c->newmon ? c->newmon : c->mon, c->tags); printstatus(); unset_fullscreen: @@ -2185,6 +2186,9 @@ setmon(Client *c, Monitor *m, uint32_t newtags) { Monitor *oldmon = c->mon; + if (oldmon == m) + return; + c->mon = m; c->prev = c->geom; -- cgit v1.2.3