summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2020-06-05 17:16:30 +0300
committerMarius Vlad <marius.vlad@collabora.com>2020-06-15 14:48:38 +0300
commit168261297ce8d6e17ca69eb1de4d0e98de52eedc (patch)
treeca61305f9d242241da8da4b3b6ad0fee0b9db88b
parent81be1de53fd49b7a31e5fea217e88c038e22c3f9 (diff)
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 <marius.vlad@collabora.com> Change-Id: Idd95acd9ae69c5ac37b50d447956b0ee46a94677
-rw-r--r--src/desktop.c4
-rw-r--r--src/ivi-compositor.h7
-rw-r--r--src/layout.c6
-rw-r--r--src/main.c3
-rw-r--r--src/shell.c2
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)
{