grpc-proxy/shell: Add width for split window 48/29648/4
authorMarius Vlad <marius.vlad@collabora.com>
Wed, 31 Jan 2024 12:15:02 +0000 (14:15 +0200)
committerMarius Vlad <marius.vlad@collabora.com>
Thu, 22 Feb 2024 13:51:33 +0000 (13:51 +0000)
It might be useful in the future to let clients choose how much of the
window to split so allow passing that. Note that there's no actual
implementation but if there's a need in the future it can be easily
added so it's better to add this now.

Bug-AGL: SPEC-4839
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I82f36e86f56b0a65cbacac8368b63f68df69a350

grpc-proxy/agl_shell.proto
grpc-proxy/grpc-async-cb.cpp
grpc-proxy/shell.cpp
grpc-proxy/shell.h
protocol/agl-shell.xml
src/shell.c

index cb9f191..c8d57ac 100644 (file)
@@ -36,7 +36,8 @@ message DeactivateResponse {
 message SplitRequest {
        string app_id = 1;
        int32 tile_orientation = 2;
 message SplitRequest {
        string app_id = 1;
        int32 tile_orientation = 2;
-       string output_name = 3;
+       int32 width = 3;
+       string output_name = 4;
 }
 
 message SplitResponse {
 }
 
 message SplitResponse {
index 8c4ed24..23a293d 100644 (file)
@@ -225,7 +225,7 @@ GrpcServiceImpl::SetAppSplit(grpc::CallbackServerContext *context,
                LOG("m_aglShell not set-up\n");
                return nullptr;
        }
                LOG("m_aglShell not set-up\n");
                return nullptr;
        }
-       m_aglShell->SetAppSplit(request->app_id(), request->tile_orientation(), request->output_name());
+       m_aglShell->SetAppSplit(request->app_id(), request->tile_orientation(), request->width(), request->output_name());
 
        grpc::ServerUnaryReactor* reactor = context->DefaultReactor();
        reactor->Finish(grpc::Status::OK);
 
        grpc::ServerUnaryReactor* reactor = context->DefaultReactor();
        reactor->Finish(grpc::Status::OK);
index 8e78b20..6dffe6b 100644 (file)
@@ -140,7 +140,7 @@ Shell::SetAppScale(const std::string &app_id,
 }
 
 void
 }
 
 void
-Shell::SetAppSplit(const std::string &app_id, uint32_t orientation, const std::string &output_name)
+Shell::SetAppSplit(const std::string &app_id, uint32_t orientation, uint32_t width, const std::string &output_name)
 {
        struct window_output *woutput, *w_output;
        struct agl_shell *shell = this->m_shell.get();
 {
        struct window_output *woutput, *w_output;
        struct agl_shell *shell = this->m_shell.get();
@@ -161,6 +161,6 @@ Shell::SetAppSplit(const std::string &app_id, uint32_t orientation, const std::s
                                           w_output, link);
 
 
                                           w_output, link);
 
 
-       agl_shell_set_app_split(shell, app_id.c_str(), orientation, w_output->output);
+       agl_shell_set_app_split(shell, app_id.c_str(), orientation, width, w_output->output);
        wl_display_flush(m_shell_data->wl_display);
 }
        wl_display_flush(m_shell_data->wl_display);
 }
index 587ed90..f428088 100644 (file)
@@ -40,7 +40,7 @@ public:
                m_shell(shell), m_shell_data(sh_data) { }
        void ActivateApp(const std::string &app_id, const std::string &output_name);
        void DeactivateApp(const std::string &app_id);
                m_shell(shell), m_shell_data(sh_data) { }
        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, const std::string &output_name);
+       void SetAppSplit(const std::string &app_id, uint32_t orientation, uint32_t width, const std::string &output_name);
        void SetAppFloat(const std::string &app_id,
                         int32_t x_pos, int32_t y_pos);
        void SetAppNormal(const std::string &app_id);
        void SetAppFloat(const std::string &app_id,
                         int32_t x_pos, int32_t y_pos);
        void SetAppNormal(const std::string &app_id);
index f8aee4c..4f71a51 100644 (file)
     </request>
 
     <request name="set_app_split" since="11">
     </request>
 
     <request name="set_app_split" since="11">
-      <description summary="set the application split">
+      <description summary="set the application with a split orientation">
         This requests asks the compositor to change the application from the
         original mode (whatever that might be) to a split, tiled orientation
         mode defined in the tile orientation enum.
         This requests asks the compositor to change the application from the
         original mode (whatever that might be) to a split, tiled orientation
         mode defined in the tile orientation enum.
         such that users can cycle between that one or the other, assumes there's
         another window in the first place.
 
         such that users can cycle between that one or the other, assumes there's
         another window in the first place.
 
+        A width size can also be specified for the split window. Note that this
+        width can't exceed the output width value, or the compositor can choose
+        to ignore this value.
+
         See xdg_toplevel.set_app_id from the xdg-shell protocol for a
         description of app_id.
       </description>
       <arg name="app_id" type="string"/>
       <arg name="orientation" type="uint" enum="tile_orientation"/>
         See xdg_toplevel.set_app_id from the xdg-shell protocol for a
         description of app_id.
       </description>
       <arg name="app_id" type="string"/>
       <arg name="orientation" type="uint" enum="tile_orientation"/>
+      <arg name="width" type="int" summary="width of the window being split"/>
       <arg name="output" type="object" interface="wl_output"/>
     </request>
   </interface>
       <arg name="output" type="object" interface="wl_output"/>
     </request>
   </interface>
index b8f096a..13c03f0 100644 (file)
@@ -1896,7 +1896,7 @@ shell_ivi_surf_count_split_surfaces(struct ivi_compositor *ivi)
 
 static
 void shell_set_app_split(struct wl_client *client, struct wl_resource *res,
 
 static
 void shell_set_app_split(struct wl_client *client, struct wl_resource *res,
-                        const char *app_id, uint32_t orientation,
+                        const char *app_id, uint32_t orientation, int32_t width,
                         struct wl_resource *output_res)
 {
        struct ivi_surface *surf;
                         struct wl_resource *output_res)
 {
        struct ivi_surface *surf;
@@ -1921,10 +1921,6 @@ void shell_set_app_split(struct wl_client *client, struct wl_resource *res,
                return;
        }
 
                return;
        }
 
-       /* otherwise, take actions now */
-       weston_log("%s() added split surface for app_id '%s' with orientation %d\n",
-                       __func__, app_id, orientation);
-
        if (output->previous_active) {
                struct weston_view *ev = output->previous_active->view;
 
        if (output->previous_active) {
                struct weston_view *ev = output->previous_active->view;