X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fdesktop.c;h=f3ea82b3ab55cffa1e4391fd1cd341c9aacec1cf;hb=60e91c02c365355a94441eddc1851babeb440c73;hp=eaace1922defb972b3cf0f59264926aac95d159c;hpb=1dc043f95e9e1d3c83901fdc93186b7327e86e89;p=src%2Fagl-compositor.git diff --git a/src/desktop.c b/src/desktop.c index eaace19..f3ea82b 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -24,6 +24,7 @@ */ #include "ivi-compositor.h" +#include "policy.h" #include #include @@ -80,6 +81,13 @@ desktop_surface_added(struct weston_desktop_surface *dsurface, void *userdata) surface->dsurface = dsurface; surface->role = IVI_SURFACE_ROLE_NONE; + if (ivi->policy->api.surface_create && + !ivi->policy->api.surface_create(surface, ivi)) { + free(surface); + wl_client_post_no_memory(client); + return; + } + weston_desktop_surface_set_user_data(dsurface, surface); if (ivi->shell_client.ready) { @@ -131,6 +139,12 @@ desktop_committed(struct weston_desktop_surface *dsurface, { struct ivi_surface *surface = weston_desktop_surface_get_user_data(dsurface); + struct ivi_policy *policy = surface->ivi->policy; + + if (policy->api.surface_commited && + !policy->api.surface_commited(surface, surface->ivi)) + return; + weston_compositor_schedule_repaint(surface->ivi->compositor); switch (surface->role) {