summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2022-08-25 17:42:34 +0300
committerMarius Vlad <marius.vlad@collabora.com>2022-09-14 19:38:00 +0300
commit372eb222b17bbc9d40357187aa9700eddcd21f50 (patch)
treeef10348cc93788436c2c61751bf8afa01d55febe
parent39c91d5ccae3b65b8fd06276ec4f902e2ff09c7d (diff)
layout: Detect when an application should be migrated to other outputs
This patch adds a way to determine when to move out/migrate the window to another output, different than one set previously, or where it was initially added. This patch only adds support for resizing with a later patch touch the final activation part. Uses new output variable to track it the outputs. We send new dimensions of the output if they do not match the previous/older recorded one. Bug-AGL: SPEC-4516 Reported-by: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com> Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ic5b6b9c1676543fa5ff1524f58e014ad8abb632b
-rw-r--r--src/ivi-compositor.h1
-rw-r--r--src/layout.c36
2 files changed, 35 insertions, 2 deletions
diff --git a/src/ivi-compositor.h b/src/ivi-compositor.h
index dff11b9..7302348 100644
--- a/src/ivi-compositor.h
+++ b/src/ivi-compositor.h
@@ -261,6 +261,7 @@ struct ivi_surface {
struct ivi_compositor *ivi;
struct weston_desktop_surface *dsurface;
struct weston_view *view;
+ struct ivi_output *hidden_layer_output;
struct wl_list link;
int focus_count;
diff --git a/src/layout.c b/src/layout.c
index 86b4b7f..03ac814 100644
--- a/src/layout.c
+++ b/src/layout.c
@@ -303,11 +303,43 @@ ivi_layout_add_to_hidden_layer(struct ivi_surface *surf,
app_id, ivi_layout_get_surface_role_name(surf),
ivi_output->area.width, ivi_output->area.height);
+ surf->hidden_layer_output = ivi_output;
weston_view_set_output(ev, ivi_output->output);
weston_layer_entry_insert(&ivi->hidden.view_list, &ev->layer_link);
- weston_log("Placed app_id %s, type %s in hidden layer\n",
- app_id, ivi_layout_get_surface_role_name(surf));
+ weston_log("Placed app_id %s, type %s in hidden layer on output %s\n",
+ app_id, ivi_layout_get_surface_role_name(surf),
+ ivi_output->output->name);
+
+ weston_compositor_schedule_repaint(ivi->compositor);
+ return;
+ }
+
+ /* we might have another output to activate */
+ if (surf->hidden_layer_output &&
+ surf->hidden_layer_output != ivi_output) {
+ weston_layer_entry_remove(&ev->layer_link);
+
+ if (ivi_output->area.width != surf->hidden_layer_output->area.width &&
+ ivi_output->area.height != surf->hidden_layer_output->area.height) {
+ weston_desktop_surface_set_maximized(dsurf, true);
+ weston_desktop_surface_set_size(dsurf,
+ ivi_output->area.width,
+ ivi_output->area.height);
+ }
+
+ weston_log("Setting app_id %s, role %s, set to maximized (%dx%d)\n",
+ app_id, ivi_layout_get_surface_role_name(surf),
+ ivi_output->area.width, ivi_output->area.height);
+
+ surf->hidden_layer_output = ivi_output;
+ weston_view_set_output(ev, ivi_output->output);
+ weston_layer_entry_insert(&ivi->hidden.view_list, &ev->layer_link);
+ weston_log("Placed app_id %s, type %s in hidden layer on output %s\n",
+ app_id, ivi_layout_get_surface_role_name(surf),
+ ivi_output->output->name);
}
+
+ weston_compositor_schedule_repaint(ivi->compositor);
}
void