mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-05 16:58:01 +02:00
backend-x11: enable multi-backend support
Insert the backend into the weston_compositor::backend_list instead of setting weston_compositor::backend. The compositor uses this to determine whether the backend is capable of being loaded simultaneously with other backends. The X11 backend can only be loaded as primary backend. Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
This commit is contained in:
parent
bb3b9374aa
commit
14c52a942b
1 changed files with 13 additions and 4 deletions
|
|
@ -1239,10 +1239,12 @@ x11_head_destroy(struct weston_head *base)
|
||||||
static struct x11_output *
|
static struct x11_output *
|
||||||
x11_backend_find_output(struct x11_backend *b, xcb_window_t window)
|
x11_backend_find_output(struct x11_backend *b, xcb_window_t window)
|
||||||
{
|
{
|
||||||
struct x11_output *output;
|
struct weston_output *base;
|
||||||
|
|
||||||
wl_list_for_each(output, &b->compositor->output_list, base.link) {
|
wl_list_for_each(base, &b->compositor->output_list, link) {
|
||||||
if (output->window == window)
|
struct x11_output *output = to_x11_output(base);
|
||||||
|
|
||||||
|
if (output && output->window == window)
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1838,6 +1840,8 @@ x11_shutdown(struct weston_backend *base)
|
||||||
{
|
{
|
||||||
struct x11_backend *backend = to_x11_backend(base);
|
struct x11_backend *backend = to_x11_backend(base);
|
||||||
|
|
||||||
|
wl_list_remove(&backend->base.link);
|
||||||
|
|
||||||
wl_event_source_remove(backend->xcb_source);
|
wl_event_source_remove(backend->xcb_source);
|
||||||
x11_input_destroy(backend);
|
x11_input_destroy(backend);
|
||||||
}
|
}
|
||||||
|
|
@ -1880,7 +1884,7 @@ x11_backend_create(struct weston_compositor *compositor,
|
||||||
b->fullscreen = config->fullscreen;
|
b->fullscreen = config->fullscreen;
|
||||||
b->no_input = config->no_input;
|
b->no_input = config->no_input;
|
||||||
|
|
||||||
compositor->backend = &b->base;
|
wl_list_insert(&compositor->backend_list, &b->base.link);
|
||||||
|
|
||||||
b->base.supported_presentation_clocks =
|
b->base.supported_presentation_clocks =
|
||||||
WESTON_PRESENTATION_CLOCKS_SOFTWARE;
|
WESTON_PRESENTATION_CLOCKS_SOFTWARE;
|
||||||
|
|
@ -2009,6 +2013,11 @@ weston_backend_init(struct weston_compositor *compositor,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (compositor->renderer) {
|
||||||
|
weston_log("X11 backend must be the primary backend\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
config_init_to_defaults(&config);
|
config_init_to_defaults(&config);
|
||||||
memcpy(&config, config_base, config_base->struct_size);
|
memcpy(&config, config_base, config_base->struct_size);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue