mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-04-14 22:50:49 +02:00
xlib: Call XSync() before ignoring errors
The code here wants to ignore errors for a specific request. To do so, it sets a no-op error handler. However, it could happen that some previous request caused an error and this error will also be ignored by the no-op error handler. To avoid this, call XSync() before setting the error handler. This makes sure that all pending errors are handled. Signed-off-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
2d47ccbc01
commit
2f830badef
1 changed files with 2 additions and 0 deletions
|
|
@ -793,6 +793,7 @@ _get_image_surface (cairo_xlib_surface_t *surface,
|
|||
|
||||
_cairo_xlib_shm_surface_get_ximage (&image->base, &shm_image);
|
||||
|
||||
XSync (display->display, False);
|
||||
old_handler = XSetErrorHandler (_noop_error_handler);
|
||||
success = XShmGetImage (display->display,
|
||||
surface->drawable,
|
||||
|
|
@ -814,6 +815,7 @@ _get_image_surface (cairo_xlib_surface_t *surface,
|
|||
if (surface->use_pixmap == 0) {
|
||||
cairo_xlib_error_func_t old_handler;
|
||||
|
||||
XSync (display->display, False);
|
||||
old_handler = XSetErrorHandler (_noop_error_handler);
|
||||
|
||||
ximage = XGetImage (display->display,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue