[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

libxi: Changes to 'upstream-unstable'



 configure.ac                     |   36 +++++++++++-----------
 include/X11/extensions/XInput2.h |    2 -
 man/XIGrabButton.txt             |    6 +++
 man/XIGrabEnter.txt              |    6 +++
 man/XIQueryPointer.txt           |    3 +
 src/Makefile.am                  |    2 -
 src/XExtInt.c                    |   19 +++++++++--
 src/XIAllowEvents.c              |    2 -
 src/XIDefineCursor.c             |    2 -
 src/XIGetDevFocus.c              |    2 -
 src/XIGrabDevice.c               |   10 +++---
 src/XIHierarchy.c                |    2 -
 src/XIPassiveGrab.c              |    6 +--
 src/XIProperties.c               |    8 ++---
 src/XIQueryDevice.c              |    2 -
 src/XIQueryPointer.c             |    2 -
 src/XISelEv.c                    |    4 +-
 src/XISetCPtr.c                  |   62 +++++++++++++++++++++++++++++++++++++++
 src/XISetDevFocus.c              |    2 -
 src/XIWarpPointer.c              |    2 -
 src/XSetCPtr.c                   |   62 ---------------------------------------
 21 files changed, 134 insertions(+), 108 deletions(-)

New commits:
commit 32236a7779f721d252d633d06ade306f246421a3
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Fri Mar 18 16:30:13 2011 -0700

    configure.ac: 1.4.2
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

diff --git a/configure.ac b/configure.ac
index 405cd34..08501c9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
 
 # Initialize Autoconf
 AC_PREREQ([2.60])
-AC_INIT([libXi], [1.4.1],
+AC_INIT([libXi], [1.4.2],
 	[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXi])
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS([src/config.h])

commit 2d638fc37b0dbf28e5c826f74f68ada83a8c3e2b
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Mar 15 10:55:10 2011 +1000

    Force alignment with sizeof(Atom) for XIButtonClassInfo
    
    The memory layout of an XIButtonClassInfo is
    [struct XIButtonClassInfo][mask][labels]
    
    With the mask being currently 4-byte aligned and labels a list of Atoms. On
    LP64, Atoms are 8 byte, leading to unaligned access for some mask lengths.
    Force the alignment to be sizeof(Atom).
    
    Reported-by: Christian Weisgerber <naddy@mips.inka.de>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Tested-by: Christian Weisgerber <naddy@mips.inka.de>
    Reviewed-by: Adam Jackson <ajax@redhat.com>

diff --git a/src/XExtInt.c b/src/XExtInt.c
index 5a1bca6..d1451cc 100644
--- a/src/XExtInt.c
+++ b/src/XExtInt.c
@@ -1028,7 +1028,9 @@ sizeDeviceClassType(int type, int num_elements)
         case XIButtonClass:
             l = sizeof(XIButtonClassInfo);
             l += num_elements * sizeof(Atom);
-            l += ((((num_elements + 7)/8) + 3)/4) * 4;
+            /* Force mask alignment with longs to avoid
+             * unaligned access when accessing the atoms. */
+            l += ((((num_elements + 7)/8) + 3)/4) * sizeof(Atom);
             break;
         case XIKeyClass:
             l = sizeof(XIKeyClassInfo);
@@ -1121,12 +1123,16 @@ copyDeviceChangedEvent(XGenericEventCookie *in_cookie,
         {
             case XIButtonClass:
                 {
+                    int size;
                     XIButtonClassInfo *bin, *bout;
                     bin = (XIButtonClassInfo*)any;
                     bout = next_block(&ptr, sizeof(XIButtonClass));
 
                     *bout = *bin;
-                    bout->state.mask = next_block(&ptr, bout->state.mask_len);
+                    /* Force mask alignment with longs to avoid unaligned
+                     * access when accessing the atoms. */
+                    size = bout->state.mask_len/4 * sizeof(Atom);
+                    bout->state.mask = next_block(&ptr, size);
                     memcpy(bout->state.mask, bin->state.mask,
                             bout->state.mask_len);
 
@@ -1474,14 +1480,18 @@ copy_classes(XIDeviceInfo* to, xXIAnyInfo* from, int nclasses)
                     XIButtonClassInfo *cls_lib;
                     xXIButtonInfo *cls_wire;
                     uint32_t *atoms;
+                    int size;
                     int j;
 
                     cls_lib = next_block(&ptr_lib, sizeof(XIButtonClassInfo));
                     cls_wire = (xXIButtonInfo*)any_wire;
 
                     cls_lib->num_buttons = cls_wire->num_buttons;
-                    cls_lib->state.mask_len = ((((cls_wire->num_buttons + 7)/8) + 3)/4) * 4;
-                    cls_lib->state.mask = next_block(&ptr_lib, cls_lib->state.mask_len);
+                    size = ((((cls_wire->num_buttons + 7)/8) + 3)/4);
+                    cls_lib->state.mask_len = size * 4;
+                    /* Force mask alignment with longs to avoid unaligned
+                     * access when accessing the atoms. */
+                    cls_lib->state.mask = next_block(&ptr_lib, size * sizeof(Atom));
                     memcpy(cls_lib->state.mask, &cls_wire[1],
                            cls_lib->state.mask_len);
 

commit 477f922fb07eea629f16c55b0a022e836ede6d41
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Mar 8 14:44:10 2011 +1000

    Don't discard extra data for passive grabs.
    
    Failed modifier data was discarded, causing assertions inside xcb.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/XIPassiveGrab.c b/src/XIPassiveGrab.c
index ada658f..feef74b 100644
--- a/src/XIPassiveGrab.c
+++ b/src/XIPassiveGrab.c
@@ -73,7 +73,7 @@ _XIPassiveGrabDevice(Display* dpy, int deviceid, int grabtype, int detail,
 
     free(buff);
 
-    if (!_XReply(dpy, (xReply *)&reply, 0, xTrue))
+    if (!_XReply(dpy, (xReply *)&reply, 0, xFalse))
     {
 	UnlockDisplay(dpy);
 	SyncHandle();

commit f0a352412920d9989323c7d33ca75c3646ee3f35
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Mar 8 14:01:35 2011 +1000

    man: describe return value for XI2 passive grabbing calls.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/man/XIGrabButton.txt b/man/XIGrabButton.txt
index 70a3505..fb806af 100644
--- a/man/XIGrabButton.txt
+++ b/man/XIGrabButton.txt
@@ -156,6 +156,12 @@ DESCRIPTION
    combination. XIGrabButton and XIGrabKeycode have no effect on an
    active grab.
 
+   On success, XIGrabButton and XIGrabKeycode return 0;
+   If one or more modifier combinations could not be grabbed,
+   XIGrabButton and XIGrabKeycode return the number of failed
+   combinations and modifiers_inout contains the failed combinations
+   and their respective status codes.
+
    XIGrabButton and XIGrabKeycode can generate BadClass, BadDevice,
    BadMatch, BadValue, and BadWindow errors.
 
diff --git a/man/XIGrabEnter.txt b/man/XIGrabEnter.txt
index 005a72b..fff3773 100644
--- a/man/XIGrabEnter.txt
+++ b/man/XIGrabEnter.txt
@@ -133,6 +133,12 @@ DESCRIPTION
    is a conflicting grab for any combination. XIGrabEnter and
    XIGrabFocusin have no effect on an active grab.
 
+   On success, XIGrabEnter and XIGrabFocusIn return 0;
+   If one or more modifier combinations could not be grabbed,
+   XIGrabEnter and XIGrabFocusIn return the number of failed
+   combinations and modifiers_inout contains the failed combinations
+   and their respective status codes.
+
    XIGrabEnter and XIGrabFocusIn can generate BadDevice,
    BadMatch, BadValue, and BadWindow errors.
 

commit 11b1e8ea7bc160cf9a42231742eedb0e7fefa222
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Sep 9 14:43:03 2010 +1000

    Rename XSetCPtr.c to XISetCPtr.c.
    
    XISetClientPointer is an XI2.0 call and should be named accordingly.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Daniel Stone <daniel@fooishbar.org>

diff --git a/src/Makefile.am b/src/Makefile.am
index 76b10e2..c036ae7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -9,6 +9,7 @@ XI2_sources = XIAllowEvents.c \
 		  XIPassiveGrab.c \
 		  XIProperties.c \
 		  XISelEv.c \
+		  XISetCPtr.c \
 		  XIWarpPointer.c \
 		  XIHierarchy.c \
 		  XIDefineCursor.c \
@@ -48,7 +49,6 @@ libXi_la_SOURCES = \
 		  XQueryDv.c \
 		  XSelect.c \
 		  XSetBMap.c \
-		  XSetCPtr.c \
 		  XSetDVal.c \
 		  XSetMMap.c \
 		  XSetMode.c \
diff --git a/src/XISetCPtr.c b/src/XISetCPtr.c
new file mode 100644
index 0000000..4948598
--- /dev/null
+++ b/src/XISetCPtr.c
@@ -0,0 +1,62 @@
+/************************************************************
+
+Copyright 2007 Peter Hutterer <peter@cs.unisa.edu.au>
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+
+/***********************************************************************
+ *
+ * XISetClientPointer - Sets the default pointer for a client. This call is
+ * important for legacy applications that may send ambiguous requests to the
+ * server where the server has to randomly pick a device.
+ * Ideally, the window manager will always send a SetClientPointer request
+ * before the client interacts with an application.
+ */
+
+#include <stdint.h>
+#include <X11/extensions/XI2proto.h>
+#include <X11/Xlibint.h>
+#include <X11/extensions/XInput2.h>
+#include <X11/extensions/extutil.h>
+#include "XIint.h"
+
+Status
+XISetClientPointer(Display* dpy, Window win, int deviceid)
+{
+    xXISetClientPointerReq* req;
+    XExtDisplayInfo *info = XInput_find_display(dpy);
+
+    LockDisplay(dpy);
+    if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1)
+	return (NoSuchExtension);
+
+    GetReq(XISetClientPointer, req);
+    req->reqType = info->codes->major_opcode;
+    req->ReqType = X_XISetClientPointer;
+    req->win = win;
+    req->deviceid = deviceid;
+
+    UnlockDisplay(dpy);
+    SyncHandle();
+    return Success;
+}
diff --git a/src/XSetCPtr.c b/src/XSetCPtr.c
deleted file mode 100644
index 36efc30..0000000
--- a/src/XSetCPtr.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/************************************************************
-
-Copyright 2007 Peter Hutterer <peter@cs.unisa.edu.au>
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-
-/***********************************************************************
- *
- * XISetClientPointer - Sets the default pointer for a client. This call is
- * important for legacy applications that may send ambiguous requests to the
- * server where the server has to randomly pick a device.
- * Ideally, the window manager will always send a SetClientPointer request
- * before the client interacts with an application.
- */
-
-#include <stdint.h>
-#include <X11/extensions/XI2proto.h>
-#include <X11/Xlibint.h>
-#include <X11/extensions/XInput2.h>
-#include <X11/extensions/extutil.h>
-#include "XIint.h"
-
-Status 
-XISetClientPointer(Display* dpy, Window win, int deviceid)
-{
-    xXISetClientPointerReq* req;
-    XExtDisplayInfo *info = XInput_find_display(dpy);
-
-    LockDisplay(dpy);
-    if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1)
-	return (NoSuchExtension);
-
-    GetReq(XISetClientPointer, req);
-    req->reqType = info->codes->major_opcode;
-    req->ReqType = X_XISetClientPointer;
-    req->win = win;
-    req->deviceid = deviceid;
-
-    UnlockDisplay(dpy);
-    SyncHandle();
-    return Success;
-}

commit 19ac7ef23e7ff07068a63d1553159e7cb3ad2576
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Sep 9 14:43:02 2010 +1000

    Require XI 2 for all XI 2 calls.
    
    Each XI2 call should check _XiCheckExtInit for XI version 2.0 or higher.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Daniel Stone <daniel@fooishbar.org>

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 e0ca601..94feaee 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 98eb806..ada658f 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 e068a97..1a02a5a 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);

commit 536bd44c513ede7e61e112c82a80fb9197f261f7
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Feb 23 10:53:21 2011 +1000

    Fix typo in comment.
    
    Reported-by: Julien Cristau <jcristau@debian.org>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/XIGrabDevice.c b/src/XIGrabDevice.c
index 97ab971..e0ca601 100644
--- a/src/XIGrabDevice.c
+++ b/src/XIGrabDevice.c
@@ -59,7 +59,7 @@ XIGrabDevice(Display* dpy, int deviceid, Window grab_window, Time time,
     req->cursor = cursor;
 
 
-    /* masks.mask_len is in bytes, but we need 4-byte units on the wire,
+    /* mask->mask_len is in bytes, but we need 4-byte units on the wire,
      * and they need to be padded with 0 */
     len = req->mask_len;
     buff = calloc(1, len * 4);

commit 4ca8be9f3ffbafe9515e50d784f4ff83f6993be0
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Feb 23 09:30:59 2011 +1000

    Fix invalid read in XIGrabDevice.
    
    Miscalculation of length caused Data() to memcpy too many bytes.
    
    ==2865== Invalid read of size 1
    ==2865==    at 0x4A07480: memcpy (mc_replace_strmem.c:602)
    ==2865==    by 0x544271E: XIGrabDevice (XIGrabDevice.c:69)
    ==2865==    by 0x400B0A: main (gnome642481.c:56)
    ==2865==  Address 0x642f614 is 0 bytes after a block of size 20 alloc'd
    ==2865==    at 0x4A04896: calloc (vg_replace_malloc.c:418)
    ==2865==    by 0x54425D3: XIGrabDevice (XIGrabDevice.c:65)
    ==2865==    by 0x400B0A: main (gnome642481.c:56)
    
    SetReqLen() expects 4-byte units.
    Data() expects bytes.
    
    Gnome Bug 642481 <https://bugzilla.gnome.org/show_bug.cgi?id=642481>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/XIGrabDevice.c b/src/XIGrabDevice.c
index 985d3f1..97ab971 100644
--- a/src/XIGrabDevice.c
+++ b/src/XIGrabDevice.c
@@ -61,8 +61,8 @@ XIGrabDevice(Display* dpy, int deviceid, Window grab_window, Time time,
 
     /* masks.mask_len is in bytes, but we need 4-byte units on the wire,
      * and they need to be padded with 0 */
-    len = req->mask_len * 4;
-    buff = calloc(1, len);
+    len = req->mask_len;
+    buff = calloc(1, len * 4);
     memcpy(buff, mask->mask, mask->mask_len);
 
     SetReqLen(req, len, len);

commit 4db3db2b38d8eb9024170633d3bf7c5050272dd0
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Feb 14 08:48:07 2011 +1000

    Mark sourceid in Raw events as bug and force to 0..
    
    The protocol does not provide a source ID for raw events, so this value is
    always 0. It shouldn't really be there, but the past is so hard to change.
    
    Reported-by:  Mark Dokter <dokter@icg.tugraz.at>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/include/X11/extensions/XInput2.h b/include/X11/extensions/XInput2.h
index e6c7b30..3fcf083 100644
--- a/include/X11/extensions/XInput2.h
+++ b/include/X11/extensions/XInput2.h
@@ -242,7 +242,7 @@ typedef struct {
     int           evtype;       /* XI_RawKeyPress, XI_RawKeyRelease, etc. */
     Time          time;
     int           deviceid;
-    int           sourceid;
+    int           sourceid;     /* Bug: Always 0. https://bugs.freedesktop.org//show_bug.cgi?id=34240 */
     int           detail;
     int           flags;
     XIValuatorState valuators;
diff --git a/src/XExtInt.c b/src/XExtInt.c
index f96e3ff..5a1bca6 100644
--- a/src/XExtInt.c
+++ b/src/XExtInt.c
@@ -1627,6 +1627,7 @@ wireToRawEvent(xXIRawEvent *in, XGenericEventCookie *cookie)
     out->time           = in->time;
     out->detail         = in->detail;
     out->deviceid       = in->deviceid;
+    out->sourceid       = 0; /* https://bugs.freedesktop.org/show_bug.cgi?id=34240 */
     out->flags          = in->flags;
 
     out->valuators.mask_len = in->valuators_len * 4;

commit d79a9b174a79e89ca2507a61f2e12af25102313f
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Feb 1 07:36:08 2011 +1000

    man: note that callers of XIQueryPointer must free the button mask.
    
    buttons_return->mask is allocated by the library and must be freed by the
    caller to avoid leaking.
    
    Reported-by: Matthias Clasen <mclasen@redhat.com>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/man/XIQueryPointer.txt b/man/XIQueryPointer.txt
index 445f8b5..73fc11e 100644
--- a/man/XIQueryPointer.txt
+++ b/man/XIQueryPointer.txt
@@ -76,6 +76,9 @@ DESCRIPTION
    selected to obtain the data for modifiers_return and
    group_return.
 
+   The mask field in buttons_return is dynamically allocated and
+   must be freed by the caller.
+
    XIQueryPointer is identical to XQueryPointer but specifies the
    device explicitly.
 

commit 1b376f371c2f866cd1cdf047e50210a5c69772b9
Author: Gaetan Nadon <memsize@videotron.ca>
Date:   Wed Feb 2 11:43:43 2011 -0500

    config: comment, minor upgrade, quote and layout configure.ac
    
    Group statements per section as per Autoconf standard layout
    Quote statements where appropriate.
    Autoconf recommends not using dnl instead of # for comments
    
    Use AC_CONFIG_FILES to replace the deprecated AC_OUTPUT with parameters.
    Use AC_PROG_LIBTOOL to replace the deprecated AM_PROG_LIBTOOL
    Remove redundant AC_SUBST(*_CFLAGS) and/or *_LIBS
    Remove redundant AC_PROG_MAKE_SET included with AM_INIT_AUTOMAKE
    Remove redundant AC_CANONICAL_HOST included in XORG_DEFAULT_OPTIONS
    Add AC_CONFIG_SRCDIR([Makefile.am]) where missing
    Update minimum version of util-macros to at least 1.8.
    
    One or more of the above actions were applied
    No functional configuration changes
    
    This helps automated maintenance and release activities.
    Details can be found in http://wiki.x.org/wiki/NewModuleGuidelines
    
    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>

diff --git a/configure.ac b/configure.ac
index 19e6bc5..405cd34 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,11 +1,18 @@
-dnl Process this file with autoconf to create configure.
 
+# Initialize Autoconf
 AC_PREREQ([2.60])
+AC_INIT([libXi], [1.4.1],
+	[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXi])
+AC_CONFIG_SRCDIR([Makefile.am])
+AC_CONFIG_HEADERS([src/config.h])
 
-AC_INIT(libXi, 1.4.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXi)
+# Initialize Automake
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
 
+# Initialize libtool
+AC_PROG_LIBTOOL
+
 # Require xorg-macros minimum of 1.10 for DocBook XML documentation
 m4_ifndef([XORG_MACROS_VERSION],
           [m4_fatal([must install xorg-macros 1.10 or later before running autoconf/autogen])])
@@ -16,12 +23,9 @@ XORG_WITH_XMLTO(0.0.20)
 XORG_WITH_FOP
 XORG_CHECK_SGML_DOCTOOLS(1.5)
 XORG_WITH_ASCIIDOC(8.4.5)
-AC_CONFIG_HEADERS(src/config.h)
-
-# Check for progs
-AC_PROG_LIBTOOL
+XORG_CHECK_MALLOC_ZERO
 
-# Checks for pkg-config packages
+# Obtain compiler/linker options for depedencies
 PKG_CHECK_MODULES(XI, [xproto >= 7.0.13] [x11 >= 1.2.99.1] [xextproto >= 7.0.3] [xext >= 1.0.99.1] [inputproto >= 1.9.99.902])
 
 # Check for xmlto and asciidoc for man page conversion
@@ -42,12 +46,10 @@ AM_CONDITIONAL([INSTALL_MANPAGES],
 	[test -f "$srcdir/man/XAllowDeviceEvents.man" || \
 	  test $have_doctools = yes])
 
-XORG_CHECK_MALLOC_ZERO
-
-AC_OUTPUT([Makefile
-           src/Makefile
-           man/Makefile
-           doc/Makefile
-           specs/Makefile
-           xi.pc])
-
+AC_CONFIG_FILES([Makefile
+		src/Makefile
+		man/Makefile
+		doc/Makefile
+		specs/Makefile
+		xi.pc])
+AC_OUTPUT

commit faff510fed9733b2860e14490d5a40d70b840eae
Author: Gaetan Nadon <memsize@videotron.ca>
Date:   Fri Jan 28 19:41:37 2011 -0500

    config: replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERS
    
    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>

diff --git a/configure.ac b/configure.ac
index 457a993..19e6bc5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@ XORG_WITH_XMLTO(0.0.20)
 XORG_WITH_FOP
 XORG_CHECK_SGML_DOCTOOLS(1.5)
 XORG_WITH_ASCIIDOC(8.4.5)
-AM_CONFIG_HEADER(src/config.h)
+AC_CONFIG_HEADERS(src/config.h)
 
 # Check for progs
 AC_PROG_LIBTOOL

commit 3776075264024af7eca93f689305d46302e88536
Author: Gaetan Nadon <memsize@videotron.ca>
Date:   Fri Jan 28 12:07:46 2011 -0500

    config: remove already included AC_PROG_SED statement
    
    Use AC_PROG_SED now supplied by XORG_DEFAULT_OPTIONS
    Use the appropriate platform version of sed
    
    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>

diff --git a/configure.ac b/configure.ac
index 9321277..457a993 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,6 @@ AM_CONFIG_HEADER(src/config.h)
 
 # Check for progs
 AC_PROG_LIBTOOL
-AC_PROG_SED
 
 # Checks for pkg-config packages
 PKG_CHECK_MODULES(XI, [xproto >= 7.0.13] [x11 >= 1.2.99.1] [xextproto >= 7.0.3] [xext >= 1.0.99.1] [inputproto >= 1.9.99.902])

commit 5283e87ca909304d3e1820ef877bf3587a9c8724
Author: Gaetan Nadon <memsize@videotron.ca>
Date:   Thu Jan 27 18:50:15 2011 -0500

    config: remove AC_PROG_CC as it overrides AC_PROG_C_C99
    
    XORG_STRICT_OPTION from XORG_DEFAULT_OPTIONS calls
    AC_PROG_C_C99. This sets gcc with -std=gnu99.
    If AC_PROG_CC macro is called afterwards, it resets CC to gcc.
    
    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>

diff --git a/configure.ac b/configure.ac
index e26392e..9321277 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,6 @@ XORG_WITH_ASCIIDOC(8.4.5)
 AM_CONFIG_HEADER(src/config.h)
 
 # Check for progs
-AC_PROG_CC
 AC_PROG_LIBTOOL
 AC_PROG_SED
 


Reply to: