2017-06-20 16:27:05 +00:00
|
|
|
#include <assert.h>
|
2017-06-19 20:36:40 +00:00
|
|
|
#include <stdint.h>
|
2018-02-12 20:29:23 +00:00
|
|
|
#include <stdio.h>
|
2017-06-19 20:36:40 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2017-08-14 16:19:42 +00:00
|
|
|
#include <sys/mman.h>
|
2018-02-12 20:29:23 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <unistd.h>
|
2017-06-19 20:36:40 +00:00
|
|
|
#include <wayland-client.h>
|
2017-06-21 14:27:45 +00:00
|
|
|
#include <wlr/interfaces/wlr_output.h>
|
2018-03-20 22:10:42 +00:00
|
|
|
#include <wlr/render/wlr_renderer.h>
|
2018-05-01 20:38:04 +00:00
|
|
|
#include <wlr/types/wlr_matrix.h>
|
2017-06-21 16:10:07 +00:00
|
|
|
#include <wlr/util/log.h>
|
2017-06-19 20:36:40 +00:00
|
|
|
#include "backend/wayland.h"
|
2018-02-12 20:29:23 +00:00
|
|
|
#include "util/signal.h"
|
2017-08-16 17:19:31 +00:00
|
|
|
#include "xdg-shell-unstable-v6-client-protocol.h"
|
2017-06-19 20:36:40 +00:00
|
|
|
|
2017-08-14 16:19:42 +00:00
|
|
|
int os_create_anonymous_file(off_t size);
|
|
|
|
|
2017-06-20 16:27:05 +00:00
|
|
|
static struct wl_callback_listener frame_listener;
|
|
|
|
|
2018-01-26 21:39:23 +00:00
|
|
|
static void surface_frame_callback(void *data, struct wl_callback *cb,
|
|
|
|
uint32_t time) {
|
2018-04-29 11:16:31 +00:00
|
|
|
struct wlr_wl_output *output = data;
|
2018-01-26 21:39:23 +00:00
|
|
|
assert(output);
|
2017-06-26 15:34:22 +00:00
|
|
|
wl_callback_destroy(cb);
|
2018-01-18 12:06:57 +00:00
|
|
|
output->frame_callback = NULL;
|
2018-01-30 13:45:02 +00:00
|
|
|
|
|
|
|
wlr_output_send_frame(&output->wlr_output);
|
2017-06-26 15:34:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static struct wl_callback_listener frame_listener = {
|
|
|
|
.done = surface_frame_callback
|
|
|
|
};
|
|
|
|
|
2018-04-25 22:51:00 +00:00
|
|
|
static bool output_set_custom_mode(struct wlr_output *_output,
|
2017-12-11 11:14:23 +00:00
|
|
|
int32_t width, int32_t height, int32_t refresh) {
|
2018-04-29 11:16:31 +00:00
|
|
|
struct wlr_wl_output *output = (struct wlr_wl_output *)_output;
|
2017-12-11 11:14:23 +00:00
|
|
|
wl_egl_window_resize(output->egl_window, width, height, 0, 0);
|
2017-12-17 17:02:55 +00:00
|
|
|
wlr_output_update_custom_mode(&output->wlr_output, width, height, 0);
|
2017-12-11 11:14:23 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-04-25 22:51:00 +00:00
|
|
|
static bool output_make_current(struct wlr_output *wlr_output,
|
2018-01-20 23:06:35 +00:00
|
|
|
int *buffer_age) {
|
2018-04-29 11:16:31 +00:00
|
|
|
struct wlr_wl_output *output =
|
|
|
|
(struct wlr_wl_output *)wlr_output;
|
2018-01-20 23:06:35 +00:00
|
|
|
return wlr_egl_make_current(&output->backend->egl, output->egl_surface,
|
|
|
|
buffer_age);
|
2017-06-26 15:34:22 +00:00
|
|
|
}
|
2017-06-20 16:27:05 +00:00
|
|
|
|
2018-04-25 22:51:00 +00:00
|
|
|
static bool output_swap_buffers(struct wlr_output *wlr_output,
|
2018-02-09 21:54:14 +00:00
|
|
|
pixman_region32_t *damage) {
|
2018-04-29 11:16:31 +00:00
|
|
|
struct wlr_wl_output *output =
|
|
|
|
(struct wlr_wl_output *)wlr_output;
|
2018-01-20 23:06:35 +00:00
|
|
|
|
2018-01-30 13:45:02 +00:00
|
|
|
if (output->frame_callback != NULL) {
|
|
|
|
wlr_log(L_ERROR, "Skipping buffer swap");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-06-20 16:27:05 +00:00
|
|
|
output->frame_callback = wl_surface_frame(output->surface);
|
|
|
|
wl_callback_add_listener(output->frame_callback, &frame_listener, output);
|
2018-01-20 23:06:35 +00:00
|
|
|
|
2018-02-09 21:54:14 +00:00
|
|
|
return wlr_egl_swap_buffers(&output->backend->egl, output->egl_surface,
|
|
|
|
damage);
|
2017-06-20 16:27:05 +00:00
|
|
|
}
|
|
|
|
|
2018-04-25 22:51:00 +00:00
|
|
|
static void output_transform(struct wlr_output *_output,
|
2017-06-19 20:36:40 +00:00
|
|
|
enum wl_output_transform transform) {
|
2018-04-29 11:16:31 +00:00
|
|
|
struct wlr_wl_output *output = (struct wlr_wl_output *)_output;
|
2017-08-13 14:51:50 +00:00
|
|
|
output->wlr_output.transform = transform;
|
2017-06-19 20:36:40 +00:00
|
|
|
}
|
|
|
|
|
2018-05-09 18:58:18 +00:00
|
|
|
static bool output_set_cursor(struct wlr_output *wlr_output,
|
|
|
|
struct wlr_texture *texture, int32_t scale,
|
|
|
|
enum wl_output_transform transform, int32_t hotspot_x, int32_t hotspot_y,
|
2018-05-01 20:38:04 +00:00
|
|
|
bool update_texture) {
|
2018-05-09 18:58:18 +00:00
|
|
|
struct wlr_wl_output *output = (struct wlr_wl_output *)wlr_output;
|
2017-08-14 16:19:42 +00:00
|
|
|
struct wlr_wl_backend *backend = output->backend;
|
2017-10-08 19:21:06 +00:00
|
|
|
|
2018-05-09 18:58:18 +00:00
|
|
|
struct wlr_box hotspot = { .x = hotspot_x, .y = hotspot_y };
|
|
|
|
wlr_box_transform(&hotspot, wlr_output_transform_invert(wlr_output->transform),
|
|
|
|
output->cursor.width, output->cursor.height, &hotspot);
|
|
|
|
|
2017-11-01 13:25:41 +00:00
|
|
|
// TODO: use output->wlr_output.transform to transform pixels and hotpot
|
2018-05-09 18:58:18 +00:00
|
|
|
output->cursor.hotspot_x = hotspot.x;
|
|
|
|
output->cursor.hotspot_y = hotspot.y;
|
2017-10-29 16:43:26 +00:00
|
|
|
|
2018-05-01 20:38:04 +00:00
|
|
|
if (!update_texture) {
|
2017-10-12 07:40:51 +00:00
|
|
|
// Update hotspot without changing cursor image
|
2018-04-25 22:24:58 +00:00
|
|
|
update_wl_output_cursor(output);
|
2017-10-12 07:40:51 +00:00
|
|
|
return true;
|
|
|
|
}
|
2017-10-08 19:21:06 +00:00
|
|
|
|
2018-05-01 20:38:04 +00:00
|
|
|
if (output->cursor.surface == NULL) {
|
2017-10-29 16:43:26 +00:00
|
|
|
output->cursor.surface =
|
2018-05-01 20:38:04 +00:00
|
|
|
wl_compositor_create_surface(backend->compositor);
|
2017-08-14 16:19:42 +00:00
|
|
|
}
|
2018-05-01 20:38:04 +00:00
|
|
|
struct wl_surface *surface = output->cursor.surface;
|
2017-08-14 16:19:42 +00:00
|
|
|
|
2018-05-01 20:38:04 +00:00
|
|
|
if (texture != NULL) {
|
|
|
|
int width, height;
|
|
|
|
wlr_texture_get_size(texture, &width, &height);
|
2018-05-09 18:58:18 +00:00
|
|
|
width = width * wlr_output->scale / scale;
|
|
|
|
height = height * wlr_output->scale / scale;
|
|
|
|
|
|
|
|
output->cursor.width = width;
|
|
|
|
output->cursor.height = height;
|
2017-08-14 16:19:42 +00:00
|
|
|
|
2018-05-01 20:38:04 +00:00
|
|
|
if (output->cursor.egl_window == NULL) {
|
|
|
|
output->cursor.egl_window =
|
|
|
|
wl_egl_window_create(surface, width, height);
|
2017-08-14 16:19:42 +00:00
|
|
|
}
|
2018-05-01 20:38:04 +00:00
|
|
|
wl_egl_window_resize(output->cursor.egl_window, width, height, 0, 0);
|
2017-08-14 16:19:42 +00:00
|
|
|
|
2018-05-01 20:38:04 +00:00
|
|
|
EGLSurface egl_surface =
|
|
|
|
wlr_egl_create_surface(&backend->egl, output->cursor.egl_window);
|
2017-08-14 16:19:42 +00:00
|
|
|
|
2018-05-01 20:38:04 +00:00
|
|
|
wlr_egl_make_current(&backend->egl, egl_surface, NULL);
|
2017-08-14 16:19:42 +00:00
|
|
|
|
2018-05-09 18:58:18 +00:00
|
|
|
struct wlr_box cursor_box = {
|
|
|
|
.width = width,
|
|
|
|
.height = height,
|
|
|
|
};
|
|
|
|
|
|
|
|
float projection[9];
|
|
|
|
wlr_matrix_projection(projection, width, height, wlr_output->transform);
|
|
|
|
|
2018-05-01 20:38:04 +00:00
|
|
|
float matrix[9];
|
2018-05-09 18:58:18 +00:00
|
|
|
wlr_matrix_project_box(matrix, &cursor_box, transform, 0, projection);
|
2018-05-01 20:38:04 +00:00
|
|
|
|
|
|
|
wlr_renderer_begin(backend->renderer, width, height);
|
|
|
|
wlr_renderer_clear(backend->renderer, (float[]){ 0.0, 0.0, 0.0, 0.0 });
|
2018-05-09 18:58:18 +00:00
|
|
|
wlr_render_texture_with_matrix(backend->renderer, texture, matrix, 1.0);
|
2018-05-01 20:38:04 +00:00
|
|
|
wlr_renderer_end(backend->renderer);
|
|
|
|
|
|
|
|
wlr_egl_swap_buffers(&backend->egl, egl_surface, NULL);
|
|
|
|
wlr_egl_destroy_surface(&backend->egl, egl_surface);
|
|
|
|
} else {
|
|
|
|
wl_surface_attach(surface, NULL, 0, 0);
|
|
|
|
wl_surface_commit(surface);
|
|
|
|
}
|
2017-08-14 16:19:42 +00:00
|
|
|
|
2018-04-25 22:24:58 +00:00
|
|
|
update_wl_output_cursor(output);
|
2017-08-14 16:19:42 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-04-25 22:51:00 +00:00
|
|
|
static void output_destroy(struct wlr_output *wlr_output) {
|
2018-04-29 11:16:31 +00:00
|
|
|
struct wlr_wl_output *output =
|
|
|
|
(struct wlr_wl_output *)wlr_output;
|
2018-01-30 18:45:57 +00:00
|
|
|
if (output == NULL) {
|
|
|
|
return;
|
|
|
|
}
|
2017-10-29 16:43:26 +00:00
|
|
|
|
2017-12-13 20:48:59 +00:00
|
|
|
wl_list_remove(&output->link);
|
|
|
|
|
2018-05-01 20:38:04 +00:00
|
|
|
if (output->cursor.egl_window != NULL) {
|
|
|
|
wl_egl_window_destroy(output->cursor.egl_window);
|
2017-08-14 16:19:42 +00:00
|
|
|
}
|
2017-10-29 16:43:26 +00:00
|
|
|
if (output->cursor.surface) {
|
|
|
|
wl_surface_destroy(output->cursor.surface);
|
2017-08-14 16:19:42 +00:00
|
|
|
}
|
|
|
|
|
2017-08-12 15:43:36 +00:00
|
|
|
if (output->frame_callback) {
|
|
|
|
wl_callback_destroy(output->frame_callback);
|
|
|
|
}
|
2017-12-13 20:48:59 +00:00
|
|
|
|
2018-04-24 22:44:43 +00:00
|
|
|
wlr_egl_destroy_surface(&output->backend->egl, output->egl_surface);
|
2017-06-20 17:01:20 +00:00
|
|
|
wl_egl_window_destroy(output->egl_window);
|
2017-08-16 17:33:16 +00:00
|
|
|
zxdg_toplevel_v6_destroy(output->xdg_toplevel);
|
|
|
|
zxdg_surface_v6_destroy(output->xdg_surface);
|
2017-06-19 20:36:40 +00:00
|
|
|
wl_surface_destroy(output->surface);
|
|
|
|
free(output);
|
|
|
|
}
|
|
|
|
|
2018-04-29 11:16:31 +00:00
|
|
|
void update_wl_output_cursor(struct wlr_wl_output *output) {
|
2017-10-29 16:43:26 +00:00
|
|
|
if (output->backend->pointer && output->enter_serial) {
|
|
|
|
wl_pointer_set_cursor(output->backend->pointer, output->enter_serial,
|
|
|
|
output->cursor.surface, output->cursor.hotspot_x,
|
|
|
|
output->cursor.hotspot_y);
|
2017-08-14 16:19:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-25 22:51:00 +00:00
|
|
|
bool output_move_cursor(struct wlr_output *_output, int x, int y) {
|
2017-08-14 16:19:42 +00:00
|
|
|
// TODO: only return true if x == current x and y == current y
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-04-25 22:51:00 +00:00
|
|
|
static const struct wlr_output_impl output_impl = {
|
|
|
|
.set_custom_mode = output_set_custom_mode,
|
|
|
|
.transform = output_transform,
|
|
|
|
.destroy = output_destroy,
|
|
|
|
.make_current = output_make_current,
|
|
|
|
.swap_buffers = output_swap_buffers,
|
|
|
|
.set_cursor = output_set_cursor,
|
|
|
|
.move_cursor = output_move_cursor,
|
2017-06-19 20:36:40 +00:00
|
|
|
};
|
|
|
|
|
2017-12-19 18:55:18 +00:00
|
|
|
bool wlr_output_is_wl(struct wlr_output *wlr_output) {
|
|
|
|
return wlr_output->impl == &output_impl;
|
|
|
|
}
|
|
|
|
|
2017-08-16 17:19:31 +00:00
|
|
|
static void xdg_surface_handle_configure(void *data, struct zxdg_surface_v6 *xdg_surface,
|
|
|
|
uint32_t serial) {
|
2018-04-29 11:16:31 +00:00
|
|
|
struct wlr_wl_output *output = data;
|
2017-08-16 17:19:31 +00:00
|
|
|
assert(output && output->xdg_surface == xdg_surface);
|
|
|
|
|
|
|
|
zxdg_surface_v6_ack_configure(xdg_surface, serial);
|
|
|
|
|
|
|
|
// nothing else?
|
2017-06-20 16:27:05 +00:00
|
|
|
}
|
|
|
|
|
2017-08-16 17:19:31 +00:00
|
|
|
static struct zxdg_surface_v6_listener xdg_surface_listener = {
|
|
|
|
.configure = xdg_surface_handle_configure,
|
|
|
|
};
|
|
|
|
|
|
|
|
static void xdg_toplevel_handle_configure(void *data, struct zxdg_toplevel_v6 *xdg_toplevel,
|
|
|
|
int32_t width, int32_t height, struct wl_array *states) {
|
2018-04-29 11:16:31 +00:00
|
|
|
struct wlr_wl_output *output = data;
|
2017-08-16 17:19:31 +00:00
|
|
|
assert(output && output->xdg_toplevel == xdg_toplevel);
|
|
|
|
|
2018-06-30 02:08:49 +00:00
|
|
|
if (width == 0 || height == 0) {
|
2017-08-17 08:22:54 +00:00
|
|
|
return;
|
|
|
|
}
|
2017-08-16 17:19:31 +00:00
|
|
|
// loop over states for maximized etc?
|
2017-08-13 14:51:50 +00:00
|
|
|
wl_egl_window_resize(output->egl_window, width, height, 0, 0);
|
2017-12-17 17:02:55 +00:00
|
|
|
wlr_output_update_custom_mode(&output->wlr_output, width, height, 0);
|
2017-06-20 16:27:05 +00:00
|
|
|
}
|
|
|
|
|
2017-08-16 17:19:31 +00:00
|
|
|
static void xdg_toplevel_handle_close(void *data, struct zxdg_toplevel_v6 *xdg_toplevel) {
|
2018-04-29 11:16:31 +00:00
|
|
|
struct wlr_wl_output *output = data;
|
2017-11-01 19:14:52 +00:00
|
|
|
assert(output && output->xdg_toplevel == xdg_toplevel);
|
2017-08-16 17:19:31 +00:00
|
|
|
|
2017-12-13 20:48:59 +00:00
|
|
|
wlr_output_destroy((struct wlr_output *)output);
|
2017-06-20 16:27:05 +00:00
|
|
|
}
|
|
|
|
|
2017-08-16 17:19:31 +00:00
|
|
|
static struct zxdg_toplevel_v6_listener xdg_toplevel_listener = {
|
|
|
|
.configure = xdg_toplevel_handle_configure,
|
|
|
|
.close = xdg_toplevel_handle_close,
|
2017-06-20 16:27:05 +00:00
|
|
|
};
|
|
|
|
|
2017-06-20 22:22:21 +00:00
|
|
|
struct wlr_output *wlr_wl_output_create(struct wlr_backend *_backend) {
|
|
|
|
assert(wlr_backend_is_wl(_backend));
|
2017-08-12 15:43:36 +00:00
|
|
|
struct wlr_wl_backend *backend = (struct wlr_wl_backend *)_backend;
|
2017-09-23 04:29:53 +00:00
|
|
|
if (!backend->started) {
|
2017-06-20 22:22:21 +00:00
|
|
|
++backend->requested_outputs;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2018-04-29 11:16:31 +00:00
|
|
|
struct wlr_wl_output *output;
|
|
|
|
if (!(output = calloc(sizeof(struct wlr_wl_output), 1))) {
|
|
|
|
wlr_log(L_ERROR, "Failed to allocate wlr_wl_output");
|
2017-06-19 20:36:40 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
2018-01-04 11:46:15 +00:00
|
|
|
wlr_output_init(&output->wlr_output, &backend->backend, &output_impl,
|
|
|
|
backend->local_display);
|
2017-08-13 14:51:50 +00:00
|
|
|
struct wlr_output *wlr_output = &output->wlr_output;
|
2017-06-19 20:36:40 +00:00
|
|
|
|
2017-12-17 17:02:55 +00:00
|
|
|
wlr_output_update_custom_mode(wlr_output, 1280, 720, 0);
|
2017-06-20 19:29:27 +00:00
|
|
|
strncpy(wlr_output->make, "wayland", sizeof(wlr_output->make));
|
|
|
|
strncpy(wlr_output->model, "wayland", sizeof(wlr_output->model));
|
2017-10-14 20:33:00 +00:00
|
|
|
snprintf(wlr_output->name, sizeof(wlr_output->name), "WL-%d",
|
2017-10-23 19:03:00 +00:00
|
|
|
wl_list_length(&backend->outputs) + 1);
|
2017-06-19 20:36:40 +00:00
|
|
|
|
2017-08-13 14:51:50 +00:00
|
|
|
output->backend = backend;
|
2017-06-20 16:27:05 +00:00
|
|
|
|
2017-08-13 14:51:50 +00:00
|
|
|
output->surface = wl_compositor_create_surface(backend->compositor);
|
2017-08-16 17:33:16 +00:00
|
|
|
if (!output->surface) {
|
|
|
|
wlr_log_errno(L_ERROR, "Could not create output surface");
|
|
|
|
goto error;
|
|
|
|
}
|
2018-04-29 12:37:29 +00:00
|
|
|
wl_surface_set_user_data(output->surface, output);
|
2017-08-16 17:19:31 +00:00
|
|
|
output->xdg_surface =
|
|
|
|
zxdg_shell_v6_get_xdg_surface(backend->shell, output->surface);
|
2017-08-16 17:33:16 +00:00
|
|
|
if (!output->xdg_surface) {
|
|
|
|
wlr_log_errno(L_ERROR, "Could not get xdg surface");
|
|
|
|
goto error;
|
|
|
|
}
|
2017-08-16 17:19:31 +00:00
|
|
|
output->xdg_toplevel =
|
|
|
|
zxdg_surface_v6_get_toplevel(output->xdg_surface);
|
2017-08-16 17:33:16 +00:00
|
|
|
if (!output->xdg_toplevel) {
|
|
|
|
wlr_log_errno(L_ERROR, "Could not get xdg toplevel");
|
|
|
|
goto error;
|
|
|
|
}
|
2017-08-16 17:19:31 +00:00
|
|
|
|
2018-05-14 23:16:18 +00:00
|
|
|
char title[32];
|
|
|
|
if (snprintf(title, sizeof(title), "wlroots - %s", wlr_output->name)) {
|
|
|
|
zxdg_toplevel_v6_set_title(output->xdg_toplevel, title);
|
|
|
|
}
|
|
|
|
|
2017-08-16 19:01:39 +00:00
|
|
|
zxdg_toplevel_v6_set_app_id(output->xdg_toplevel, "wlroots");
|
2017-08-16 17:19:31 +00:00
|
|
|
zxdg_surface_v6_add_listener(output->xdg_surface,
|
|
|
|
&xdg_surface_listener, output);
|
|
|
|
zxdg_toplevel_v6_add_listener(output->xdg_toplevel,
|
|
|
|
&xdg_toplevel_listener, output);
|
2017-08-16 22:52:01 +00:00
|
|
|
wl_surface_commit(output->surface);
|
2017-06-20 16:27:05 +00:00
|
|
|
|
2017-08-13 14:51:50 +00:00
|
|
|
output->egl_window = wl_egl_window_create(output->surface,
|
2017-06-20 21:51:45 +00:00
|
|
|
wlr_output->width, wlr_output->height);
|
2018-03-20 22:10:42 +00:00
|
|
|
output->egl_surface = wlr_egl_create_surface(&backend->egl,
|
|
|
|
output->egl_window);
|
2017-06-19 20:36:40 +00:00
|
|
|
|
2017-08-17 08:22:54 +00:00
|
|
|
wl_display_roundtrip(output->backend->remote_display);
|
|
|
|
|
2017-06-20 21:51:45 +00:00
|
|
|
// start rendering loop per callbacks by rendering first frame
|
2018-03-20 22:10:42 +00:00
|
|
|
if (!wlr_egl_make_current(&output->backend->egl, output->egl_surface,
|
|
|
|
NULL)) {
|
2017-08-16 17:33:16 +00:00
|
|
|
goto error;
|
2017-06-20 21:51:45 +00:00
|
|
|
}
|
|
|
|
|
2018-03-20 22:10:42 +00:00
|
|
|
wlr_renderer_begin(backend->renderer, wlr_output->width, wlr_output->height);
|
|
|
|
wlr_renderer_clear(backend->renderer, (float[]){ 1.0, 1.0, 1.0, 1.0 });
|
|
|
|
wlr_renderer_end(backend->renderer);
|
2017-06-20 21:51:45 +00:00
|
|
|
|
2017-08-13 14:51:50 +00:00
|
|
|
output->frame_callback = wl_surface_frame(output->surface);
|
|
|
|
wl_callback_add_listener(output->frame_callback, &frame_listener, output);
|
2017-06-20 21:51:45 +00:00
|
|
|
|
2018-03-20 22:10:42 +00:00
|
|
|
if (!wlr_egl_swap_buffers(&output->backend->egl, output->egl_surface,
|
|
|
|
NULL)) {
|
2017-08-16 17:33:16 +00:00
|
|
|
goto error;
|
2017-06-20 21:51:45 +00:00
|
|
|
}
|
|
|
|
|
2017-10-14 20:33:00 +00:00
|
|
|
wl_list_insert(&backend->outputs, &output->link);
|
2018-01-04 11:46:15 +00:00
|
|
|
wlr_output_update_enabled(wlr_output, true);
|
2018-04-29 11:16:31 +00:00
|
|
|
|
2018-02-12 09:36:43 +00:00
|
|
|
wlr_signal_emit_safe(&backend->backend.events.new_output, wlr_output);
|
2018-04-29 11:16:31 +00:00
|
|
|
|
|
|
|
if (backend->pointer != NULL) {
|
|
|
|
create_wl_pointer(backend->pointer, output);
|
|
|
|
}
|
|
|
|
|
2017-06-19 20:36:40 +00:00
|
|
|
return wlr_output;
|
2017-08-16 17:33:16 +00:00
|
|
|
|
|
|
|
error:
|
|
|
|
wlr_output_destroy(&output->wlr_output);
|
|
|
|
return NULL;
|
2017-06-19 20:36:40 +00:00
|
|
|
}
|