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.
UIYTPZUOBD2IGO3Q5FFLSFN5L2SMUTG24X54QBOHDYLJCHJF2EAQC
T6RRXRQT6K4T63MKNIDLTNASZCAE3SWWMJU5BXKSHWFY2YY3VBSAC
EQRGODLKSVSPFSUZU7BV5ER72U4QS4ATSBKV544XXQVKKTOSC7EAC
7B74AT3BXYB7PVW4F6SGQNPMHOU5TEV5TZ54CG6VSQI46XSEKWXQC
67APSPRSCPBI4WKD4UPPH66TPHHPPZLT3FZJP262VMIG3HAGMSUQC
NMDOPTG3IB6YYKU276EY6CHKGRVUJM62FOEOEMN6VPJ4TYHZHP2AC
2GP4MXKEDQMZ7E6TCRSMV2AGN7HLEAHR3QEAC2QFCQQNPMNJSIHQC
5NXELRTS2KF2SZJRXZBJNNDXZG23OSWVUVCIQSPV7TH7T3XKL4PAC
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;
}