[cairo-commit] src/cairo-xlib-surface-shm.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Oct 5 11:51:02 PDT 2012


 src/cairo-xlib-surface-shm.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 15ef4a3248bbf32d05da7ed2480a2ce58c26d9bc
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Oct 5 19:46:41 2012 +0100

    xlib/shm: Note the bug is an interaction between libXext and xorg
    
    Søren thought it was bit harsh to lay the blame solely on xorg for it
    crashing due to an unexpected input value, and that we should mention
    libXext was also partly to blame for incorrectly setting the SEND_EVENT
    bit in the ShmCompletionEvent.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-xlib-surface-shm.c b/src/cairo-xlib-surface-shm.c
index 3e6eaf2..ec8a6e1 100644
--- a/src/cairo-xlib-surface-shm.c
+++ b/src/cairo-xlib-surface-shm.c
@@ -1125,9 +1125,12 @@ _cairo_xlib_shm_surface_is_idle (cairo_surface_t *surface)
     (((major) * 10000000) + ((minor) * 100000) + ((patch) * 1000) + snap)
 
 static cairo_bool_t
-xorg_has_buggy_send_event(Display *dpy)
+xorg_has_buggy_send_shm_completion_event(Display *dpy)
 {
-    /* Avoid incurring the wrath fixed by:
+    /* As libXext sets the SEND_EVENT bit in the ShmCompletionEvent,
+     * the Xserver may crash if it does not take care when processing
+     * the event type. For instance versions of Xorg prior to 1.11.1
+     * exhibited this bug, and was fixed by:
      *
      * commit 2d2dce558d24eeea0eb011ec9ebaa6c5c2273c39
      * Author: Sam Spilsbury <sam.spilsbury at canonical.com>
@@ -1171,7 +1174,7 @@ _cairo_xlib_display_init_shm (cairo_xlib_display_t *display)
 				 DefaultVisual (display->display, scr),
 				 CWOverrideRedirect, &attr);
 
-    if (xorg_has_buggy_send_event(display->display))
+    if (xorg_has_buggy_send_shm_completion_event(display->display))
 	has_pixmap = 0;
 
     shm->has_pixmaps = has_pixmap ? MIN_PIXMAP_SIZE : 0;


More information about the cairo-commit mailing list