summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)
{