summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2022-08-26 22:59:09 +0300
committerMarius Vlad <marius.vlad@collabora.com>2022-09-14 16:40:18 +0000
commitbb730ca304a5f62889038cb1bc6509afb869ee95 (patch)
treebae4d4c00c24447559ce1680776faa9c9b4fc190
parentb92397ef12626a0d09cb4c9e853d0c038104110f (diff)
layout: Handle dynamic application/surface movement between outputs
This patch takes care of dynamically moving applications from one output to another, by tracking the output which was used activation finalisation. It also logs when we detect that we keep having the same surface active on the output. Bug-AGL: SPEC-4516 Reported-by: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com> Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ic4ce7d56fa360f2bddc087a1af83fc32728cc95d
-rw-r--r--src/layout.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/layout.c b/src/layout.c
index 031923a..15858ff 100644
--- a/src/layout.c
+++ b/src/layout.c
@@ -232,6 +232,26 @@ ivi_layout_activate_complete(struct ivi_output *output,
surf->mapped = true;
view->surface->is_mapped = true;
+ /* handle a movement from one output to another */
+ if (surf->current_completed_output &&
+ surf->current_completed_output != output) {
+
+ /* we're migrating the same surface but to another output */
+ if (surf->current_completed_output->active == surf) {
+ struct weston_view *ev =
+ surf->current_completed_output->active->view;
+
+ weston_layer_entry_remove(&ev->layer_link);
+ surf->current_completed_output->previous_active =
+ surf->current_completed_output->active;
+ surf->current_completed_output->active = NULL;
+
+ /* damage all possible outputs to avoid stale views */
+ weston_compositor_damage_all(ivi->compositor);
+ }
+ }
+
+
if (output->active) {
output->active->view->is_mapped = false;
output->active->view->surface->is_mapped = false;
@@ -864,8 +884,11 @@ ivi_layout_activate_by_surf(struct ivi_output *output, struct ivi_surface *surf)
/* do not 're'-activate surfaces that are split or active */
if (surf == output->active ||
- ivi_layout_surface_is_split_or_fullscreen(surf))
+ ivi_layout_surface_is_split_or_fullscreen(surf)) {
+ weston_log("Application %s is already active on output %s\n",
+ app_id, output->output->name);
return;
+ }
if (surf->role == IVI_SURFACE_ROLE_REMOTE) {
struct ivi_output *remote_output =