weston: Make the shell entrypoint specific

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>
dev
Quentin Glidic 8 years ago
parent 8af2beccbd
commit da01c1d105
No known key found for this signature in database
GPG Key ID: AC203F96E2C34BB7
  1. 17
      compositor/main.c
  2. 3
      compositor/weston.h
  3. 4
      desktop-shell/shell.c
  4. 4
      fullscreen-shell/fullscreen-shell.c
  5. 4
      ivi-shell/ivi-shell.c

@ -828,6 +828,21 @@ wet_load_module(struct weston_compositor *compositor,
return 0;
}
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, "");

@ -63,6 +63,9 @@ wet_get_config(struct weston_compositor *compositor);
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[]);

@ -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;

@ -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;

@ -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 = { };

Loading…
Cancel
Save