aboutsummaryrefslogtreecommitdiffstats
path: root/src/glx/dri2.c
diff options
context:
space:
mode:
authorChristopher James Halse Rogers <[email protected]>2011-08-04 12:06:13 +1000
committerEric Anholt <[email protected]>2011-08-05 10:11:05 -0700
commitfbc2fcf685d22ec9bc9465e1f731529979497eaa (patch)
tree04aef19098e430c4fb9b0a04c57d2b8e67b54915 /src/glx/dri2.c
parent62722d90af9d43d889af33b080a682f2004e049c (diff)
glx/dri2: Paper over errors in DRI2Connect when indirect
DRI2 will throw BadRequest for this when the client is not local, but DRI2 is an implementation detail and not something callers should have to know about. Silently swallow errors in this case, and just propagate the failure through DRI2Connect's return code. Note: This is a candidate for the stable release branches. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28125 Signed-off-by: Christopher James Halse Rogers <[email protected]>
Diffstat (limited to 'src/glx/dri2.c')
-rw-r--r--src/glx/dri2.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/glx/dri2.c b/src/glx/dri2.c
index 229840d6919..b1b5013d048 100644
--- a/src/glx/dri2.c
+++ b/src/glx/dri2.c
@@ -190,6 +190,15 @@ DRI2Error(Display *display, xError *err, XExtCodes *codes, int *ret_code)
err->minorCode == X_DRI2DestroyDrawable)
return True;
+ /* If the server is non-local DRI2Connect will raise BadRequest.
+ * Swallow this so that DRI2Connect can signal this in its return code */
+ if (err->majorCode == codes->major_opcode &&
+ err->minorCode == X_DRI2Connect &&
+ err->errorCode == BadRequest) {
+ *ret_code = False;
+ return True;
+ }
+
return False;
}