aboutsummaryrefslogtreecommitdiff
path: root/libX11/src/Macros.c
diff options
context:
space:
mode:
Diffstat (limited to 'libX11/src/Macros.c')
-rw-r--r--libX11/src/Macros.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libX11/src/Macros.c b/libX11/src/Macros.c
index cfc083a01..394a7641f 100644
--- a/libX11/src/Macros.c
+++ b/libX11/src/Macros.c
@@ -30,6 +30,7 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
#define XUTIL_DEFINE_FUNCTIONS
#include "Xutil.h"
+#include "Xxcbint.h"
/*
* This file makes full definitions of routines for each macro.
@@ -135,9 +136,20 @@ int XBitmapPad(Display *dpy) { return (BitmapPad(dpy)); }
int XImageByteOrder(Display *dpy) { return (ImageByteOrder(dpy)); }
+/* XNextRequest() differs from the rest of the functions here because it is
+ * no longer a macro wrapper - when libX11 is being used mixed together
+ * with direct use of xcb, the next request field of the Display structure will
+ * not be updated. We can't fix the NextRequest() macro in any easy way,
+ * but we can at least make XNextRequest() do the right thing.
+ */
unsigned long XNextRequest(Display *dpy)
{
- return (NextRequest(dpy));
+ unsigned long next_request;
+ LockDisplay(dpy);
+ next_request = _XNextRequest(dpy);
+ UnlockDisplay(dpy);
+
+ return next_request;
}
unsigned long XLastKnownRequestProcessed(Display *dpy)