Make window content updates visible on the display.


#include <screen/screen.h>
int screen_post_window(screen_window_t win, screen_buffer_t buf, int count, const int *dirty_rects, int flags)



The handle for the window whose content has changed.


The rendering buffer of the window that contains the changes needed to be made visible.


The number of rectangles provided in the dirty_rects argument.


An array of integers containing the x1, y1, x2, and y2 coordinates of a rectangle that bounds the area of the rendering buffer that has changed since the last posting of the window. The dirty_rects argument must provide at least count * 4 integers.


A bitmask that can be used to alter the default posting behaviour. Valid flags are of type Screen_Flushing_Types.




Function Type: Apply Execution

This function makes some pixels in a rendering buffer visible. The pixels to be posted are defined by the dirty rectangles contained in the dirty_rects argument.

The function may cause the SCREEN_PROPERTY_RENDER_BUFFERS of the window to change. The presentation of new content may result in a copy or a buffer flip, depending on how the composited windowing system chooses to perform the operation.

At a minimum, this function will block until another buffer becomes available. If SCREEN_WAIT_IDLE is set in the flags, the function will return only when the contents of the display have been updated. Note that a window will not be made visible until screen_post_window() has been called at least once.

If the window is currently locked, posting updates has the effect of flushing all pending property changes and blocks until all other locked windows have released the lock or posted updates of their own. In this case, the window remains locked when screen_post_window() returns, and any subsequent property change is delayed until the window lock is released or another frame is posted.

If count is 0, the buffer is discarded and a new set of rendering buffers is returned. The current front buffer remains unchanged and the contents of the screen will not be updated.


0 if the area of the rendering buffer that is marked dirty has updated on the screen and a new set of rendering buffers was returned (this new set of buffers can be used for the next updates), or -1 if an error occurred (errno is set).