Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 9f1f6c09059bd01040ec6b29e18128ea1a12ed5d Mon Sep 17 00:00:00 2001
- From: =?UTF-8?q?Samuel=20R=C3=B8dal?= <samuel.rodal@nokia.com>
- Date: Tue, 24 May 2011 12:17:44 +0200
- Subject: [PATCH] Invalidate events are not available when XCB owns the X11 event queue.
- ---
- src/glx/dri2_glx.c | 19 ++++++++++++++++++-
- 1 files changed, 18 insertions(+), 1 deletions(-)
- diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
- index b9f6f7f..fd63369 100644
- --- a/src/glx/dri2_glx.c
- +++ b/src/glx/dri2_glx.c
- @@ -33,6 +33,7 @@
- #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- #include <X11/Xlib.h>
- +#include <X11/Xlibint.h>
- #include <X11/extensions/Xfixes.h>
- #include <X11/extensions/Xdamage.h>
- #include "glapi.h"
- @@ -966,6 +967,22 @@ dri2GetGlxDrawableFromXDrawableId(Display *dpy, XID id)
- }
- /*
- + * Since there is no XGetEventQueueOwner we need this hack to determine
- + * whether XCB owns the event queue. We (ab)use the fact that
- + * _XEventsQueued will always return 0 in that case.
- + */
- +static Bool
- +dri2EventQueueOwnerIsXCB(Display * dpy)
- +{
- + int old_qlen =_XEventsQueued(dpy, 0);
- + dpy->qlen = -1;
- + Bool result = (_XEventsQueued(dpy, 0) == 0) && (old_qlen == 0);
- + dpy->qlen = old_qlen;
- + return result;
- +}
- +
- +
- +/*
- * Allocate, initialize and return a __DRIdisplayPrivate object.
- * This is called from __glXInitialize() when we are given a new
- * display pointer.
- @@ -990,7 +1007,7 @@ dri2CreateDisplay(Display * dpy)
- pdp->driPatch = 0;
- pdp->swapAvailable = (pdp->driMinor >= 2);
- - pdp->invalidateAvailable = (pdp->driMinor >= 3);
- + pdp->invalidateAvailable = (pdp->driMinor >= 3) && !dri2EventQueueOwnerIsXCB(dpy);
- pdp->base.destroyDisplay = dri2DestroyDisplay;
- pdp->base.createScreen = dri2CreateScreen;
- --
- 1.7.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement