Send a request to the composition manager to destroy buffers of the specified window.


#include <screen/screen.h>
int screen_destroy_window_buffers(screen_window_t win)



The handle of the window whose buffer(s) you want to destroy.




Function Type: Flushing Execution

This function releases one or more buffers allocated for the specified window, without destroying the window. If buffers were created with screen_create_window_buffers(), the memory is released and can be used for other window or pixmap buffers. If buffers were attached using screen_attach_window_buffers(), these buffers are destroyed but no memory is actually released. In this case, the application is responsible for freeing the memory after calling screen_destroy_window_buffers(). Once a window's buffers have been destroyed, you can change the format, the usage and the buffer size before creating any new buffers 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.


0 if the memory used by the window buffer was freed, or -1 if an error occurred (errno is set; refer to /usr/include/errno.h for more details). Note that the error may also have been caused by any delayed execution function that's just been flushed.