dri2: Track event mask in client code.

When direct rendering is being used, DRI2 BufferSwapComplete events are
sent unconditionally to clients, even if they haven't been requested.
This causes error messages to be printed by every freeglut application
of the form

  freeglut (./gears): Unknown X event type: 104

and might confuse other clients.

This is a fixed up version of the patch by Jesse Barnes, which drops
BufferSwapComplete events if they are not requested by clients.

Fixes fdo bug 27962.

Signed-off-by: Nick Bowler <nbowler@draconx.ca>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h
index b41073f..49f31a1 100644
--- a/src/glx/glxclient.h
+++ b/src/glx/glxclient.h
@@ -176,6 +176,7 @@
    GLenum textureTarget;
    __DRIdrawable *driDrawable;
    GLenum textureFormat;        /* EXT_texture_from_pixmap support */
+   unsigned long eventMask;
 };
 
 /*