summaryrefslogtreecommitdiffstats
path: root/grpc-proxy
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2023-01-20 16:32:35 +0200
committerMarius Vlad <marius.vlad@collabora.com>2023-03-01 12:38:14 +0200
commit4af44df30c1784a69b96d310f152133a507bc2e1 (patch)
tree473b08dcd8123a3c30f2f8931972b98caa78b22d /grpc-proxy
parent65fc5191f046ad8c7ba1bfd9e2e75afb925b4a21 (diff)
protocol, grpc-proxy: Add support for set_app_float
Add support for setting a window as float/popup. This allows either the application itself be set-up as float, or from other gRPC clients. Bug-AGL: SPEC-4673 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ic7ee8203cd9c4dfcc51b7fc9709f35be504ae9d0
Diffstat (limited to 'grpc-proxy')
-rw-r--r--grpc-proxy/agl_shell.proto2
-rw-r--r--grpc-proxy/grpc-async-cb.cpp3
-rw-r--r--grpc-proxy/main-grpc.cpp4
-rw-r--r--grpc-proxy/shell.cpp7
-rw-r--r--grpc-proxy/shell.h3
5 files changed, 13 insertions, 6 deletions
diff --git a/grpc-proxy/agl_shell.proto b/grpc-proxy/agl_shell.proto
index 22fad1c..8e81750 100644
--- a/grpc-proxy/agl_shell.proto
+++ b/grpc-proxy/agl_shell.proto
@@ -37,6 +37,8 @@ message SplitResponse {
message FloatRequest {
string app_id = 1;
+ int32 x_pos = 2;
+ int32 y_pos = 3;
}
message FloatResponse {
diff --git a/grpc-proxy/grpc-async-cb.cpp b/grpc-proxy/grpc-async-cb.cpp
index d0fd88d..3754b3c 100644
--- a/grpc-proxy/grpc-async-cb.cpp
+++ b/grpc-proxy/grpc-async-cb.cpp
@@ -114,7 +114,8 @@ GrpcServiceImpl::SetAppFloat(grpc::CallbackServerContext *context,
const ::agl_shell_ipc::FloatRequest* request,
::agl_shell_ipc::FloatResponse* /* response */)
{
- m_aglShell->SetAppFloat(request->app_id());
+ m_aglShell->SetAppFloat(request->app_id(),
+ request->x_pos(), request->y_pos());
grpc::ServerUnaryReactor* reactor = context->DefaultReactor();
reactor->Finish(grpc::Status::OK);
diff --git a/grpc-proxy/main-grpc.cpp b/grpc-proxy/main-grpc.cpp
index d094be5..ea609f0 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>(5), version)));
+ std::min(static_cast<uint32_t>(6), 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>(5), version)));
+ std::min(static_cast<uint32_t>(6), 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 b96ac39..83032b1 100644
--- a/grpc-proxy/shell.cpp
+++ b/grpc-proxy/shell.cpp
@@ -68,9 +68,12 @@ Shell::DeactivateApp(const std::string &app_id)
}
void
-Shell::SetAppFloat(const std::string &app_id)
+Shell::SetAppFloat(const std::string &app_id, int32_t x_pos, int32_t y_pos)
{
- (void) app_id;
+ struct agl_shell *shell = this->m_shell.get();
+
+ agl_shell_set_app_float(shell, app_id.c_str(), x_pos, y_pos);
+ wl_display_flush(m_shell_data->wl_display);
}
void
diff --git a/grpc-proxy/shell.h b/grpc-proxy/shell.h
index 03a4a87..4059e0b 100644
--- a/grpc-proxy/shell.h
+++ b/grpc-proxy/shell.h
@@ -41,5 +41,6 @@ public:
void ActivateApp(const std::string &app_id, const std::string &output_name);
void DeactivateApp(const std::string &app_id);
void SetAppSplit(const std::string &app_id, uint32_t orientation);
- void SetAppFloat(const std::string &app_id);
+ void SetAppFloat(const std::string &app_id,
+ int32_t x_pos, int32_t y_pos);
};