Cause a window to share its buffers with a display.


#include <screen/screen.h>
int screen_share_display_buffers(screen_window_t win,
                                 screen_display_t share,
                                 int count)



The handle of the window who will be sharing its buffer(s).


The handle of the display who is sharing buffer(s).


The number of buffer st that is shared by the window to the display. A value of 0 will default to the Screen services to select the appropriate values for properties such as SCREEN_PROPERTY_FORMAT, SCREEN_PROPERTY_USAGE and SCREEN_PROPERTY_BUFFER_SIZE.




Function Type: Flushing Execution

This function creates a count number of buffers with the size defined by the SCREEN_PROPERTY_BUFFER_SIZE window property of win. These buffers are rendered by the windowing system. The display will be used to generate content for the (window) buffers. Once there is a post for the window win, the content of the buffers will be displayed on the display share. To share display buffers, you need to be working within a privileged context. Therefore, a context that was created with the type SCREEN_DISPLAY_MANAGER_CONTEXT must be used.

If the display has a framebuffer, then screen_share_display_buffers() is similar to screen_share_window_buffers().


0 if the window shared its buffers, or -1 of 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.