grpc-proxy/shell: Add width for split window
[src/agl-compositor.git] / src / shell.c
index 7f445e6..13c03f0 100644 (file)
 static void
 create_black_curtain_view(struct ivi_output *output);
 
-static void
-_ivi_set_shell_surface_split(struct ivi_surface *surface, struct ivi_output *output,
-                            uint32_t orientation, bool to_activate);
-
 static uint32_t
 reverse_orientation(uint32_t orientation);
 
@@ -1792,7 +1788,7 @@ reverse_orientation(uint32_t orientation)
        }
 }
 
-static void
+void
 _ivi_set_shell_surface_split(struct ivi_surface *surface, struct ivi_output *ioutput,
                             uint32_t orientation, bool to_activate)
 {
@@ -1900,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,
-                        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;
@@ -1925,10 +1921,6 @@ void shell_set_app_split(struct wl_client *client, struct wl_resource *res,
                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;
 
@@ -1947,6 +1939,11 @@ void shell_set_app_split(struct wl_client *client, struct wl_resource *res,
 
                _ivi_set_shell_surface_split(output->previous_active, NULL,
                                             reverse_orientation(orientation), false);
+
+               if (orientation == AGL_SHELL_TILE_ORIENTATION_NONE &&
+                   output->active == surf) {
+                       output->active = output->previous_active;
+               }
        }
 
        _ivi_set_shell_surface_split(surf, NULL, orientation, false);