summaryrefslogtreecommitdiff
path: root/libweston/compositor-rdp.c
diff options
context:
space:
mode:
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>2017-08-30 11:29:49 +0300
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2017-10-04 16:18:06 +0300
commit7da9a3802fc969af67f5dd00382af47aa6f34be9 (patch)
tree156d3c1c675e7b61d30629604d982849a9fac8dc /libweston/compositor-rdp.c
parentd7e351189e160470fc51900eabcdec0943291da1 (diff)
libweston: set backend pointer earlier
Change all backends to set the core backend pointer early. This is necessary for libweston core to be able to access the backend vfuncs before the backend init function returns. Particularly, weston_output_init() will be needing to inspect the backend vfuncs to see if the backend has been converted to a new API. Backends that create outputs as part of their init would fail without setting the pointer earlier. For consistency, all backends are modified instead of just those that could hit an issue. Libweston core will take care of resetting the backend pointer to NULL in case of error since "libweston: ensure backend is not loaded twice". Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Ian Ray <ian.ray@ge.com> Acked-by Daniel Stone <daniels@collabora.com>
Diffstat (limited to 'libweston/compositor-rdp.c')
-rw-r--r--libweston/compositor-rdp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libweston/compositor-rdp.c b/libweston/compositor-rdp.c
index 393c1185..990ddc66 100644
--- a/libweston/compositor-rdp.c
+++ b/libweston/compositor-rdp.c
@@ -1299,6 +1299,8 @@ rdp_backend_create(struct weston_compositor *compositor,
b->rdp_key = config->rdp_key ? strdup(config->rdp_key) : NULL;
b->no_clients_resize = config->no_clients_resize;
+ compositor->backend = &b->base;
+
/* activate TLS only if certificate/key are available */
if (config->server_cert && config->server_key) {
weston_log("TLS support activated\n");
@@ -1345,8 +1347,6 @@ rdp_backend_create(struct weston_compositor *compositor,
goto err_output;
}
- compositor->backend = &b->base;
-
ret = weston_plugin_api_register(compositor, WESTON_RDP_OUTPUT_API_NAME,
&api, sizeof(api));