~ruther/dwl

17c5cbbf7b6c3a5373f46e6fb6e88daada325479 — Guido Cella 1 year, 2 months ago 45e3694
make XWayland clients inherit tags and monitors

Revert 3213088 because the linked bug can no longer be reproduced with
wlroots 0.17, and update client_get_parent() so it doesn't segfault with
XWayland surfaces. This also allows reusing the p variable in the next
commit.
2 files changed, 6 insertions(+), 4 deletions(-)

M client.h
M dwl.c
M client.h => client.h +5 -2
@@ 172,8 172,11 @@ client_get_parent(Client *c)
{
	Client *p = NULL;
#ifdef XWAYLAND
	if (client_is_x11(c) && c->surface.xwayland->parent)
		toplevel_from_wlr_surface(c->surface.xwayland->parent->surface, &p, NULL);
    if (client_is_x11(c)) {
        if (c->surface.xwayland->parent)
            toplevel_from_wlr_surface(c->surface.xwayland->parent->surface, &p, NULL);
        return p;
    }
#endif
	if (c->surface.xdg->toplevel->parent)
		toplevel_from_wlr_surface(c->surface.xdg->toplevel->parent->base->surface, &p, NULL);

M dwl.c => dwl.c +1 -2
@@ 1542,8 1542,7 @@ mapnotify(struct wl_listener *listener, void *data)
	 * we always consider floating, clients that have parent and thus
	 * we set the same tags and monitor than its parent, if not
	 * try to apply rules for them */
	/* TODO: https://github.com/djpohly/dwl/pull/334#issuecomment-1330166324 */
	if (c->type == XDGShell && (p = client_get_parent(c))) {
	if ((p = client_get_parent(c))) {
		c->isfloating = 1;
		setmon(c, p->mon, p->tags);
	} else {

Do not follow this link