From a38c5027dfab030fc4dc89d7daa0f1e8dd9863a1 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 13 Dec 2013 12:46:50 -0800 Subject: Add PresentFreeInput to release allocated event ids Signed-off-by: Keith Packard --- include/X11/extensions/Xpresent.h | 5 +++++ src/Xpresent.c | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/include/X11/extensions/Xpresent.h b/include/X11/extensions/Xpresent.h index 48ba1ae..84bce11 100644 --- a/include/X11/extensions/Xpresent.h +++ b/include/X11/extensions/Xpresent.h @@ -192,6 +192,11 @@ XPresentSelectInput(Display *dpy, Window window, unsigned event_mask); +void +XPresentFreeInput(Display *dpy, + Window window, + XID event_id); + uint32_t XPresentQueryCapabilities(Display *dpy, XID target); diff --git a/src/Xpresent.c b/src/Xpresent.c index b49ecbc..0dad7df 100644 --- a/src/Xpresent.c +++ b/src/Xpresent.c @@ -565,6 +565,26 @@ XPresentSelectInput(Display *dpy, return eid; } +void +XPresentFreeInput(Display *dpy, + Window window, + XID event_id) +{ + XPresentExtDisplayInfo *info = XPresentFindDisplay (dpy); + xPresentSelectInputReq *req; + + XPresentSimpleCheckExtension (dpy, info); + LockDisplay (dpy); + GetReq(PresentSelectInput, req); + req->reqType = info->codes->major_opcode; + req->presentReqType = X_PresentSelectInput; + req->eid = event_id; + req->window = window; + req->eventMask = 0; + UnlockDisplay (dpy); + SyncHandle(); +} + uint32_t XPresentQueryCapabilities(Display *dpy, XID target) -- cgit v1.2.3