mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-16 09:40:33 +01:00
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:
parent
8a65279ee1
commit
f8277dfdaf
1 changed files with 5 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue