void xwayland_unmanaged_create(struct server *server,
struct wlr_xwayland_surface *xsurface, bool mapped);
-struct xwayland_view *xwayland_view_create(struct server *server,
- struct wlr_xwayland_surface *xsurface);
+void xwayland_view_create(struct server *server,
+ struct wlr_xwayland_surface *xsurface, bool mapped);
struct wlr_xwayland_surface *xwayland_surface_from_view(struct view *view);
unmanaged_handle_destroy(&unmanaged->destroy, NULL);
xsurface->data = NULL;
- struct xwayland_view *xwayland_view = xwayland_view_create(server, xsurface);
- if (mapped) {
- struct view *view = &xwayland_view->base;
- if (view->impl->map) {
- view->impl->map(view);
- }
- }
+ xwayland_view_create(server, xsurface, mapped);
}
static void
.move_to_back = xwayland_view_move_to_back,
};
-struct xwayland_view *
-xwayland_view_create(struct server *server, struct wlr_xwayland_surface *xsurface)
+void
+xwayland_view_create(struct server *server,
+ struct wlr_xwayland_surface *xsurface, bool mapped)
{
struct xwayland_view *xwayland_view = znew(*xwayland_view);
struct view *view = &xwayland_view->base;
wl_signal_add(&xsurface->events.set_override_redirect, &xwayland_view->override_redirect);
wl_list_insert(&view->server->views, &view->link);
- return xwayland_view;
+
+ if (mapped) {
+ xwayland_view_map(view);
+ }
}
static void
*/
if (xsurface->override_redirect) {
xwayland_unmanaged_create(server, xsurface, /* mapped */ false);
- return;
+ } else {
+ xwayland_view_create(server, xsurface, /* mapped */ false);
}
- xwayland_view_create(server, xsurface);
}
static void