Merge pull request #120 from djpohly/set-tiled-on-map

Wait until map to set window's tiled state
This commit is contained in:
Devin J. Pohly 2021-05-23 00:28:49 -05:00 committed by GitHub
commit ce9f264919
Failed to generate hash of commit

8
dwl.c
View file

@ -885,10 +885,6 @@ createnotify(struct wl_listener *listener, void *data)
c->surface.xdg = xdg_surface; c->surface.xdg = xdg_surface;
c->bw = borderpx; c->bw = borderpx;
/* Tell the client not to try anything fancy */
wlr_xdg_toplevel_set_tiled(c->surface.xdg, WLR_EDGE_TOP |
WLR_EDGE_BOTTOM | WLR_EDGE_LEFT | WLR_EDGE_RIGHT);
LISTEN(&xdg_surface->surface->events.commit, &c->commit, commitnotify); LISTEN(&xdg_surface->surface->events.commit, &c->commit, commitnotify);
LISTEN(&xdg_surface->events.map, &c->map, mapnotify); LISTEN(&xdg_surface->events.map, &c->map, mapnotify);
LISTEN(&xdg_surface->events.unmap, &c->unmap, unmapnotify); LISTEN(&xdg_surface->events.unmap, &c->unmap, unmapnotify);
@ -1308,6 +1304,10 @@ mapnotify(struct wl_listener *listener, void *data)
c->geom.width += 2 * c->bw; c->geom.width += 2 * c->bw;
c->geom.height += 2 * c->bw; c->geom.height += 2 * c->bw;
/* Tell the client not to try anything fancy */
wlr_xdg_toplevel_set_tiled(c->surface.xdg, WLR_EDGE_TOP |
WLR_EDGE_BOTTOM | WLR_EDGE_LEFT | WLR_EDGE_RIGHT);
/* Set initial monitor, tags, floating status, and focus */ /* Set initial monitor, tags, floating status, and focus */
applyrules(c); applyrules(c);
} }