call setmon() in mapnotify()

with this change cannot assign tags at open a window
This commit is contained in:
Sevz17 2021-06-16 09:24:14 -05:00
parent 144331e3b3
commit 1652d0a5d5

10
dwl.c
View File

@ -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);