clients: window.c, This is in the wrong place. ivi_surface should be
created with the window, not with the underlying wl_surface or buffers.

        if (!surface->toysurface) {
        uint32_t id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid();
        surface->window->ivi_surface =
        ivi_application_surface_create(display->ivi_application,
        id_ivisurf, surface->surface);
        if (surface->window->ivi_surface == NULL) {
        fprintf(stderr, "Failed to create ivi_client_surface\n");
        abort();
        } +
        ivi_surface_add_listener(surface->window->ivi_surface,
        &ivi_surface_listener, surface->window);
        }
        }

This is in the wrong place. ivi_surface should be created with the
window, not with the underlying wl_surface or buffers.

This code should be in window_create(), the same place as
xdg_shell_get_xdg_surface() is used. Make sure you cannot create both
xdg_surface and ivi_surface, if both xdg_shell and ivi_shell are
advertised by the compositor.

When you create ivi_surface in window_create(), that automatically means
that window_create_custom() will not create a ivi_surface. That should
finally fix the virtual keyboard application, so that you do not need
the strcmp(surface->window->title,"Virtual keyboard") hack.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
clients: window.c,
surface->toysurface->destroy(surface->toysurface);

        if (surface->window->display->ivi_application)
        {
        ivi_surface_destroy(surface->window->ivi_surface);
        ivi_application_destroy(surface->window->display->ivi_application);

I don't think this is the right place to destroy ivi_application. This
means that the ivi_application is destroyed when the first window is
destroyed, which prevents opening any new windows.

Maybe it would be best to replace this hunk with just:

if (surface->window->ivi_surface)
ivi_surface_destroy(surface->window->ivi_surface);

Note, that your destruction order is also funny: the wl_surface gets
destroyed before the ivi_surface. Maybe that should be the other way
around?

Finally, I think this is the wrong place to destroy ivi_surface
altogether. ivi_surface is a shell surface, and it should be destroyed
with the window, just like xdg_surface is. That is, in window_destroy(),
in similar way as xdg_surface_destroy() is called.

ivi_surface is similar to xdg_surface here, not wl_surface.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>