shell: Pass the bounding box values to the pop-up surface 55/24755/4
authorMarius Vlad <marius.vlad@collabora.com>
Thu, 11 Jun 2020 13:21:37 +0000 (16:21 +0300)
committerMarius Vlad <marius.vlad@collabora.com>
Mon, 15 Jun 2020 17:23:38 +0000 (20:23 +0300)
Necessary in order to make use options passed in with the protocol.

Bug-AGL: SPEC-3419

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I0a2b973526572db18349642782082906544830a9

src/ivi-compositor.h
src/shell.c

index 53e09a3..7b5c18f 100644 (file)
@@ -155,10 +155,16 @@ enum ivi_surface_role {
        IVI_SURFACE_ROLE_REMOTE,
 };
 
+struct ivi_bounding_box {
+       int x; int y;
+       int width; int height;
+};
+
 struct pending_popup {
        struct ivi_output *ioutput;
        char *app_id;
        int x; int y;
+       struct ivi_bounding_box bb;
 
        struct wl_list link;    /** ivi_compositor::popup_pending_surfaces */
 };
@@ -193,8 +199,8 @@ struct ivi_background_surface {
 
 struct ivi_popup_surface {
        struct ivi_output *output;
-       int x;
-       int y;
+       int x; int y; /* initial position */
+       struct ivi_bounding_box bb;     /* bounding box */
 };
 
 struct ivi_fullscreen_surface {
index f969503..5561898 100644 (file)
@@ -137,7 +137,8 @@ ivi_set_desktop_surface_split(struct ivi_surface *surface)
 
 static void
 ivi_set_pending_desktop_surface_popup(struct ivi_output *ioutput,
-                                     int x, int y, const char *app_id)
+                                     int x, int y, int bx, int by, int width, int height,
+                                     const char *app_id)
 {
        struct ivi_compositor *ivi = ioutput->ivi;
        size_t len_app_id = strlen(app_id);
@@ -150,6 +151,11 @@ ivi_set_pending_desktop_surface_popup(struct ivi_output *ioutput,
        p_popup->x = x;
        p_popup->y = y;
 
+       p_popup->bb.x = bx;
+       p_popup->bb.y = by;
+       p_popup->bb.width = width;
+       p_popup->bb.height = height;
+
        wl_list_insert(&ivi->popup_pending_apps, &p_popup->link);
 }
 
@@ -267,6 +273,12 @@ ivi_check_pending_desktop_surface_popup(struct ivi_surface *surface)
                        surface->popup.output = p_popup->ioutput;
                        surface->popup.x = p_popup->x;
                        surface->popup.y = p_popup->y;
+
+                       surface->popup.bb.x = p_popup->bb.x;
+                       surface->popup.bb.y = p_popup->bb.y;
+                       surface->popup.bb.width = p_popup->bb.width;
+                       surface->popup.bb.height = p_popup->bb.height;
+
                        ivi_remove_pending_desktop_surface_popup(p_popup);
                        return true;
                }
@@ -858,7 +870,9 @@ static void
 shell_desktop_set_app_property(struct wl_client *client,
                               struct wl_resource *shell_res,
                               const char *app_id, uint32_t role,
-                              int x, int y, struct wl_resource *output_res)
+                              int x, int y, int bx, int by,
+                              int width, int height,
+                              struct wl_resource *output_res)
 {
        struct weston_head *head = weston_head_from_resource(output_res);
        struct weston_output *woutput = weston_head_get_output(head);
@@ -866,7 +880,8 @@ shell_desktop_set_app_property(struct wl_client *client,
 
        switch (role) {
        case AGL_SHELL_DESKTOP_APP_ROLE_POPUP:
-               ivi_set_pending_desktop_surface_popup(output, x, y, app_id);
+               ivi_set_pending_desktop_surface_popup(output, x, y, bx, by,
+                                                     width, height, app_id);
                break;
        case AGL_SHELL_DESKTOP_APP_ROLE_FULLSCREEN:
                ivi_set_pending_desktop_surface_fullscreen(output, app_id);