<div dir="auto">Hi team,<div dir="auto"><br></div><div dir="auto">I wrote a user app which is capable of displaying a surface. It works perfectly on xdg shell ,but when switching to ivi shell it doesn,t. I could know that there are differences in protocols,thats why it happens and there is one way that we can wrap xdg in ivi shell.But I am not aware of doing that.</div><div dir="auto"><br></div><div dir="auto">Following are the code snipet that works for me in xdg..(tested in raspberry pi )</div><div dir="auto">Does anybody have any clue ? Any help is appreciated.. </div><div dir="auto">Thanks in advance.<br><div dir="auto"><div style="font-family:wf_segoe-ui_normal,"segoe ui","segoe wp",tahoma,arial,sans-serif;font-size:medium;background-color:rgb(255,255,255)" dir="auto"><div style="border-color:rgb(234,234,234);margin:0px 15px;border-bottom-width:2px;border-bottom-style:solid;min-width:230px" dir="auto"><div style="min-height:70px;padding:13px 0px 34px"><div><div><div><div style="margin:0px;padding:0px"><div style="color:rgb(200,200,200)"></div></div><div style="outline:none;width:330px;display:table;vertical-align:middle;white-space:nowrap"></div></div></div></div><div style="width:auto;padding:0px;word-wrap:break-word"><div style="font-family:'wf_segoe-ui_normal','segoe ui','segoe wp','tahoma','arial',sans-serif,serif,'emojifont';color:rgb(51,51,51);font-size:15px"><div dir="ltr"><div dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:'calibri','helvetica',sans-serif,serif,'emojifont'"><p style="margin-top:0px;margin-bottom:0px"><br></p><p style="margin-top:0px;margin-bottom:0px"></p><div>#include <stdio.h><br>#include <string.h><br><br>#include <syscall.h><br>#include <unistd.h><br>#include <sys/mman.h><br><br>#include <wayland-client.h><br>#include <wayland-client-core.h><br><br><br>struct wl_compositor *compositor;<br>struct wl_shm *shm;<br>struct wl_shell *shell;<br><br>void registry_global_handler<br>(<br>    void *data,<br>    struct wl_registry *registry,<br>    uint32_t name,<br>    const char *interface,<br>    uint32_t version<br>) {<br>    if (strcmp(interface, "wl_compositor") == 0) {<br>        compositor = wl_registry_bind(registry, name,<br>            &wl_compositor_interface, 3);<br>    } else if (strcmp(interface, "wl_shm") == 0) {<br>        shm = wl_registry_bind(registry, name,<br>            &wl_shm_interface, 1);<br>    } else if (strcmp(interface, "wl_shell") == 0) {<br>        shell = wl_registry_bind(registry, name,<br>            &wl_shell_interface, 1);<br>    }<br>}<br><br>void registry_global_remove_handler<br>(<br>    void *data,<br>    struct wl_registry *registry,<br>    uint32_t name<br>) {}<br><br>const struct wl_registry_listener registry_listener = {<br>    .global = registry_global_handler,<br>    .global_remove = registry_global_remove_handler<br>};<br><br>int main(void)<br>{<br>    struct wl_display *display = wl_display_connect(NULL);<br>    struct wl_registry *registry = wl_display_get_registry(display);<br>    wl_registry_add_listener(registry, &registry_listener, NULL);<br><br>    // wait for the "initial" set of globals to appear<br>    wl_display_roundtrip(display);<br><br>    struct wl_surface *surface = wl_compositor_create_surface(compositor);<br>    struct wl_shell_surface *shell_surface = wl_shell_get_shell_surface(shell, surface);<br>    wl_shell_surface_set_toplevel(shell_surface);<br><br>    int width = 108;<br>    int height = 192;<br>    int stride = width * 4;<br>    int size = stride * height;  // bytes<br><br>    // open an anonymous file and write some zero bytes to it<br>    int fd = syscall(SYS_memfd_create, "buffer", 0);<br>    ftruncate(fd, size);<br><br>    // map it to the memory<br>    unsigned char *data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);<br>   int temp=0;<br>   <br>struct wl_shm_pool *pool = wl_shm_create_pool(shm, fd, size);<br><br>    // allocate the buffer in that pool<br>    struct wl_buffer *buffer = wl_shm_pool_create_buffer(pool,<br>        0, width, height, stride, WL_SHM_FORMAT_ARGB8888);<br><br>    wl_surface_attach(surface, buffer, 0, 0);<br>    <br>  <br><br>while(1){<br>printf("%d\n",temp);<br>temp++;<br>for (int x = 0; x < width; x++) {<br>    for (int y = 0; y < height; y++) {<br><br>        struct pixel {<br>            // little-endian ARGB<br>            unsigned char blue;<br>            unsigned char green;<br>            unsigned char red;<br>            unsigned char alpha;<br>        } *px = (struct pixel *) (data + y * stride + x * 4);<br><br>        // yellow<br>        px->alpha = 255;<br>                  if(temp >100)<br>    {<br>     px->red = 100;<br>        px->green = 0;<br>         px->blue = 0;<br>    <br>    }<br>    else <br>    {<br>        <br>        px->red = 0;<br>        px->green = 100;<br>        px->blue = 0;<br>        //if(y==(height/2))<br>        //break;<br>        }<br>    }<br>}<br><br>      <br>usleep(50*1000);<br>    // turn it into a shared memory pool<br> wl_surface_commit(surface);    <br>     wl_display_flush(display);<br>/* wl_display_destroy(display);*/<br>  <br><br><br>    }<br>}</div><div dir="auto"><br></div><div dir="auto">Cheers,</div><div dir="auto">Stuvart</div><div dir="auto"><br></div></div></div></div></div></div></div></div></div></div></div>