+ if (!output) {
+ struct ivi_output *ivi_bg_output;
+
+ /* FIXME: This should be changed to determine if the policy
+ * database allows that to happen */
+ if (!surf->ivi->quirks.activate_apps_by_default)
+ return;
+
+ ivi_bg_output = ivi_layout_find_bg_output(surf->ivi);
+
+ /* use the output of the bg to activate the app on start-up by
+ * default */
+ if (surf->view && ivi_bg_output) {
+ const char *app_id =
+ weston_desktop_surface_get_app_id(dsurf);
+ if (app_id && ivi_bg_output)
+ ivi_layout_activate(ivi_bg_output, app_id);
+ }
+