screen_destroy_window()

Destroy a window and free associated resources.

Synopsis:

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

Arguments:

win

The handle of the window to be destroyed. This must have been created with screen_create_window().

Library:

libscreen

Description:

Function Type: Flushing Execution

This function destroys the window associated with the given window handle. If the window is visible, it is removed from the display. Any resources or buffers created for this window, both locally and by the composition manager, are released.

The window handle can no longer be used as argument to subsequent screen calls. Buffers that are not created by the composition manager and registered with screen_attach_window_buffers() are not freed by this operation.

The application is responsible for releasing its own external buffers. Any window that shares buffers with the window is also destroyed. screen_destroy_window() must be used to free windows that were obtained by querying context or event properties. In this case, the window is not removed from its display and destroyed. Only the local state associated with the external window is released.

Returns:

0 if the specified window was destroyed, 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.