From bb06db5a62f680c6a0e51d12339aeb2dd069999b Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Tue, 12 Sep 2023 16:01:15 +0800 Subject: [PATCH] glx: Increment dpy->request before issuing an error that had no request This ensures the sequence number is unique and recent enough for callers of `glXQueryDrawable` using `XNextRequest` to selectively trap errors. The same approach is already used in `glXCreateContextAttribsARB`. Suggested-by: Sebastian Keller Related-to: https://gitlab.gnome.org/GNOME/mutter/-/issues/3007 Part-of: --- src/glx/glx_pbuffer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c index 0b3cdfa..d95a3e9 100644 --- a/src/glx/glx_pbuffer.c +++ b/src/glx/glx_pbuffer.c @@ -239,6 +239,7 @@ __glXGetDrawableAttribute(Display * dpy, GLXDrawable drawable, * generated." */ if (drawable == 0) { + XNoOp(dpy); __glXSendError(dpy, GLXBadDrawable, 0, X_GLXGetDrawableAttributes, false); return 0; } @@ -269,6 +270,7 @@ __glXGetDrawableAttribute(Display * dpy, GLXDrawable drawable, if (pdraw == NULL || gc == &dummyContext || gc->currentDpy != dpy || (gc->currentDrawable != drawable && gc->currentReadable != drawable)) { + XNoOp(dpy); __glXSendError(dpy, GLXBadDrawable, drawable, X_GLXGetDrawableAttributes, false); return 0; -- 2.7.4