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>
diff --git a/Makefile.am b/Makefile.am
index f45a87f..436bb1b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -143,7 +143,8 @@
weston_LDFLAGS = -export-dynamic
weston_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON \
- -DMODULEDIR='"$(moduledir)"'
+ -DMODULEDIR='"$(moduledir)"' \
+ -DXSERVER_PATH='"@XSERVER_PATH@"'
weston_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) $(LIBUNWIND_CFLAGS)
weston_LDADD = $(COMPOSITOR_LIBS) $(LIBUNWIND_LIBS) \
$(DLOPEN_LIBS) $(LIBINPUT_BACKEND_LIBS) \
@@ -152,7 +153,8 @@
weston_SOURCES = \
compositor/main.c \
compositor/weston-screenshooter.c \
- compositor/text-backend.c
+ compositor/text-backend.c \
+ compositor/xwayland.c
# Track this dependency explicitly instead of using BUILT_SOURCES. We
# add BUILT_SOURCES to CLEANFILES, but we want to keep git-version.h
@@ -958,7 +960,7 @@
if ENABLE_XWAYLAND
-module_LTLIBRARIES += xwayland.la
+libweston_module_LTLIBRARIES += xwayland.la
xwayland_la_CPPFLAGS = \
-I$(top_builddir)/protocol \
@@ -968,8 +970,7 @@
-I$(top_builddir)/xwayland \
-DDATADIR='"$(datadir)"' \
-DMODULEDIR='"$(moduledir)"' \
- -DLIBEXECDIR='"$(libexecdir)"' \
- -DXSERVER_PATH='"@XSERVER_PATH@"'
+ -DLIBEXECDIR='"$(libexecdir)"'
xwayland_la_LDFLAGS = -module -avoid-version
xwayland_la_LIBADD = \
@@ -989,6 +990,9 @@
xwayland/hash.c \
xwayland/hash.h \
shared/helpers.h
+
+libwestoninclude_HEADERS += xwayland/xwayland-api.h
+
endif