struct ivi_surface *surface)
{
struct desktop_client *dclient;
+ static bool display_adv = false;
if (surface->advertised_on_launch)
return;
const char *app_id =
weston_desktop_surface_get_app_id(surface->dsurface);
if (app_id == NULL) {
- weston_log("WARNING app_is is null, unable to advertise\n");
+ if (!display_adv) {
+ weston_log("WARNING app_is is null, unable to advertise\n");
+ display_adv = true;
+ }
return;
}
agl_shell_desktop_send_application(dclient->resource, app_id);
agl_shell_desktop_advertise_application_id(ivi, surface);
}
+#ifdef HAVE_WALTHAM
void
ivi_destroy_waltham_destroy(struct ivi_surface *surface)
{
api->surface_push_to_remote(weston_surface, app_id, trans_remote, NULL);
}
+#else
+void
+ivi_destroy_waltham_destroy(struct ivi_surface *surface)
+{
+}
+static void
+ivi_output_notify_waltham_plugin(struct ivi_surface *surface)
+{
+}
+#endif
+
static void
ivi_set_desktop_surface_remote(struct ivi_surface *surface)
{
free(remote);
}
+static bool
+ivi_compositor_keep_pending_surfaces(struct ivi_surface *surface)
+{
+ return surface->ivi->keep_pending_surfaces;
+}
+
static bool
ivi_check_pending_desktop_surface_popup(struct ivi_surface *surface)
{
surface->popup.bb.width = p_popup->bb.width;
surface->popup.bb.height = p_popup->bb.height;
- ivi_remove_pending_desktop_surface_popup(p_popup);
+ if (!ivi_compositor_keep_pending_surfaces(surface))
+ ivi_remove_pending_desktop_surface_popup(p_popup);
return true;
}
}
if (!strcmp(_app_id, split_surf->app_id)) {
surface->split.output = split_surf->ioutput;
surface->split.orientation = split_surf->orientation;
- ivi_remove_pending_desktop_surface_split(split_surf);
+ if (!ivi_compositor_keep_pending_surfaces(surface))
+ ivi_remove_pending_desktop_surface_split(split_surf);
return true;
}
}
&ivi->fullscreen_pending_apps, link) {
if (!strcmp(_app_id, fs_surf->app_id)) {
surface->fullscreen.output = fs_surf->ioutput;
- ivi_remove_pending_desktop_surface_fullscreen(fs_surf);
+ if (!ivi_compositor_keep_pending_surfaces(surface))
+ ivi_remove_pending_desktop_surface_fullscreen(fs_surf);
return true;
}
}
&ivi->remote_pending_apps, link) {
if (!strcmp(_app_id, remote_surf->app_id)) {
surface->remote.output = remote_surf->ioutput;
- ivi_remove_pending_desktop_surface_remote(remote_surf);
+ if (!ivi_compositor_keep_pending_surfaces(surface))
+ ivi_remove_pending_desktop_surface_remote(remote_surf);
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool
+ivi_check_pending_surface(struct ivi_surface *surface)
+{
+ struct ivi_compositor *ivi = surface->ivi;
+ struct wl_list *role_pending_list;
+ struct pending_popup *p_popup;
+ struct pending_split *p_split;
+ struct pending_fullscreen *p_fullscreen;
+ struct pending_remote *p_remote;
+ const char *app_id =
+ weston_desktop_surface_get_app_id(surface->dsurface);
+
+ if (!app_id)
+ return false;
+
+ role_pending_list = &ivi->popup_pending_apps;
+ wl_list_for_each(p_popup, role_pending_list, link) {
+ if (!strcmp(app_id, p_popup->app_id)) {
+ return true;
+ }
+ }
+
+ role_pending_list = &ivi->split_pending_apps;
+ wl_list_for_each(p_split, role_pending_list, link) {
+ if (!strcmp(app_id, p_split->app_id)) {
+ return true;
+ }
+ }
+
+ role_pending_list = &ivi->fullscreen_pending_apps;
+ wl_list_for_each(p_fullscreen, role_pending_list, link) {
+ if (!strcmp(app_id, p_fullscreen->app_id)) {
+ return true;
+ }
+ }
+
+ role_pending_list = &ivi->remote_pending_apps;
+ wl_list_for_each(p_remote, role_pending_list, link) {
+ if (!strcmp(app_id, p_remote->app_id)) {
return true;
}
}
+ /* else, we are a regular desktop surface */
return false;
}
weston_layer_entry_remove(&view->layer_link);
weston_view_update_transform(view);
- weston_output_damage(output->output);
+ weston_view_damage_below(view);
}
void
view->surface->is_mapped = true;
weston_view_update_transform(view);
- weston_output_damage(output->output);
+ weston_view_damage_below(view);
}
static void
wl_list_for_each_safe(surface, tmp, &ivi->pending_surfaces, link) {
wl_list_remove(&surface->link);
+ wl_list_init(&surface->link);
ivi_check_pending_desktop_surface(surface);
+ surface->checked_pending = true;
}
}
return;
}
+ surface->checked_pending = true;
surface->role = IVI_SURFACE_ROLE_BACKGROUND;
surface->bg.output = output;
wl_list_remove(&surface->link);
return;
}
+ surface->checked_pending = true;
surface->role = IVI_SURFACE_ROLE_PANEL;
surface->panel.output = output;
surface->panel.edge = edge;
}
}
+static void
+ivi_compositor_destroy_pending_surfaces(struct ivi_compositor *ivi)
+{
+ struct pending_popup *p_popup, *next_p_popup;
+ struct pending_split *split_surf, *next_split_surf;
+ struct pending_fullscreen *fs_surf, *next_fs_surf;
+ struct pending_remote *remote_surf, *next_remote_surf;
+
+ wl_list_for_each_safe(p_popup, next_p_popup,
+ &ivi->popup_pending_apps, link)
+ ivi_remove_pending_desktop_surface_popup(p_popup);
+
+ wl_list_for_each_safe(split_surf, next_split_surf,
+ &ivi->split_pending_apps, link)
+ ivi_remove_pending_desktop_surface_split(split_surf);
+
+ wl_list_for_each_safe(fs_surf, next_fs_surf,
+ &ivi->fullscreen_pending_apps, link)
+ ivi_remove_pending_desktop_surface_fullscreen(fs_surf);
+
+ wl_list_for_each_safe(remote_surf, next_remote_surf,
+ &ivi->remote_pending_apps, link)
+ ivi_remove_pending_desktop_surface_remote(remote_surf);
+}
+
+static void
+shell_desktop_set_app_property_mode(struct wl_client *client,
+ struct wl_resource *shell_res, uint32_t perm)
+{
+ struct desktop_client *dclient = wl_resource_get_user_data(shell_res);
+ if (perm) {
+ dclient->ivi->keep_pending_surfaces = true;
+ } else {
+ dclient->ivi->keep_pending_surfaces = false;
+ /* remove any previous pending surfaces */
+ ivi_compositor_destroy_pending_surfaces(dclient->ivi);
+ }
+}
+
static const struct agl_shell_desktop_interface agl_shell_desktop_implementation = {
.activate_app = shell_desktop_activate_app,
.set_app_property = shell_desktop_set_app_property,
.deactivate_app = shell_deactivate_app,
+ .set_app_property_mode = shell_desktop_set_app_property_mode,
};
static void
}
ivi->agl_shell_desktop = wl_global_create(ivi->compositor->wl_display,
- &agl_shell_desktop_interface, 1,
+ &agl_shell_desktop_interface, 2,
ivi, bind_agl_shell_desktop);
if (!ivi->agl_shell_desktop) {
weston_log("Failed to create wayland global (agl_shell_desktop).\n");