aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsinanmohd <sinan@firemail.cc>2023-09-24 07:19:44 +0530
committersinanmohd <sinan@firemail.cc>2023-09-24 07:23:44 +0530
commitaca27552a066167a54b082be48dcfdd38ebf8fec (patch)
tree56055793385cb0d1292c5d2f6c996508d138fa9a
parente69ba779e5cf3bae853207bb14589cd5cc4f6634 (diff)
swallow: fixHEADmaster
-rw-r--r--dwl.c10
1 files 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;