Send a request to the composition manager to destroy the buffer owned by a pixmap

Function type:

Flushing execution


#include <screen/screen.h>

int screen_destroy_pixmap_buffer( screen_pixmap_t pix );


The handle of the pixmap whose buffer needs to be freed.




Call this function to release the buffer that was allocated for a pixmap, without destroying the pixmap. If the buffer was created with screen_create_pixmap_buffer(), the memory is released and can be used for other window or pixmap buffers. If the buffer was attached using screen_attach_pixmap_buffer(), the buffer is destroyed but no memory is actually released. In this case the application is responsible for freeing the memory after calling screen_destroy_pixmap_buffer(). Once a pixmap buffer has been destroyed, you can change the format, usage and buffer size before creating a new buffer again.

The memory that is released by this call is not reserved and can be used for any subsequent buffer allocation by the windowing system.


If the function succeeds, it returns 0 and the memory used by the pixmap’s buffer is freed. Otherwise, the function returns -1 and errno is set.


Windowing API

Safety  Value  
Interrupt handler No
Signal handler No
Thread Yes