summaryrefslogtreecommitdiff
path: root/src/glx/dri2.c
diff options
context:
space:
mode:
authorNick Bowler <nbowler@draconx.ca>2010-07-14 12:01:49 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2010-07-14 10:23:09 -0700
commitf8d81c31cee30821da3aab331a57f484f6a07a5d (patch)
tree4cc95206c52314c402a87b0943c2ad5272406697 /src/glx/dri2.c
parent467928c6e01d66ea83d90df9903c2a8f0e675240 (diff)
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>
Diffstat (limited to 'src/glx/dri2.c')
-rw-r--r--src/glx/dri2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/glx/dri2.c b/src/glx/dri2.c
index e4ff53801a9..dbf3420892b 100644
--- a/src/glx/dri2.c
+++ b/src/glx/dri2.c
@@ -99,6 +99,12 @@ DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire)
{
GLXBufferSwapComplete *aevent = (GLXBufferSwapComplete *)event;
xDRI2BufferSwapComplete *awire = (xDRI2BufferSwapComplete *)wire;
+ __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, awire->drawable, NULL);
+
+ /* Ignore swap events if we're not looking for them */
+ if (!(pdraw->eventMask & GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK))
+ return False;
+
aevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *) wire);
aevent->type = glx_info->codes->first_event + GLX_BufferSwapComplete;
aevent->send_event = (awire->type & 0x80) != 0;