aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2021-05-22 14:22:37 -0500
committerDevin J. Pohly <djpohly@gmail.com>2021-05-22 14:24:18 -0500
commit93a58abf2955aa01b7c148b85490d443ab017fb7 (patch)
tree89201b80c8ee6b2abb2ea93675ba06c8d8a4d462 /dwl.c
parent1b139a860dacbca8c4b3f8d24930b3f829534206 (diff)
Wait until map to set window's tiled state
Workaround for a bug in Chromium where it fails to attach a buffer to the surface. Fixes #119.
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/dwl.c b/dwl.c
index d7e798b..30a64f8 100644
--- a/dwl.c
+++ b/dwl.c
@@ -885,10 +885,6 @@ createnotify(struct wl_listener *listener, void *data)
c->surface.xdg = xdg_surface;
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->events.map, &c->map, mapnotify);
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.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 */
applyrules(c);
}