Commit 53cb3185 authored by myfreeweb's avatar myfreeweb

desktop-shell: expose an API with the activate function

parent d0ed96e9
Pipeline #13996 failed with stage
in 2 minutes and 14 seconds
......@@ -25,5 +25,9 @@ if get_option('shell-desktop')
install: true,
install_dir: dir_module_weston
)
install_headers(
'desktop-shell-api.h',
subdir: dir_include_libweston
)
env_modmap += 'desktop-shell.so=@0@;'.format(plugin_shell_desktop.full_path())
endif
......@@ -37,6 +37,7 @@
#include <sys/types.h>
#include "shell.h"
#include "desktop-shell-api.h"
#include "compositor/weston.h"
#include "weston-desktop-shell-server-protocol.h"
#include "shared/config-parser.h"
......@@ -5057,6 +5058,19 @@ handle_seat_created(struct wl_listener *listener, void *data)
create_shell_seat(seat);
}
static struct desktop_shell *global_shell = NULL;
static struct desktop_shell *
weston_desktop_shell_get(struct weston_compositor *compositor)
{
return global_shell;
}
const struct weston_desktop_shell_api api = {
weston_desktop_shell_get,
activate,
};
WL_EXPORT int
wet_shell_init(struct weston_compositor *ec,
int *argc, char *argv[])
......@@ -5071,6 +5085,7 @@ wet_shell_init(struct weston_compositor *ec,
if (shell == NULL)
return -1;
global_shell = shell;
shell->compositor = ec;
shell->destroy_listener.notify = shell_destroy;
......@@ -5155,6 +5170,10 @@ wet_shell_init(struct weston_compositor *ec,
screenshooter_create(ec);
if (weston_plugin_api_register(ec,
WESTON_DESKTOP_SHELL_API_NAME, &api, sizeof(api)) < 0)
return -1;
shell_add_bindings(ec, shell);
shell_fade_init(shell);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment