+ if (surf->role == IVI_SURFACE_ROLE_REMOTE && output) {
+ const char *app_id;
+
+ if (policy && policy->api.surface_activate_by_default &&
+ !policy->api.surface_activate_by_default(surf, surf->ivi))
+ return;
+
+ app_id = weston_desktop_surface_get_app_id(dsurf);
+ if (app_id) {
+ ivi_layout_activate(output, app_id);
+
+ /* we transition to the desktop role from remote one,
+ * as they're basically one and the same, but in order
+ * to keep the same functionality (that is to display
+ * it by default when starting), we need to know the
+ * output before hand, fact that that is not true for,
+ * regular desktop ones.
+ */
+ surf->role = IVI_SURFACE_ROLE_DESKTOP;
+ surf->activated_by_default = true;
+ }
+ return;
+ }
+