[PATCH libXi 2/3] Require XI 2 for all XI 2 calls.

Peter Hutterer peter.hutterer at who-t.net
Wed Sep 8 21:43:02 PDT 2010


Each XI2 call should check _XiCheckExtInit for XI version 2.0 or higher.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/XIAllowEvents.c  |    2 +-
 src/XIDefineCursor.c |    2 +-
 src/XIGetDevFocus.c  |    2 +-
 src/XIGrabDevice.c   |    4 ++--
 src/XIHierarchy.c    |    2 +-
 src/XIPassiveGrab.c  |    4 ++--
 src/XIProperties.c   |    8 ++++----
 src/XIQueryDevice.c  |    2 +-
 src/XIQueryPointer.c |    2 +-
 src/XISelEv.c        |    4 ++--
 src/XISetDevFocus.c  |    2 +-
 src/XIWarpPointer.c  |    2 +-
 src/XSetCPtr.c       |    2 +-
 13 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/src/XIAllowEvents.c b/src/XIAllowEvents.c
index 75980a0..1d388b3 100644
--- a/src/XIAllowEvents.c
+++ b/src/XIAllowEvents.c
@@ -37,7 +37,7 @@ XIAllowEvents(Display *dpy, int deviceid, int event_mode, Time time)
     XExtDisplayInfo *extinfo = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, Dont_Check, extinfo) == -1)
+    if (_XiCheckExtInit(dpy, XInput_2_0, extinfo) == -1)
 	return (NoSuchExtension);
 
     GetReq(XIAllowEvents, req);
diff --git a/src/XIDefineCursor.c b/src/XIDefineCursor.c
index 5ad1534..be6dadb 100644
--- a/src/XIDefineCursor.c
+++ b/src/XIDefineCursor.c
@@ -44,7 +44,7 @@ int XIDefineCursor(Display *dpy, int deviceid, Window w, Cursor cursor)
     XExtDisplayInfo *info = XInput_find_display(dpy);
     LockDisplay(dpy);
 
-    if (_XiCheckExtInit(dpy, Dont_Check, info) == -1)
+    if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1)
 	return (NoSuchExtension);
 
     GetReq(XIChangeCursor, req);
diff --git a/src/XIGetDevFocus.c b/src/XIGetDevFocus.c
index 1d2a9bf..524bf39 100644
--- a/src/XIGetDevFocus.c
+++ b/src/XIGetDevFocus.c
@@ -38,7 +38,7 @@ XIGetFocus(Display *dpy, int deviceid, Window *focus_return)
     XExtDisplayInfo *extinfo = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, Dont_Check, extinfo) == -1)
+    if (_XiCheckExtInit(dpy, XInput_2_0, extinfo) == -1)
 	return (NoSuchExtension);
 
     GetReq(XIGetFocus, req);
diff --git a/src/XIGrabDevice.c b/src/XIGrabDevice.c
index 985d3f1..37ce5a1 100644
--- a/src/XIGrabDevice.c
+++ b/src/XIGrabDevice.c
@@ -43,7 +43,7 @@ XIGrabDevice(Display* dpy, int deviceid, Window grab_window, Time time,
     XExtDisplayInfo *extinfo = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, Dont_Check, extinfo) == -1)
+    if (_XiCheckExtInit(dpy, XInput_2_0, extinfo) == -1)
 	return (NoSuchExtension);
 
     GetReq(XIGrabDevice, req);
@@ -86,7 +86,7 @@ XIUngrabDevice(Display* dpy, int deviceid, Time time)
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, Dont_Check, info) == -1)
+    if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1)
 	return (NoSuchExtension);
 
     GetReq(XIUngrabDevice, req);
diff --git a/src/XIHierarchy.c b/src/XIHierarchy.c
index 9b267bf..d30ea29 100644
--- a/src/XIHierarchy.c
+++ b/src/XIHierarchy.c
@@ -49,7 +49,7 @@ XIChangeHierarchy(Display* dpy,
     int dlen = 0, i;
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, Dont_Check, info) == -1)
+    if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1)
 	return (NoSuchExtension);
 
     GetReq(XIChangeHierarchy, req);
diff --git a/src/XIPassiveGrab.c b/src/XIPassiveGrab.c
index 8953013..060d669 100644
--- a/src/XIPassiveGrab.c
+++ b/src/XIPassiveGrab.c
@@ -45,7 +45,7 @@ _XIPassiveGrabDevice(Display* dpy, int deviceid, int grabtype, int detail,
     XExtDisplayInfo *extinfo = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, Dont_Check, extinfo) == -1)
+    if (_XiCheckExtInit(dpy, XInput_2_0, extinfo) == -1)
 	return -1;
 
     GetReq(XIPassiveGrabDevice, req);
@@ -155,7 +155,7 @@ _XIPassiveUngrabDevice(Display* dpy, int deviceid, int grabtype, int detail,
     XExtDisplayInfo *extinfo = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, Dont_Check, extinfo) == -1)
+    if (_XiCheckExtInit(dpy, XInput_2_0, extinfo) == -1)
 	return -1;
 
     GetReq(XIPassiveUngrabDevice, req);
diff --git a/src/XIProperties.c b/src/XIProperties.c
index 0f77e58..83a7a68 100644
--- a/src/XIProperties.c
+++ b/src/XIProperties.c
@@ -49,7 +49,7 @@ XIListProperties(Display* dpy, int deviceid, int *num_props_return)
 
     LockDisplay(dpy);
     *num_props_return = 0;
-    if (_XiCheckExtInit(dpy, Dont_Check, info) == -1)
+    if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1)
 	goto cleanup;
 
     GetReq(XIListProperties, req);
@@ -88,7 +88,7 @@ XIDeleteProperty(Display* dpy, int deviceid, Atom property)
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, Dont_Check, info) == -1)
+    if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1)
 	return;
 
     GetReq(XIDeleteProperty, req);
@@ -111,7 +111,7 @@ XIChangeProperty(Display* dpy, int deviceid, Atom property, Atom type,
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, Dont_Check, info) == -1)
+    if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1)
 	return;
 
     GetReq(XIChangeProperty, req);
@@ -175,7 +175,7 @@ XIGetProperty(Display* dpy, int deviceid, Atom property, long offset,
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, Dont_Check, info) == -1)
+    if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1)
 	return 1;
 
     GetReq(XIGetProperty, req);
diff --git a/src/XIQueryDevice.c b/src/XIQueryDevice.c
index 34c38cb..4e2f392 100644
--- a/src/XIQueryDevice.c
+++ b/src/XIQueryDevice.c
@@ -45,7 +45,7 @@ XIQueryDevice(Display *dpy, int deviceid, int *ndevices_return)
     XExtDisplayInfo *extinfo = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, Dont_Check, extinfo) == -1)
+    if (_XiCheckExtInit(dpy, XInput_2_0, extinfo) == -1)
 	goto error;
 
     GetReq(XIQueryDevice, req);
diff --git a/src/XIQueryPointer.c b/src/XIQueryPointer.c
index b3bfebc..28282f6 100644
--- a/src/XIQueryPointer.c
+++ b/src/XIQueryPointer.c
@@ -59,7 +59,7 @@ XIQueryPointer(Display     *dpy,
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, Dont_Check, info) == -1)
+    if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1)
 	return False;
 
     GetReq(XIQueryPointer, req);
diff --git a/src/XISelEv.c b/src/XISelEv.c
index f1f3fa4..a9c997a 100644
--- a/src/XISelEv.c
+++ b/src/XISelEv.c
@@ -52,7 +52,7 @@ XISelectEvents(Display* dpy, Window win, XIEventMask* masks, int num_masks)
 
     XExtDisplayInfo *info = XInput_find_display(dpy);
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, Dont_Check, info) == -1) {
+    if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1) {
         r = NoSuchExtension;
         goto out;
     }
@@ -108,7 +108,7 @@ XIGetSelectedEvents(Display* dpy, Window win, int *num_masks_return)
 
     *num_masks_return = -1;
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, Dont_Check, info) == -1)
+    if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1)
         goto out;
 
     GetReq(XIGetSelectedEvents, req);
diff --git a/src/XISetDevFocus.c b/src/XISetDevFocus.c
index e1567bd..7090c8f 100644
--- a/src/XISetDevFocus.c
+++ b/src/XISetDevFocus.c
@@ -37,7 +37,7 @@ XISetFocus(Display *dpy, int deviceid, Window focus, Time time)
     XExtDisplayInfo *extinfo = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, Dont_Check, extinfo) == -1)
+    if (_XiCheckExtInit(dpy, XInput_2_0, extinfo) == -1)
 	return (NoSuchExtension);
 
     GetReq(XISetFocus, req);
diff --git a/src/XIWarpPointer.c b/src/XIWarpPointer.c
index 038a0d3..b150915 100644
--- a/src/XIWarpPointer.c
+++ b/src/XIWarpPointer.c
@@ -54,7 +54,7 @@ XIWarpPointer(Display      *dpy,
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, Dont_Check, info) == -1)
+    if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1)
 	return (NoSuchExtension);
 
     GetReq(XIWarpPointer, req);
diff --git a/src/XSetCPtr.c b/src/XSetCPtr.c
index 1176c5d..36efc30 100644
--- a/src/XSetCPtr.c
+++ b/src/XSetCPtr.c
@@ -47,7 +47,7 @@ XISetClientPointer(Display* dpy, Window win, int deviceid)
     XExtDisplayInfo *info = XInput_find_display(dpy);
 
     LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, Dont_Check, info) == -1)
+    if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1)
 	return (NoSuchExtension);
 
     GetReq(XISetClientPointer, req);
-- 
1.7.2.2



More information about the xorg-devel mailing list