diff options
Diffstat (limited to 'src/glx/dri2.c')
-rw-r--r-- | src/glx/dri2.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/src/glx/dri2.c b/src/glx/dri2.c index 91053d3fb6..5de55cdbf2 100644 --- a/src/glx/dri2.c +++ b/src/glx/dri2.c @@ -81,15 +81,13 @@ static XEXT_GENERATE_FIND_DISPLAY (DRI2FindDisplay, dri2Info, dri2ExtensionName, &dri2ExtensionHooks, - 1, NULL) + 0, NULL) static Bool DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire) { XExtDisplayInfo *info = DRI2FindDisplay(dpy); XExtDisplayInfo *glx_info = __glXFindDisplay(dpy); - static int glx_event_base; - static Bool found_glx_info = False; XextCheckExtension(dpy, info, dri2ExtensionName, False); @@ -126,7 +124,15 @@ DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire) return True; } #endif +#ifdef DRI2_InvalidateBuffers + case DRI2_InvalidateBuffers: + { + xDRI2InvalidateBuffers *awire = (xDRI2InvalidateBuffers *)wire; + dri2InvalidateBuffers(dpy, awire->drawable); + return False; + } +#endif default: /* client doesn't support server event */ break; @@ -174,6 +180,7 @@ DRI2QueryVersion(Display * dpy, int *major, int *minor) XExtDisplayInfo *info = DRI2FindDisplay(dpy); xDRI2QueryVersionReply rep; xDRI2QueryVersionReq *req; + int i, nevents; XextCheckExtension(dpy, info, dri2ExtensionName, False); @@ -193,6 +200,24 @@ DRI2QueryVersion(Display * dpy, int *major, int *minor) UnlockDisplay(dpy); SyncHandle(); + switch (rep.minorVersion) { + case 1: + nevents = 0; + break; + case 2: + nevents = 1; + break; + case 3: + default: + nevents = 2; + break; + } + + for (i = 0; i < nevents; i++) { + XESetWireToEvent (dpy, info->codes->first_event + i, DRI2WireToEvent); + XESetEventToWire (dpy, info->codes->first_event + i, DRI2EventToWire); + } + return True; } |