aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2020-04-26 22:18:39 -0500
committerDevin J. Pohly <djpohly@gmail.com>2020-04-26 22:18:39 -0500
commit40d0d0f829827793c5360c4e857777df2d84f32c (patch)
tree10219d6759601a0277f65c0389c4529b65858e1d /dwl.c
parent34d5045d8440876b4c639c1edd1cc76dd051118c (diff)
wait to get window geometry until map time
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/dwl.c b/dwl.c
index 981c7e4..f762b1d 100644
--- a/dwl.c
+++ b/dwl.c
@@ -403,9 +403,6 @@ createnotify(struct wl_listener *listener, void *data)
Client *c = xdg_surface->data = calloc(1, sizeof(*c));
c->xdg_surface = xdg_surface;
c->bw = borderpx;
- wlr_xdg_surface_get_geometry(c->xdg_surface, &c->geom);
- 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->xdg_surface, true);
@@ -658,6 +655,9 @@ maprequest(struct wl_listener *listener, void *data)
/* Called when the surface is mapped, or ready to display on-screen. */
Client *c = wl_container_of(listener, c, map);
/* XXX Apply client rules here */
+ wlr_xdg_surface_get_geometry(c->xdg_surface, &c->geom);
+ c->geom.width += 2 * c->bw;
+ c->geom.height += 2 * c->bw;
/* Insert this client into the list and put it on selmon. */
wl_list_insert(&clients, &c->link);
wl_list_insert(&fstack, &c->flink);