xwayland: make the plugin usable by libweston compositors
This patch follows a similar approach taken to detach the backends from weston. But instead of passing a configuration struct when loading the plugin, we use the plugin API registry to register an API, and to get it in the compositor side. This API allows to spawn the Xwayland process in the compositor side, and to deal with signal handling. A new function is added in compositor.c to load and init the xwayland.so plugin. Also make sure to re-arm the SIGUSR1 when the X server quits. Signed-off-by: Giulio Camuffo <giuliocamuffo@gmail.com> [Pekka: moved xwayland/weston-xwayland.c -> compositor/xwayland.c] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
committed by
Pekka Paalanen
parent
827b5d225d
commit
9c764df043
@@ -5019,3 +5019,18 @@ weston_compositor_load_backend(struct weston_compositor *compositor,
|
||||
|
||||
return backend_init(compositor, config_base);
|
||||
}
|
||||
|
||||
WL_EXPORT int
|
||||
weston_compositor_load_xwayland(struct weston_compositor *compositor)
|
||||
{
|
||||
int (*module_init)(struct weston_compositor *ec,
|
||||
int *argc, char *argv[]);
|
||||
int argc = 0;
|
||||
|
||||
module_init = weston_load_module("xwayland.so", "module_init");
|
||||
if (!module_init)
|
||||
return -1;
|
||||
if (module_init(compositor, &argc, NULL) < 0)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1720,6 +1720,9 @@ void
|
||||
weston_seat_set_keyboard_focus(struct weston_seat *seat,
|
||||
struct weston_surface *surface);
|
||||
|
||||
int
|
||||
weston_compositor_load_xwayland(struct weston_compositor *compositor);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user