Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.73 KB | None | 0 0
  1. From 9f1f6c09059bd01040ec6b29e18128ea1a12ed5d Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Samuel=20R=C3=B8dal?= <samuel.rodal@nokia.com>
  3. Date: Tue, 24 May 2011 12:17:44 +0200
  4. Subject: [PATCH] Invalidate events are not available when XCB owns the X11 event queue.
  5.  
  6. ---
  7. src/glx/dri2_glx.c |   19 ++++++++++++++++++-
  8.  1 files changed, 18 insertions(+), 1 deletions(-)
  9.  
  10. diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
  11. index b9f6f7f..fd63369 100644
  12. --- a/src/glx/dri2_glx.c
  13. +++ b/src/glx/dri2_glx.c
  14. @@ -33,6 +33,7 @@
  15.  #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
  16.  
  17.  #include <X11/Xlib.h>
  18. +#include <X11/Xlibint.h>
  19.  #include <X11/extensions/Xfixes.h>
  20.  #include <X11/extensions/Xdamage.h>
  21.  #include "glapi.h"
  22. @@ -966,6 +967,22 @@ dri2GetGlxDrawableFromXDrawableId(Display *dpy, XID id)
  23.  }
  24.  
  25.  /*
  26. + * Since there is no XGetEventQueueOwner we need this hack to determine
  27. + * whether XCB owns the event queue. We (ab)use the fact that
  28. + * _XEventsQueued will always return 0 in that case.
  29. + */
  30. +static Bool
  31. +dri2EventQueueOwnerIsXCB(Display * dpy)
  32. +{
  33. +   int old_qlen =_XEventsQueued(dpy, 0);
  34. +   dpy->qlen = -1;
  35. +   Bool result = (_XEventsQueued(dpy, 0) == 0) && (old_qlen == 0);
  36. +   dpy->qlen = old_qlen;
  37. +   return result;
  38. +}
  39. +
  40. +
  41. +/*
  42.   * Allocate, initialize and return a __DRIdisplayPrivate object.
  43.   * This is called from __glXInitialize() when we are given a new
  44.   * display pointer.
  45. @@ -990,7 +1007,7 @@ dri2CreateDisplay(Display * dpy)
  46.  
  47.     pdp->driPatch = 0;
  48.     pdp->swapAvailable = (pdp->driMinor >= 2);
  49. -   pdp->invalidateAvailable = (pdp->driMinor >= 3);
  50. +   pdp->invalidateAvailable = (pdp->driMinor >= 3) && !dri2EventQueueOwnerIsXCB(dpy);
  51.  
  52.     pdp->base.destroyDisplay = dri2DestroyDisplay;
  53.     pdp->base.createScreen = dri2CreateScreen;
  54. --
  55. 1.7.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement