summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2022-08-05 16:21:34 +0300
committerMarius Vlad <marius.vlad@collabora.com>2022-08-06 13:35:49 +0300
commit3d0f70b1f75aed78b1a42cdfd610bcf115e58a50 (patch)
tree5e44c7bf6c769a3cb90af1535272ae8c0ef3c61e /src
parent5c0b4f63dd58fc3a91c7b395c4feaa73717b184c (diff)
agl-shell: Add split functionality into agl-shell protocolsandbox/mvlad/split-v3
Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Id19a1865baef6e7c9804a281d583a4ac19421851
Diffstat (limited to 'src')
-rw-r--r--src/shell.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/shell.c b/src/shell.c
index 913174f..d001e7c 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -1287,12 +1287,44 @@ shell_destroy(struct wl_client *client, struct wl_resource *res)
{
}
+static void
+_ivi_set_pending_desktop_surface_split(struct wl_resource *output,
+ const char *app_id, uint32_t orientation)
+{
+ weston_log("%s() added split surface for app_id '%s' with "
+ "orientation %d to pending\n", __func__, app_id, orientation);
+}
+
+static
+void shell_set_app_split(struct wl_client *client, struct wl_resource *res,
+ const char *app_id, uint32_t orientation,
+ struct wl_resource *output)
+{
+ struct ivi_surface *surf;
+ struct ivi_compositor *ivi = wl_resource_get_user_data(res);
+
+ if (!app_id)
+ return;
+
+ /* add it as pending until */
+ surf = ivi_find_app(ivi, app_id);
+ if (!surf) {
+ _ivi_set_pending_desktop_surface_split(output, app_id, orientation);
+ return;
+ }
+
+ /* otherwise, take actions now */
+ weston_log("%s() added split surface for app_id '%s' with orientation %d\n",
+ __func__, app_id, orientation);
+}
+
static const struct agl_shell_interface agl_shell_implementation = {
.destroy = shell_destroy,
.ready = shell_ready,
.set_background = shell_set_background,
.set_panel = shell_set_panel,
.activate_app = shell_activate_app,
+ .set_app_split = shell_set_app_split,
};
static void
@@ -1517,7 +1549,7 @@ int
ivi_shell_create_global(struct ivi_compositor *ivi)
{
ivi->agl_shell = wl_global_create(ivi->compositor->wl_display,
- &agl_shell_interface, 2,
+ &agl_shell_interface, 3,
ivi, bind_agl_shell);
if (!ivi->agl_shell) {
weston_log("Failed to create wayland global.\n");