Create a reference to a window.


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



The handle of the window for which the reference is to be created.




Function Type: Immediate Execution

This function creates a reference to a window. This function can be used by window managers and group parents to prevent a window from disappearing, even when the process that originally created the window terminates abnormally. If this happens, ownership of the window is transferred to the window manager or group parent. The restrictions imposed on buffers still exist. The contents of the buffers can't be changed. The buffers cannot be destroyed until the window is unreferenced. When the original process owner is no longer a client of the windowing system, the window will be destroyed when screen_destroy_window() is called by the reference owner.


0 if a reference to the specified window was created, or -1 if an error occurred (errno is set; refer to /usr/include/errno.h for more details).