}
static struct wayland_output *
-wayland_output_create_common(const char *name)
+wayland_output_create_common(struct weston_compositor *compositor,
+ const char *name)
{
struct wayland_output *output;
char *title;
}
output->title = title;
+ weston_output_init(&output->base, compositor, name);
+
output->base.destroy = wayland_output_destroy;
output->base.disable = wayland_output_disable;
output->base.enable = wayland_output_enable;
static int
wayland_output_create(struct weston_compositor *compositor, const char *name)
{
- struct wayland_output *output = wayland_output_create_common(name);
+ struct wayland_output *output;
+ output = wayland_output_create_common(compositor, name);
if (!output)
return -1;
- weston_output_init(&output->base, compositor, name);
weston_compositor_add_pending_output(&output->base, compositor);
return 0;
struct wayland_output *output;
struct weston_mode *mode;
- output = wayland_output_create_common("wlparent");
+ output = wayland_output_create_common(b->compositor, "wlparent");
if (!output)
return -1;
goto out;
}
- weston_output_init(&output->base, b->compositor, "wlparent");
-
output->base.scale = 1;
output->base.transform = WL_OUTPUT_TRANSFORM_NORMAL;
return 0;
out:
- free(output->base.name);
+ weston_output_destroy(&output->base);
free(output->title);
free(output);
struct wayland_output *output;
int width = 0, height = 0;
- output = wayland_output_create_common("wayland-fullscreen");
+ output = wayland_output_create_common(b->compositor, "wayland-fullscreen");
if (!output)
return -1;
- weston_output_init(&output->base, b->compositor, "wayland-fullscreen");
-
output->base.scale = 1;
output->base.transform = WL_OUTPUT_TRANSFORM_NORMAL;
err_set_size:
wayland_backend_destroy_output_surface(output);
err_surface:
- free(output->base.name);
+ weston_output_destroy(&output->base);
free(output->title);
free(output);