destroy and create

This commit is contained in:
Leonardo Hernández Hernández 2023-08-31 23:42:42 -06:00
parent 7180724502
commit ba1214ef9a
No known key found for this signature in database
GPG key ID: E538897EE11B9624

24
dwl.c
View file

@ -2824,17 +2824,19 @@ void
setoverrideredirect(struct wl_listener *listener, void *data) setoverrideredirect(struct wl_listener *listener, void *data)
{ {
Client *c = wl_container_of(listener, c, override_redirect); Client *c = wl_container_of(listener, c, override_redirect);
int type = c->surface.xwayland->override_redirect ? X11Unmanaged : X11Managed; struct wlr_xwayland_surface *xsurface = c->surface.xwayland;
if (!client_surface(c) || !client_surface(c)->mapped) { int mapped = xsurface->surface && xsurface->surface->mapped;
c->type = type;
return; if (mapped)
} unmapnotify(&c->unmap, NULL);
/* We already check that this client is mapped */
if (type != c->type) { destroynotify(&c->destroy, NULL);
wl_signal_emit_mutable(&client_surface(c)->events.unmap, NULL); xsurface->data = NULL;
c->type = type; createnotifyx11(NULL, xsurface);
wl_signal_emit_mutable(&client_surface(c)->events.map, NULL); c = xsurface->data;
}
if (mapped)
mapnotify(&c->map, xsurface);
} }
void void