wl_surface.attach with NULL wl_buffer behaviour

Prabhu S prabhusundar at gmail.com
Fri Aug 21 10:03:43 PDT 2015


Hi,
Based on the wayland protocol specification for wl_surface::attach
>>If wl_surface.attach is sent with a NULL wl_buffer, the following
wl_surface.commit will remove the surface content.

Wondering if wl_surface_attach called with wl_buffer=NULL, will there be
any wl_buffer release event or frame callbacks?

Modified the redraw in simple-shm.c as below and not receiving any callback
or buffer release. It just got stuck.
The same thing is being done in qtwayland to hide the surface and it is
getting stuck. Some help to check this case would be helpful.

static int odd = 1;
if(odd == 1){
        wl_surface_attach(window->surface, buffer->buffer, 0, 0);
        wl_surface_damage(window->surface,
                          20, 20, window->width - 40, window->height -
40);
        odd = 0;
    }
    else{
            wl_surface_attach(window->surface, 0, 0, 0);
            wl_surface_damage(window->surface,
                          0, 0, 0, 0);
            odd=1;
    }



[823379.816]  -> wl_compositor at 4.create_surface(new id wl_surface at 3)
[823379.949]  -> xdg_shell at 6.get_xdg_surface(new id xdg_surface at 7,
wl_surface at 3)
[823380.120]  -> xdg_surface at 7.set_title("simple-shm")
[823380.244]  -> wl_surface at 3.damage(0, 0, 250, 250)
[823381.333]  -> wl_shm at 5.create_pool(new id wl_shm_pool at 8, fd 5, 250000)
[823381.561]  -> wl_shm_pool at 8.create_buffer(new id wl_buffer at 9, 0, 250,
250, 1000, 1)
[823381.870]  -> wl_shm_pool at 8.destroy()
[823384.880]  -> wl_surface at 3.attach(wl_buffer at 9, 0, 0)
[823385.095]  -> wl_surface at 3.damage(20, 20, 210, 210)
[823385.317]  -> wl_surface at 3.frame(new id wl_callback at 10)
[823385.443]  -> wl_surface at 3.commit()
[823388.852] wl_display at 1.delete_id(8)
[823388.979] xdg_surface at 7.configure(0, 0, array, 4)
[823389.238]  -> xdg_surface at 7.ack_configure(4)
[823401.773] wl_display at 1.delete_id(10)
[823401.908] wl_buffer at 9.release()
[823401.991] wl_callback at 10.done(4056537)
[823404.239]  -> wl_surface at 3.attach(nil, 0, 0)
[823404.442]  -> wl_surface at 3.damage(0, 0, 0, 0)
[823404.663]  -> wl_surface at 3.frame(new id wl_callback at 10)
[823404.792]  -> wl_surface at 3.commit()
[823406.292] xdg_surface at 7.configure(0, 0, array, 5)
[823406.524]  -> xdg_surface at 7.ack_configure(5)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20150821/af9c6bcc/attachment-0001.html>


More information about the wayland-devel mailing list