[IVI_SURFACE_ROLE_SPLIT_V] = "SPLIT_V",
[IVI_SURFACE_ROLE_FULLSCREEN] = "FULLSCREEN",
[IVI_SURFACE_ROLE_REMOTE] = "REMOTE",
+ [IVI_SURFACE_ROLE_TILE] = "TILE",
};
const char *
woutput->x + output->area.x,
woutput->y + output->area.y);
+ surf->orientation = AGL_SHELL_TILE_ORIENTATION_NONE;
+ weston_desktop_surface_set_orientation(surf->dsurface,
+ surf->orientation);
+
view->is_mapped = true;
surf->mapped = true;
view->surface->is_mapped = true;
return NULL;
}
+
+static void
+ivi_layout_add_to_hidden_layer(struct ivi_surface *surf,
+ struct ivi_output *ivi_output)
+{
+ struct weston_desktop_surface *dsurf = surf->dsurface;
+ struct weston_view *ev = surf->view;
+ struct ivi_compositor *ivi = surf->ivi;
+ const char *app_id = weston_desktop_surface_get_app_id(dsurf);
+
+ 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);
+ /*
+ * If the view isn't mapped, we put it onto the hidden layer so it will
+ * start receiving frame events, and will be able to act on our
+ * configure event.
+ */
+ if (!weston_view_is_mapped(ev)) {
+ ev->is_mapped = true;
+ ev->surface->is_mapped = true;
+
+ 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));
+ }
+}
+
void
ivi_layout_desktop_committed(struct ivi_surface *surf)
{
if (!surf->ivi->activate_by_default) {
weston_log("Refusing to activate surface role %d, app_id %s\n",
surf->role, app_id);
+
+ if (!weston_desktop_surface_get_maximized(dsurf) ||
+ geom.width != r_output->area.width ||
+ geom.height != r_output->area.height)
+ ivi_layout_add_to_hidden_layer(surf, r_output);
+
return;
}
!surface->mapped)
return;
- if (surface->view->is_mapped)
+ if (surface->view->is_mapped || surface->state == HIDDEN)
return;
assert(surface->role == IVI_SURFACE_ROLE_POPUP);
ivi_compute_popup_position(woutput, view,
surface->popup.x, surface->popup.y, &new_x, &new_y);
weston_view_set_position(view, new_x, new_y);
+ weston_view_update_transform(view);
/* only clip the pop-up dialog window if we have a valid
* width and height being passed on. Users might not want to have one
if (!surface->mapped)
surface->mapped = true;
+ surface->state = NORMAL;
ivi_layout_popup_committed(surface);
}
{
struct ivi_compositor *ivi = output->ivi;
struct weston_desktop_surface *dsurf;
- struct weston_view *view;
struct weston_geometry geom;
struct ivi_policy *policy = output->ivi->policy;
dsurf = surf->dsurface;
- view = surf->view;
const char *app_id = weston_desktop_surface_get_app_id(dsurf);
return;
}
+ /* reset tile to desktop to allow to resize correctly */
+ if (surf->role == IVI_SURFACE_ROLE_TILE && output->active == surf)
+ surf->role = IVI_SURFACE_ROLE_DESKTOP;
+
/* do not 're'-activate surfaces that are split or active */
- if (surf == output->active ||
- ivi_layout_surface_is_split_or_fullscreen(surf))
+ if ((surf == output->active && surf->role != IVI_SURFACE_ROLE_DESKTOP) ||
+ ivi_layout_surface_is_split_or_fullscreen(surf)) {
+ weston_log("Found split || fullscreen surface. Refusing to activate!\n");
return;
+ }
if (surf->role == IVI_SURFACE_ROLE_REMOTE) {
struct ivi_output *remote_output =
return;
}
- weston_desktop_surface_set_maximized(dsurf, true);
- weston_desktop_surface_set_size(dsurf,
- output->area.width,
- 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),
- output->area.width, output->area.height);
- /*
- * If the view isn't mapped, we put it onto the hidden layer so it will
- * start receiving frame events, and will be able to act on our
- * configure event.
- */
- if (!weston_view_is_mapped(view)) {
- view->is_mapped = true;
- view->surface->is_mapped = true;
-
- weston_view_set_output(view, output->output);
- weston_layer_entry_insert(&ivi->hidden.view_list, &view->layer_link);
- weston_log("Placed app_id %s, type %s in hidden layer\n",
- app_id, ivi_layout_get_surface_role_name(surf));
- }
+ ivi_layout_add_to_hidden_layer(surf, output);
}
void
break;
case IVI_SURFACE_ROLE_NONE:
default:
+ if (surf->view->output)
+ return to_ivi_output(surf->view->output);
break;
}
} else if (surf->role == IVI_SURFACE_ROLE_POPUP) {
struct weston_view *view = surf->view;
+ weston_view_unmap(view);
+ surf->state = HIDDEN;
+
weston_layer_entry_remove(&view->layer_link);
weston_view_geometry_dirty(view);
weston_surface_damage(view->surface);