don't send configure events to uninitialized xdg-toplevels

This commit is contained in:
Leonardo Hernández Hernández 2024-01-05 11:12:34 -06:00
parent c222468887
commit 668022bc90
No known key found for this signature in database
GPG key ID: E538897EE11B9624

3
dwl.c
View file

@ -1578,7 +1578,8 @@ maximizenotify(struct wl_listener *listener, void *data)
* protocol version * protocol version
* wlr_xdg_surface_schedule_configure() is used to send an empty reply. */ * wlr_xdg_surface_schedule_configure() is used to send an empty reply. */
Client *c = wl_container_of(listener, c, maximize); Client *c = wl_container_of(listener, c, maximize);
if (wl_resource_get_version(c->surface.xdg->toplevel->resource) if (c->surface.xdg->initialized
&& wl_resource_get_version(c->surface.xdg->toplevel->resource)
< XDG_TOPLEVEL_WM_CAPABILITIES_SINCE_VERSION) < XDG_TOPLEVEL_WM_CAPABILITIES_SINCE_VERSION)
wlr_xdg_surface_schedule_configure(c->surface.xdg); wlr_xdg_surface_schedule_configure(c->surface.xdg);
} }