From 168261297ce8d6e17ca69eb1de4d0e98de52eedc Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Fri, 5 Jun 2020 17:16:30 +0300 Subject: [PATCH] src: Mark surfaces with the 'remote' role if configuration file says so As we don't have an explicit way to do it, like we have with the protocol, we try to determine if the surface was being assigned a remote output and use that, when the surface is created. Bug-AGL: SPEC-3280 Signed-off-by: Marius Vlad Change-Id: Idd95acd9ae69c5ac37b50d447956b0ee46a94677 --- src/desktop.c | 4 ++++ src/ivi-compositor.h | 7 +++++++ src/layout.c | 6 +++--- src/main.c | 3 +++ src/shell.c | 2 +- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/desktop.c b/src/desktop.c index 3dc1ceb..00cc4db 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -61,6 +61,7 @@ desktop_surface_added(struct weston_desktop_surface *dsurface, void *userdata) struct weston_desktop_client *dclient; struct wl_client *client; struct ivi_surface *surface; + struct ivi_output *active_output = NULL; const char *app_id = NULL; dclient = weston_desktop_surface_get_client(dsurface); @@ -95,6 +96,9 @@ desktop_surface_added(struct weston_desktop_surface *dsurface, void *userdata) app_id = weston_desktop_surface_get_app_id(dsurface); + if ((active_output = ivi_layout_find_with_app_id(app_id, ivi))) + ivi_set_pending_desktop_surface_remote(active_output, app_id); + if (ivi->shell_client.ready) { ivi_check_pending_desktop_surface(surface); weston_log("Added surface %p, app_id %s, role %s\n", surface, diff --git a/src/ivi-compositor.h b/src/ivi-compositor.h index 3b25915..53e09a3 100644 --- a/src/ivi-compositor.h +++ b/src/ivi-compositor.h @@ -358,4 +358,11 @@ remove_black_surface(struct ivi_output *output); const char * ivi_layout_get_surface_role_name(struct ivi_surface *surf); +void +ivi_set_pending_desktop_surface_remote(struct ivi_output *ioutput, + const char *app_id); + +struct ivi_output * +ivi_layout_find_with_app_id(const char *app_id, struct ivi_compositor *ivi); + #endif diff --git a/src/layout.c b/src/layout.c index 0b8858d..325f712 100644 --- a/src/layout.c +++ b/src/layout.c @@ -236,8 +236,8 @@ ivi_layout_activate_complete(struct ivi_output *output, ivi_layout_get_surface_role_name(surf), output->name); } -static struct ivi_output * -ivi_layout_find_app_id(const char *app_id, struct ivi_compositor *ivi) +struct ivi_output * +ivi_layout_find_with_app_id(const char *app_id, struct ivi_compositor *ivi) { struct ivi_output *out; @@ -303,7 +303,7 @@ ivi_layout_desktop_committed(struct ivi_surface *surf) return; /* check first if there aren't any outputs being set */ - r_output = ivi_layout_find_app_id(app_id, surf->ivi); + r_output = ivi_layout_find_with_app_id(app_id, surf->ivi); if (r_output) { struct weston_view *view = r_output->fullscreen_view.fs->view; diff --git a/src/main.c b/src/main.c index e0a9d79..99512d5 100644 --- a/src/main.c +++ b/src/main.c @@ -102,6 +102,9 @@ ivi_output_configure_app_id(struct ivi_output *ivi_output) &ivi_output->app_id, NULL); + if (ivi_output->app_id == NULL) + return; + weston_log("Will place app_id %s on output %s\n", ivi_output->app_id, ivi_output->name); } diff --git a/src/shell.c b/src/shell.c index 3f522ba..ac41e1f 100644 --- a/src/shell.c +++ b/src/shell.c @@ -186,7 +186,7 @@ ivi_set_pending_desktop_surface_split(struct ivi_output *ioutput, wl_list_insert(&ivi->split_pending_apps, &split->link); } -static void +void ivi_set_pending_desktop_surface_remote(struct ivi_output *ioutput, const char *app_id) { -- 2.16.6