mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-04 21:08:10 +02:00
[cairo-xlib-surface] Check for errors before installing a NOOP error handler.
Call XSync before ignoring errors from XGetImage to avoid hiding unassociated errors. Similarly, call XSync before reinstalling the old error handler to ensure no errors creep out of the ignored section.
This commit is contained in:
parent
0c5d28a4e5
commit
7016614dd9
1 changed files with 2 additions and 0 deletions
|
|
@ -542,6 +542,7 @@ _get_image_surface (cairo_xlib_surface_t *surface,
|
|||
{
|
||||
cairo_xlib_error_func_t old_handler;
|
||||
|
||||
XSync (surface->dpy, False);
|
||||
old_handler = XSetErrorHandler (_noop_error_handler);
|
||||
|
||||
ximage = XGetImage (surface->dpy,
|
||||
|
|
@ -550,6 +551,7 @@ _get_image_surface (cairo_xlib_surface_t *surface,
|
|||
x2 - x1, y2 - y1,
|
||||
AllPlanes, ZPixmap);
|
||||
|
||||
XSync (surface->dpy, False);
|
||||
XSetErrorHandler (old_handler);
|
||||
|
||||
/* If we get an error, the surface must have been a window,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue