weston: Make the shell entrypoint specific
authorQuentin Glidic <sardemff7+git@sardemff7.net>
Fri, 2 Dec 2016 13:17:08 +0000 (14:17 +0100)
committerQuentin Glidic <sardemff7+git@sardemff7.net>
Tue, 17 Jan 2017 17:24:58 +0000 (18:24 +0100)
This avoids loading a shell as a module, so we are sure to have only one
shell loaded at a time.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
compositor/main.c
compositor/weston.h
desktop-shell/shell.c
fullscreen-shell/fullscreen-shell.c
ivi-shell/ivi-shell.c

index af093f1..74b404b 100644 (file)
@@ -829,6 +829,21 @@ wet_load_module(struct weston_compositor *compositor,
 }
 
 static int
+wet_load_shell(struct weston_compositor *compositor,
+              const char *name, int *argc, char *argv[])
+{
+       int (*shell_init)(struct weston_compositor *ec,
+                         int *argc, char *argv[]);
+
+       shell_init = wet_load_module_entrypoint(name, "wet_shell_init");
+       if (!shell_init)
+               return -1;
+       if (shell_init(compositor, argc, argv) < 0)
+               return -1;
+       return 0;
+}
+
+static int
 load_modules(struct weston_compositor *ec, const char *modules,
             int *argc, char *argv[])
 {
@@ -1895,7 +1910,7 @@ int main(int argc, char *argv[])
                weston_config_section_get_string(section, "shell", &shell,
                                                 "desktop-shell.so");
 
-       if (load_modules(ec, shell, &argc, argv) < 0)
+       if (wet_load_shell(ec, shell, &argc, argv) < 0)
                goto out;
 
        weston_config_section_get_string(section, "modules", &modules, "");
index 6229b34..5708aca 100644 (file)
@@ -64,6 +64,9 @@ void *
 wet_load_module_entrypoint(const char *name, const char *entrypoint);
 
 int
+wet_shell_init(struct weston_compositor *ec,
+              int *argc, char *argv[]);
+int
 wet_module_init(struct weston_compositor *ec,
                int *argc, char *argv[]);
 int
index 5e10924..d8ef3fd 100644 (file)
@@ -4874,8 +4874,8 @@ handle_seat_created(struct wl_listener *listener, void *data)
 }
 
 WL_EXPORT int
-wet_module_init(struct weston_compositor *ec,
-               int *argc, char *argv[])
+wet_shell_init(struct weston_compositor *ec,
+              int *argc, char *argv[])
 {
        struct weston_seat *seat;
        struct desktop_shell *shell;
index d75c239..7368cb4 100644 (file)
@@ -897,8 +897,8 @@ bind_fullscreen_shell(struct wl_client *client, void *data, uint32_t version,
 }
 
 WL_EXPORT int
-wet_module_init(struct weston_compositor *compositor,
-               int *argc, char *argv[])
+wet_shell_init(struct weston_compositor *compositor,
+              int *argc, char *argv[])
 {
        struct fullscreen_shell *shell;
        struct weston_seat *seat;
index 4332995..67619b8 100644 (file)
@@ -492,8 +492,8 @@ shell_add_bindings(struct weston_compositor *compositor,
  * Initialization of ivi-shell.
  */
 WL_EXPORT int
-wet_module_init(struct weston_compositor *compositor,
-               int *argc, char *argv[])
+wet_shell_init(struct weston_compositor *compositor,
+              int *argc, char *argv[])
 {
        struct ivi_shell *shell;
        struct ivi_shell_setting setting = { };