// handle the currently active surface
if (papp->ioutput->active) {
+ int width_prev_app = 0;
+
+ if (papp_tile->width > 0) {
+ if (papp_tile->orientation == AGL_SHELL_TILE_ORIENTATION_TOP ||
+ papp_tile->orientation == AGL_SHELL_TILE_ORIENTATION_BOTTOM)
+ width_prev_app = papp->ioutput->area.height - papp_tile->width;
+ else
+ width_prev_app = papp->ioutput->area.width - papp_tile->width;
+ }
_ivi_set_shell_surface_split(papp->ioutput->active, NULL,
- reverse_orientation(papp_tile->orientation), false);
+ reverse_orientation(papp_tile->orientation),
+ width_prev_app, false);
}
surface->role = IVI_SURFACE_ROLE_TILE;
wl_list_insert(&surface->ivi->surfaces, &surface->link);
_ivi_set_shell_surface_split(surface, papp->ioutput,
- papp_tile->orientation, true);
+ papp_tile->orientation, papp_tile->width, true);
/* remove it from pending */
wl_list_remove(&papp->link);
void
_ivi_set_shell_surface_split(struct ivi_surface *surface, struct ivi_output *ioutput,
- uint32_t orientation, bool to_activate)
+ uint32_t orientation, uint32_t width, bool to_activate)
{
struct ivi_compositor *ivi = surface->ivi;
struct weston_geometry geom = {};
struct ivi_output *output = NULL;
- int width, height;
+ int new_width, new_height;
int x, y;
geom = weston_desktop_surface_get_geometry(surface->dsurface);
if (!output)
output = ioutput;
- width = output->area.width;
- height = output->area.height;
-
+ // if we don't supply a width we automatically default to doing a half
+ // split, each window taking half of the current output
switch (orientation) {
case AGL_SHELL_TILE_ORIENTATION_LEFT:
case AGL_SHELL_TILE_ORIENTATION_RIGHT:
- width /= 2;
+ if (width == 0) {
+ new_width = output->area.width / 2;
+ new_height = output->area.height;
+ } else {
+ new_width = width;
+ new_height = output->area.height;
+ }
break;
case AGL_SHELL_TILE_ORIENTATION_TOP:
case AGL_SHELL_TILE_ORIENTATION_BOTTOM:
- height /= 2;
+ if (width == 0) {
+ new_width = output->area.width;
+ new_height = output->area.height / 2;
+ } else {
+ new_width = output->area.width;
+ new_height = width;
+ }
break;
case AGL_SHELL_TILE_ORIENTATION_NONE:
+ new_width = output->area.width;
+ new_height = output->area.height;
break;
default:
/* nothing */
y = output->area.y - geom.y;
if (orientation == AGL_SHELL_TILE_ORIENTATION_RIGHT)
- x += width;
+ x += output->area.width - new_width;
else if (orientation == AGL_SHELL_TILE_ORIENTATION_BOTTOM)
- y += height;
+ y += output->area.height - new_height;
+
if (to_activate) {
struct weston_view *ev = surface->view;
}
weston_view_set_position(surface->view, x, y);
- weston_desktop_surface_set_size(surface->dsurface, width, height);
+ weston_desktop_surface_set_size(surface->dsurface, new_width, new_height);
weston_desktop_surface_set_orientation(surface->dsurface, orientation);
surface->orientation = orientation;
weston_compositor_schedule_repaint(ivi->compositor);
-
- weston_log("%s() Setting to x=%d, y=%d, width=%d, height=%d, orientation=%d\n",
- __func__, x, y, width, height, orientation);
-
}
static int
if (output->previous_active && output->background != output->previous_active) {
struct weston_view *ev = output->previous_active->view;
+ int width_prev_app = 0;
if (!weston_view_is_mapped(ev))
weston_view_update_transform(ev);
weston_layer_entry_insert(&ivi->normal.view_list, &ev->layer_link);
+ /* a 0 width means we have no explicit width set-up */
+ if (width > 0) {
+ if (orientation == AGL_SHELL_TILE_ORIENTATION_TOP ||
+ orientation == AGL_SHELL_TILE_ORIENTATION_BOTTOM)
+ width_prev_app = output->area.height - width;
+ else
+ width_prev_app = output->area.width - width;
+ }
+
_ivi_set_shell_surface_split(output->previous_active, NULL,
- reverse_orientation(orientation), false);
+ reverse_orientation(orientation),
+ width_prev_app, false);
if (orientation == AGL_SHELL_TILE_ORIENTATION_NONE &&
output->active == surf) {
}
}
- _ivi_set_shell_surface_split(surf, NULL, orientation, false);
+ _ivi_set_shell_surface_split(surf, NULL, orientation, width, false);
}
static void