struct weston_shell_interface {
void *shell; /* either desktop or tablet */
- void (*create_shell_surface)(void *shell,
- struct weston_surface *surface,
- struct shell_surface **ret);
+ struct shell_surface *(*create_shell_surface)(void *shell,
+ struct weston_surface *surface);
+
void (*set_toplevel)(struct shell_surface *shsurf);
void (*set_transient)(struct shell_surface *shsurf,
static void
shell_surface_configure(struct weston_surface *, int32_t, int32_t);
-static void
-create_shell_surface(void *shell, struct weston_surface *surface,
- struct shell_surface **ret)
+static struct shell_surface *
+create_shell_surface(void *shell, struct weston_surface *surface)
{
struct shell_surface *shsurf;
if (surface->configure) {
fprintf(stderr, "surface->configure already set\n");
- return;
+ return NULL;
}
shsurf = calloc(1, sizeof *shsurf);
if (!shsurf) {
fprintf(stderr, "no memory to allocate shell surface\n");
- return;
+ return NULL;
}
surface->configure = shell_surface_configure;
shsurf->type = SHELL_SURFACE_NONE;
shsurf->next_type = SHELL_SURFACE_NONE;
- *ret = shsurf;
+ return shsurf;
}
static void
return;
}
- create_shell_surface(shell, surface, &shsurf);
+ shsurf = create_shell_surface(shell, surface);
if (!shsurf) {
wl_resource_post_error(surface_resource,
WL_DISPLAY_ERROR_INVALID_OBJECT,
if (!shell_interface->create_shell_surface)
return;
- shell_interface->create_shell_surface(shell_interface->shell,
- window->surface, &window->shsurf);
+ window->shsurf =
+ shell_interface->create_shell_surface(shell_interface->shell,
+ window->surface);
if (!window->transient_for) {
shell_interface->set_toplevel(window->shsurf);