diff options
author | Uli Schlachter <psychon@znc.in> | 2011-01-04 12:27:33 +0100 |
---|---|---|
committer | Uli Schlachter <psychon@znc.in> | 2011-01-05 22:04:45 +0100 |
commit | 8957e506321c4dc1ca59c8a88012801509b0d338 (patch) | |
tree | f3ffb13ea45ae78677cd067511e73e53630ccb35 /boilerplate/cairo-boilerplate-xcb.c | |
parent | f0bb3a29b36f85973ba678b19c5bf057f18506ed (diff) | |
download | cairo-8957e506321c4dc1ca59c8a88012801509b0d338.tar.gz |
xcb: Handle events in boilerplate
Cairo shouldn't cause any events during a test run. Verify this by explicitly
handling events, too.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Diffstat (limited to 'boilerplate/cairo-boilerplate-xcb.c')
-rw-r--r-- | boilerplate/cairo-boilerplate-xcb.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/boilerplate/cairo-boilerplate-xcb.c b/boilerplate/cairo-boilerplate-xcb.c index c3b059c1d..aebb48762 100644 --- a/boilerplate/cairo-boilerplate-xcb.c +++ b/boilerplate/cairo-boilerplate-xcb.c @@ -592,8 +592,6 @@ _cairo_boilerplate_xcb_finish_surface (cairo_surface_t *surface) return cairo_surface_status (surface); while ((ev = xcb_poll_for_event (xtc->c)) != NULL) { - cairo_status_t status = CAIRO_STATUS_SUCCESS; - if (ev->response_type == 0 /* trust me! */) { xcb_generic_error_t *error = (xcb_generic_error_t *) ev; @@ -606,13 +604,14 @@ _cairo_boilerplate_xcb_finish_surface (cairo_surface_t *surface) "Detected error during xcb run: %d\n", error->error_code); #endif - free (error); - - status = CAIRO_STATUS_WRITE_ERROR; + } else { + fprintf (stderr, + "Detected unexpected event during xcb run: %d\n", + ev->response_type); } + free (ev); - if (status) - return status; + return CAIRO_STATUS_WRITE_ERROR; } if (xcb_connection_has_error (xtc->c)) |