xcb: Only print the first error and ignore subsequent ones

It is quite likely that following errors are caused by the previous ones. To
avoid flooding users we now silently discard all the errors and events after the
first one.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2011-01-04 13:05:03 +01:00
parent 8a65279ee1
commit f8277dfdaf

View file

@ -594,7 +594,7 @@ _cairo_boilerplate_xcb_finish_surface (cairo_surface_t *surface)
if (cairo_surface_status (surface))
return cairo_surface_status (surface);
while ((ev = xcb_poll_for_event (xtc->c)) != NULL) {
if ((ev = xcb_poll_for_event (xtc->c)) != NULL) {
if (ev->response_type == CAIRO_XCB_ERROR) {
xcb_generic_error_t *error = (xcb_generic_error_t *) ev;
@ -614,6 +614,10 @@ _cairo_boilerplate_xcb_finish_surface (cairo_surface_t *surface)
}
free (ev);
/* Silently discard all following errors */
while ((ev = xcb_poll_for_event (xtc->c)) != NULL)
free (ev);
return CAIRO_STATUS_WRITE_ERROR;
}