diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2023-04-07 15:59:49 +0300 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2023-04-27 23:18:35 +0300 |
commit | 4a1684308bd6a17c5b112d30e672c40fd348fef3 (patch) | |
tree | 16a3a005345061554ce5cb159ccb43ae4253b40d /grpc-proxy/main-grpc.cpp | |
parent | f825bf9e71ac5adfcbdc6ef7f6c2fef8555ee4a3 (diff) |
grpc-proxy: Added set_app_output request
This is identical to the remote role, but I feel this conveys more
information than remote role, as remote denotes that the output is
displayed on another device, which it isn't always the case (the
system has multiple outputs all connected directly).
This introduces two new additions to the agl-shell protocol, a request
to use a different output to display/show the application and an event
to inform the shell client to use as a map between the application id
and its output. The event is necessary to let the shell client know
which output to activate the application on.
This requests implements a wrapper for gRPC that maps 1-to-1 to the
agl-shell request. There's no gRPC subscription similar to the event
though.
Bug-AGL: SPEC-4673
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I070e9fdbafd5616f3a98415193bf846aeaee9a4a
Diffstat (limited to 'grpc-proxy/main-grpc.cpp')
-rw-r--r-- | grpc-proxy/main-grpc.cpp | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/grpc-proxy/main-grpc.cpp b/grpc-proxy/main-grpc.cpp index dfe899a..1e297c5 100644 --- a/grpc-proxy/main-grpc.cpp +++ b/grpc-proxy/main-grpc.cpp @@ -120,16 +120,31 @@ agl_shell_app_state(void *data, struct agl_shell *agl_shell, } } +static void +agl_shell_app_on_output(void *data, struct agl_shell *agl_shell, + const char *app_id, const char *output_name) +{ + (void) agl_shell; + (void) output_name; + (void) data; + (void) app_id; + + LOG("got app_on_output event app_id %s on output\n", app_id, output_name); +} + + static const struct agl_shell_listener shell_listener = { - agl_shell_bound_ok, - agl_shell_bound_fail, - agl_shell_app_state, + agl_shell_bound_ok, + agl_shell_bound_fail, + agl_shell_app_state, + agl_shell_app_on_output, }; static const struct agl_shell_listener shell_listener_init = { - agl_shell_bound_ok_init, - agl_shell_bound_fail_init, - nullptr, + agl_shell_bound_ok_init, + agl_shell_bound_fail_init, + nullptr, + nullptr, }; static void @@ -260,7 +275,7 @@ global_add(void *data, struct wl_registry *reg, uint32_t id, sh->shell = static_cast<struct agl_shell *>(wl_registry_bind(reg, id, &agl_shell_interface, - std::min(static_cast<uint32_t>(7), version))); + std::min(static_cast<uint32_t>(8), version))); agl_shell_add_listener(sh->shell, &shell_listener, data); sh->version = version; } else if (strcmp(interface, "wl_output") == 0) { @@ -284,7 +299,7 @@ global_add_init(void *data, struct wl_registry *reg, uint32_t id, sh->shell = static_cast<struct agl_shell *>(wl_registry_bind(reg, id, &agl_shell_interface, - std::min(static_cast<uint32_t>(7), version))); + std::min(static_cast<uint32_t>(8), version))); agl_shell_add_listener(sh->shell, &shell_listener_init, data); sh->version = version; } |