summaryrefslogtreecommitdiffstats
path: root/src/glx/dri2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glx/dri2.c')
-rw-r--r--src/glx/dri2.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/glx/dri2.c b/src/glx/dri2.c
index 6afa4149651..d53431c19a6 100644
--- a/src/glx/dri2.c
+++ b/src/glx/dri2.c
@@ -33,7 +33,6 @@
#ifdef GLX_DIRECT_RENDERING
-#define NEED_REPLIES
#include <stdio.h>
#include <X11/Xlibint.h>
#include <X11/extensions/Xext.h>
@@ -89,7 +88,7 @@ static Bool
DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire)
{
XExtDisplayInfo *info = DRI2FindDisplay(dpy);
- XExtDisplayInfo *glx_info = __glXFindDisplay(dpy);
+ __GLXdisplayPrivate *glx_dpy = __glXInitialize(dpy);
XextCheckExtension(dpy, info, dri2ExtensionName, False);
@@ -100,8 +99,15 @@ DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire)
{
GLXBufferSwapComplete *aevent = (GLXBufferSwapComplete *)event;
xDRI2BufferSwapComplete *awire = (xDRI2BufferSwapComplete *)wire;
+ __GLXDRIdrawable *pdraw;
+
+ /* Ignore swap events if we're not looking for them */
+ pdraw = dri2GetGlxDrawableFromXDrawableId(dpy, awire->drawable);
+ 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->type = glx_dpy->codes->first_event + GLX_BufferSwapComplete;
aevent->send_event = (awire->type & 0x80) != 0;
aevent->display = dpy;
aevent->drawable = awire->drawable;