From 1652d0a5d506ad9500f7912bddca636684d18f00 Mon Sep 17 00:00:00 2001 From: Sevz17 Date: Wed, 16 Jun 2021 09:24:14 -0500 Subject: [PATCH] call `setmon()` in `mapnotify()` with this change cannot assign tags at open a window --- dwl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dwl.c b/dwl.c index 1180587..97fee38 100644 --- a/dwl.c +++ b/dwl.c @@ -888,6 +888,9 @@ createnotify(struct wl_listener *listener, void *data) c->surface.xdg = xdg_surface; c->bw = borderpx; + /* set monitor, then it will be overwritten by applyrules */ + setmon(c,selmon, 0); + LISTEN(&xdg_surface->surface->events.commit, &c->commit, commitnotify); LISTEN(&xdg_surface->events.map, &c->map, mapnotify); LISTEN(&xdg_surface->events.unmap, &c->unmap, unmapnotify); @@ -1315,6 +1318,10 @@ mapnotify(struct wl_listener *listener, void *data) /* Set initial monitor, tags, floating status, and focus */ applyrules(c); + + arrange(c->mon); + if (VISIBLEON(c, c->mon)) + focusclient(c, 1); } void @@ -2454,6 +2461,9 @@ createnotifyx11(struct wl_listener *listener, void *data) c->bw = borderpx; c->isfullscreen = 0; + /* set monitor, then it will be overwritten by applyrules */ + setmon(c,selmon, 0); + /* Listen to the various events it can emit */ LISTEN(&xwayland_surface->events.map, &c->map, mapnotify); LISTEN(&xwayland_surface->events.unmap, &c->unmap, unmapnotify);