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U3NCZWMNYQC
ZPSXARCBIT2LZ4PLNMKXHIEEWG3XLVXXISIZDYNGFACDI5I256NQC
c->map.notify = maprequest;
if (!xwayland_surface->override_redirect) {
c->activate.notify = activate;
wl_signal_add(&xwayland_surface->events.request_activate, &c->activate);
}
c->map.notify = xwayland_surface->override_redirect ? maprequestindependent : maprequest;
* If the focused toplevel has changed, deactivate the old one and
* activate the new one. This lets the clients know to repaint
* If the focused toplevel has changed, deactivate the old one. Always
* activate the current one. This lets the clients know to repaint
maprequestindependent(struct wl_listener *listener, void *data)
{
/* Called when the surface is mapped, or ready to display on-screen. */
Client *c = wl_container_of(listener, c, map);
/* Insert this independent into independents lists. */
wl_list_insert(&independents, &c->link);
}
void
renderindependents(struct wlr_output *output, struct timespec *now)
{
Client *c;
struct render_data rdata;
struct wlr_box geom;
wl_list_for_each_reverse(c, &independents, link)
{
geom.x = c->xwayland_surface->x;
geom.y = c->xwayland_surface->y;
geom.width = c->xwayland_surface->width;
geom.height = c->xwayland_surface->height;
/* Only render visible clients which show on this output */
if (!wlr_output_layout_intersects(output_layout, output, &geom))
continue;
rdata.output = output,
rdata.when = now,
rdata.x = c->xwayland_surface->x;
rdata.y = c->xwayland_surface->y;
wlr_surface_for_each_surface(c->xwayland_surface->surface, render, &rdata);
}
}
void
unmapnotifyindependent(struct wl_listener *listener, void *data)
{
/* Called when the surface is unmapped, and should no longer be shown. */
Client *c = wl_container_of(listener, c, unmap);
wl_list_remove(&c->link);
}
void
updatewindowtype(Client *c)
{
size_t i;
if (c->isx11)
for (i = 0; i < c->xwayland_surface->window_type_len; i++)
if (c->xwayland_surface->window_type[i] == netatom[NetWMWindowTypeDialog] ||
c->xwayland_surface->window_type[i] == netatom[NetWMWindowTypeSplash] ||
c->xwayland_surface->window_type[i] == netatom[NetWMWindowTypeToolbar] ||
c->xwayland_surface->window_type[i] == netatom[NetWMWindowTypeUtility])
c->isfloating = 1;
}
void
xwaylandready(struct wl_listener *listener, void *data) {
xcb_connection_t *xc = xcb_connect(xwayland->display_name, NULL);
int err = xcb_connection_has_error(xc);
if (err) {
fprintf(stderr, "xcb_connect to X server failed with code %d\n. Continuing with degraded functionality.\n", err);
return;
}
/* collect atoms we are interested in */
netatom[NetWMWindowTypeDialog] = getatom(xc, "_NET_WM_WINDOW_TYPE_DIALOG");
netatom[NetWMWindowTypeSplash] = getatom(xc, "_NET_WM_WINDOW_TYPE_SPLASH");
netatom[NetWMWindowTypeUtility] = getatom(xc, "_NET_WM_WINDOW_TYPE_TOOLBAR");
netatom[NetWMWindowTypeToolbar] = getatom(xc, "_NET_WM_WINDOW_TYPE_UTILITY");
/* assign the one and only seat */
wlr_xwayland_set_seat(xwayland, seat);
xcb_disconnect(xc);
}
void