summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2024-01-30 17:34:24 +0200
committerMarius Vlad <marius.vlad@collabora.com>2024-02-22 13:51:33 +0000
commit083ee3d2b88f49612dfab230990e54c3edbf3aef (patch)
tree80f4886a6d11027a4f858b1092ea176cd53399d5
parent1cbb6bdec4d1c0440356240e481e8dfa51a201f2 (diff)
layout/shell: Reset split type of windows
This change would reset to default (none) orientation when activating a different window, than those split and currently active. The use-case is that when activating a different window all previous split ones would reset to their original state (none orientation), such that when the user tries to activate any former split windows it would get the window without being split plus the other active window in the same time. IOW going back and activating an former split window would also display the other window which would complicate things a bit. Bug-AGL: SPEC-4839 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I315d42b656962bf3f68f140466ab58429a0e972c
-rw-r--r--src/ivi-compositor.h4
-rw-r--r--src/layout.c41
-rw-r--r--src/shell.c6
3 files changed, 41 insertions, 10 deletions
diff --git a/src/ivi-compositor.h b/src/ivi-compositor.h
index 1c1d678..9f3cc47 100644
--- a/src/ivi-compositor.h
+++ b/src/ivi-compositor.h
@@ -541,4 +541,8 @@ is_shell_surface_xwayland(struct ivi_surface *surf);
void
ivi_layout_reset_split_surfaces(struct ivi_compositor *ivi);
+void
+_ivi_set_shell_surface_split(struct ivi_surface *surface, struct ivi_output *output,
+ uint32_t orientation, bool to_activate);
+
#endif
diff --git a/src/layout.c b/src/layout.c
index 63ef9f9..0ab7e7c 100644
--- a/src/layout.c
+++ b/src/layout.c
@@ -1036,16 +1036,47 @@ void
ivi_layout_reset_split_surfaces(struct ivi_compositor *ivi)
{
struct ivi_surface *ivisurf;
+ bool found_split_surface = false;
+ struct ivi_output *output = NULL;
wl_list_for_each(ivisurf, &ivi->surfaces, link) {
- struct weston_desktop_surface *dsurf = ivisurf->dsurface;
-
if (ivisurf->orientation != AGL_SHELL_TILE_ORIENTATION_NONE) {
- weston_log("%s() resetting apps to none orientation\n", __func__);
- ivisurf->orientation = AGL_SHELL_TILE_ORIENTATION_NONE;
- weston_desktop_surface_set_orientation(dsurf, ivisurf->orientation);
+ found_split_surface = true;
+ break;
}
}
+
+ if (!found_split_surface)
+ return;
+
+ output = ivisurf->current_completed_output;
+ if (output->previous_active) {
+ struct weston_view *ev = output->previous_active->view;
+ struct weston_output *woutput = output->output;
+
+ if (!weston_view_is_mapped(ev))
+ weston_view_update_transform(ev);
+ else
+ weston_layer_entry_remove(&ev->layer_link);
+
+ ev->is_mapped = true;
+ ev->surface->is_mapped = true;
+ output->previous_active->mapped = true;
+
+ weston_view_set_output(ev, woutput);
+
+ weston_layer_entry_insert(&ivi->normal.view_list, &ev->layer_link);
+
+ _ivi_set_shell_surface_split(output->previous_active, NULL,
+ AGL_SHELL_TILE_ORIENTATION_NONE, false);
+
+ if (output->active == ivisurf) {
+ output->active = output->previous_active;
+ }
+ }
+
+ _ivi_set_shell_surface_split(ivisurf, NULL,
+ AGL_SHELL_TILE_ORIENTATION_NONE, false);
}
void
diff --git a/src/shell.c b/src/shell.c
index 020c169..b8f096a 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -49,10 +49,6 @@
static void
create_black_curtain_view(struct ivi_output *output);
-static void
-_ivi_set_shell_surface_split(struct ivi_surface *surface, struct ivi_output *output,
- uint32_t orientation, bool to_activate);
-
static uint32_t
reverse_orientation(uint32_t orientation);
@@ -1792,7 +1788,7 @@ reverse_orientation(uint32_t orientation)
}
}
-static void
+void
_ivi_set_shell_surface_split(struct ivi_surface *surface, struct ivi_output *ioutput,
uint32_t orientation, bool to_activate)
{