summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-12-13 12:46:50 -0800
committerKeith Packard <keithp@keithp.com>2013-12-13 12:46:50 -0800
commita38c5027dfab030fc4dc89d7daa0f1e8dd9863a1 (patch)
tree4d6771377a8925fe5543ac34ee8f956dca4e87c5
parent466657644f6046f4409a4b9be688954583afc639 (diff)
Add PresentFreeInput to release allocated event ids
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--include/X11/extensions/Xpresent.h5
-rw-r--r--src/Xpresent.c20
2 files changed, 25 insertions, 0 deletions
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)