/* Informs the window manager that the window needs to be updated.  */
static int updateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects)
/* Informs the window manager that the window needs to be updated.  */
static int updateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects)
{
    window_impl_t   *impl = (window_impl_t *)window->driverdata;
    screen_buffer_t buffer;
    if (screen_get_window_property_pv(impl->window, SCREEN_PROPERTY_BUFFERS,
                                      (void **)&buffer) < 0) {
        return -1;
    }
    screen_post_window(impl->window, buffer, numrects, (int *)rects, 0);
    screen_flush_context(context, 0);
    return 0;
}