fix build with -DXWAYLAND

This commit is contained in:
Devin J. Pohly 2020-12-24 22:39:45 -05:00
parent 5ba09b56f3
commit efe2a97bcf

28
dwl.c
View file

@ -2540,13 +2540,13 @@ configurex11(struct wl_listener *listener, void *data)
void void
createnotifyx11(struct wl_listener *listener, void *data) createnotifyx11(struct wl_listener *listener, void *data)
{ {
struct wlr_xwayland_surface *xwayland_surface = data;
Client *c; Client *c;
wl_list_for_each(c, &clients, link) wl_list_for_each(c, &clients, link)
if (c->isfullscreen && VISIBLEON(c, c->mon)) if (c->isfullscreen && VISIBLEON(c, c->mon))
setfullscreen(c, 0); setfullscreen(c, 0);
/* Allocate a Client for this surface */ /* Allocate a Client for this surface */
struct wlr_xwayland_surface *xwayland_surface = data;
c = xwayland_surface->data = calloc(1, sizeof(*c)); c = xwayland_surface->data = calloc(1, sizeof(*c));
c->surface.xwayland = xwayland_surface; c->surface.xwayland = xwayland_surface;
c->type = xwayland_surface->override_redirect ? X11Unmanaged : X11Managed; c->type = xwayland_surface->override_redirect ? X11Unmanaged : X11Managed;
@ -2586,26 +2586,23 @@ void
renderindependents(struct wlr_output *output, struct timespec *now) renderindependents(struct wlr_output *output, struct timespec *now)
{ {
Client *c; Client *c;
struct render_data rdata;
struct wlr_box geom;
wl_list_for_each_reverse(c, &independents, link) { wl_list_for_each_reverse(c, &independents, link) {
struct wlr_box geom = { geom.x = c->surface.xwayland->x;
.x = c->surface.xwayland->x, geom.y = c->surface.xwayland->y;
.y = c->surface.xwayland->y, geom.width = c->surface.xwayland->width;
.width = c->surface.xwayland->width, geom.height = c->surface.xwayland->height;
.height = c->surface.xwayland->height,
};
/* Only render visible clients which show on this output */ /* Only render visible clients which show on this output */
if (!wlr_output_layout_intersects(output_layout, output, &geom)) if (!wlr_output_layout_intersects(output_layout, output, &geom))
continue; continue;
struct render_data rdata = { rdata.output = output;
.output = output, rdata.when = now;
.when = now, rdata.x = c->surface.xwayland->x;
.x = c->surface.xwayland->x, rdata.y = c->surface.xwayland->y;
.y = c->surface.xwayland->y,
};
wlr_surface_for_each_surface(c->surface.xwayland->surface, render, &rdata); wlr_surface_for_each_surface(c->surface.xwayland->surface, render, &rdata);
} }
} }
@ -2624,6 +2621,7 @@ updatewindowtype(Client *c)
void void
xwaylandready(struct wl_listener *listener, void *data) xwaylandready(struct wl_listener *listener, void *data)
{ {
struct wlr_xcursor *xcursor;
xcb_connection_t *xc = xcb_connect(xwayland->display_name, NULL); xcb_connection_t *xc = xcb_connect(xwayland->display_name, NULL);
int err = xcb_connection_has_error(xc); int err = xcb_connection_has_error(xc);
if (err) { if (err) {
@ -2642,7 +2640,7 @@ xwaylandready(struct wl_listener *listener, void *data)
wlr_xwayland_set_seat(xwayland, seat); wlr_xwayland_set_seat(xwayland, seat);
/* Set the default XWayland cursor to match the rest of dwl. */ /* Set the default XWayland cursor to match the rest of dwl. */
struct wlr_xcursor *xcursor = wlr_xcursor_manager_get_xcursor(cursor_mgr, "left_ptr", 1); xcursor = wlr_xcursor_manager_get_xcursor(cursor_mgr, "left_ptr", 1);
wlr_xwayland_set_cursor(xwayland, wlr_xwayland_set_cursor(xwayland,
xcursor->images[0]->buffer, xcursor->images[0]->width * 4, xcursor->images[0]->buffer, xcursor->images[0]->width * 4,
xcursor->images[0]->width, xcursor->images[0]->height, xcursor->images[0]->width, xcursor->images[0]->height,