meson.build: Increase to libweston8 dependency
[src/agl-compositor.git] / src / layout.c
index b531ed1..9537034 100644 (file)
@@ -243,12 +243,20 @@ ivi_layout_desktop_committed(struct ivi_surface *surf)
        output = surf->desktop.pending_output;
        if (!output) {
                struct ivi_output *ivi_bg_output;
+               struct ivi_policy *policy = surf->ivi->policy;
+
+               if (policy && policy->api.surface_activate_by_default)
+                       if (policy->api.surface_activate_by_default(surf, surf->ivi))
+                               goto skip_config_check;
 
-               /* FIXME: This should be changed to determine if the policy
-                * database allows that to happen */
                if (!surf->ivi->quirks.activate_apps_by_default)
                        return;
 
+skip_config_check:
+               /* we can only activate it again by using the protocol */
+               if (surf->activated_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
@@ -256,8 +264,10 @@ ivi_layout_desktop_committed(struct ivi_surface *surf)
                if (surf->view && ivi_bg_output) {
                        const char *app_id =
                                weston_desktop_surface_get_app_id(dsurf);
-                       if (app_id && ivi_bg_output)
+                       if (app_id && ivi_bg_output) {
                                ivi_layout_activate(ivi_bg_output, app_id);
+                               surf->activated_by_default = true;
+                       }
                }
 
                return;