+
+ if (surf->remote.output)
+ surf->hidden_layer_output = surf->remote.output;
+ else
+ surf->hidden_layer_output = desktop_last_output;
+ assert(surf->hidden_layer_output);
+
+ if (ivi_surface_count_one(current_completed_output, IVI_SURFACE_ROLE_REMOTE) ||
+ ivi_surface_count_one(current_completed_output, IVI_SURFACE_ROLE_DESKTOP)) {
+ if (!current_completed_output->background)
+ insert_black_curtain(current_completed_output);
+ } else {
+ ivi_layout_deactivate(ivi, app_id);
+ }
+
+ /* update the remote output */
+ surf->remote.output = ioutput;
+
+ if (surf->role != IVI_SURFACE_ROLE_REMOTE) {
+ wl_list_remove(&surf->link);
+ wl_list_init(&surf->link);
+
+ surf->role = IVI_SURFACE_ROLE_NONE;
+ ivi_set_desktop_surface_remote(surf);
+ }
+
+ shell_send_app_on_output(ivi, app_id, woutput->name);