diff options
Diffstat (limited to 'grpc-proxy')
-rw-r--r-- | grpc-proxy/agl_shell.proto | 8 | ||||
-rw-r--r-- | grpc-proxy/grpc-async-cb.cpp | 12 | ||||
-rw-r--r-- | grpc-proxy/grpc-async-cb.h | 4 | ||||
-rw-r--r-- | grpc-proxy/main-grpc.cpp | 4 | ||||
-rw-r--r-- | grpc-proxy/shell.cpp | 9 | ||||
-rw-r--r-- | grpc-proxy/shell.h | 1 |
6 files changed, 36 insertions, 2 deletions
diff --git a/grpc-proxy/agl_shell.proto b/grpc-proxy/agl_shell.proto index f8a57d2..200d43e 100644 --- a/grpc-proxy/agl_shell.proto +++ b/grpc-proxy/agl_shell.proto @@ -8,6 +8,7 @@ service AglShellManagerService { rpc DeactivateApp(DeactivateRequest) returns (DeactivateResponse) {} rpc SetAppSplit(SplitRequest) returns (SplitResponse) {} rpc SetAppFloat(FloatRequest) returns (FloatResponse) {} + rpc SetAppFullscreen(FullscreenRequest) returns (FullscreenResponse) {} rpc AppStatusState(AppStateRequest) returns (stream AppStateResponse) {} rpc GetOutputs(OutputRequest) returns (ListOutputResponse) {} rpc SetAppNormal(NormalRequest) returns (NormalResponse) {} @@ -70,3 +71,10 @@ message NormalRequest { message NormalResponse { }; + +message FullscreenRequest { + string app_id = 1; +}; + +message FullscreenResponse { +}; diff --git a/grpc-proxy/grpc-async-cb.cpp b/grpc-proxy/grpc-async-cb.cpp index f7c114a..08bd1f6 100644 --- a/grpc-proxy/grpc-async-cb.cpp +++ b/grpc-proxy/grpc-async-cb.cpp @@ -135,6 +135,18 @@ GrpcServiceImpl::SetAppNormal(grpc::CallbackServerContext *context, } grpc::ServerUnaryReactor * +GrpcServiceImpl::SetAppFullscreen(grpc::CallbackServerContext *context, + const ::agl_shell_ipc::FullscreenRequest* request, + ::agl_shell_ipc::FullscreenResponse* /* response */) +{ + m_aglShell->SetAppFullscreen(request->app_id()); + + grpc::ServerUnaryReactor* reactor = context->DefaultReactor(); + reactor->Finish(grpc::Status::OK); + return reactor; +} + +grpc::ServerUnaryReactor * GrpcServiceImpl::SetAppSplit(grpc::CallbackServerContext *context, const ::agl_shell_ipc::SplitRequest* request, ::agl_shell_ipc::SplitResponse* /*response*/) diff --git a/grpc-proxy/grpc-async-cb.h b/grpc-proxy/grpc-async-cb.h index 214ce12..5542d80 100644 --- a/grpc-proxy/grpc-async-cb.h +++ b/grpc-proxy/grpc-async-cb.h @@ -88,6 +88,10 @@ public: const ::agl_shell_ipc::NormalRequest* request, ::agl_shell_ipc::NormalResponse* /*response*/) override; + grpc::ServerUnaryReactor *SetAppFullscreen(grpc::CallbackServerContext *context, + const ::agl_shell_ipc::FullscreenRequest* request, + ::agl_shell_ipc::FullscreenResponse* /*response*/) override; + grpc::ServerWriteReactor< ::agl_shell_ipc::AppStateResponse>* AppStatusState( ::grpc::CallbackServerContext* /*context*/, const ::agl_shell_ipc::AppStateRequest* /*request*/) override; diff --git a/grpc-proxy/main-grpc.cpp b/grpc-proxy/main-grpc.cpp index ea609f0..dfe899a 100644 --- a/grpc-proxy/main-grpc.cpp +++ b/grpc-proxy/main-grpc.cpp @@ -260,7 +260,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>(6), version))); + std::min(static_cast<uint32_t>(7), version))); agl_shell_add_listener(sh->shell, &shell_listener, data); sh->version = version; } else if (strcmp(interface, "wl_output") == 0) { @@ -284,7 +284,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>(6), version))); + std::min(static_cast<uint32_t>(7), version))); agl_shell_add_listener(sh->shell, &shell_listener_init, data); sh->version = version; } diff --git a/grpc-proxy/shell.cpp b/grpc-proxy/shell.cpp index eb2e08b..ef5c22f 100644 --- a/grpc-proxy/shell.cpp +++ b/grpc-proxy/shell.cpp @@ -86,6 +86,15 @@ Shell::SetAppNormal(const std::string &app_id) } void +Shell::SetAppFullscreen(const std::string &app_id) +{ + struct agl_shell *shell = this->m_shell.get(); + + agl_shell_set_app_fullscreen(shell, app_id.c_str()); + wl_display_flush(m_shell_data->wl_display); +} + +void Shell::SetAppSplit(const std::string &app_id, uint32_t orientation) { (void) app_id; diff --git a/grpc-proxy/shell.h b/grpc-proxy/shell.h index 143599a..a99111a 100644 --- a/grpc-proxy/shell.h +++ b/grpc-proxy/shell.h @@ -44,4 +44,5 @@ public: void SetAppFloat(const std::string &app_id, int32_t x_pos, int32_t y_pos); void SetAppNormal(const std::string &app_id); + void SetAppFullscreen(const std::string &app_id); }; |