configure.ac | 2 - man/XGetFeedbackControl.txt | 55 ++++++++++++++++++++++---------------------- man/XIGrabButton.txt | 16 +++++++++--- man/XIGrabEnter.txt | 10 +++++++- man/XIQueryDevice.txt | 2 - src/XExtInt.c | 32 +++++++++++++++++-------- src/XIQueryDevice.c | 4 +-- 7 files changed, 75 insertions(+), 46 deletions(-)
New commits: commit d58150cf5cf11c0449fc9e9f3c7fc4d29764f6e5 Author: Peter Hutterer <[email protected]> Date: Tue Dec 20 10:18:28 2011 +1000 libXi 1.4.5 Signed-off-by: Peter Hutterer <[email protected]> diff --git a/configure.ac b/configure.ac index 3650edb..9d5d5eb 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) -AC_INIT([libXi], [1.4.4], +AC_INIT([libXi], [1.4.5], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXi]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([src/config.h]) commit 7a30bc136fb6c1561f5cd91606bca01fb877f167 Author: Peter Hutterer <[email protected]> Date: Fri Aug 12 14:24:26 2011 +1000 Don't use the protocol defines for 2.0 versioning. Otherwise we run into the old problem again: recompiling libXi against newer inputproto headers will appear to change the version support, potentially causing errors or other misbehaviours. Signed-off-by: Peter Hutterer <[email protected]> Reviewed-by: Jeremy Huddleston <[email protected]> (cherry picked from commit ca73cd3b7630e7eb7d26c61c4af10d35dbce5465) diff --git a/src/XExtInt.c b/src/XExtInt.c index a5e70b5..63afb8f 100644 --- a/src/XExtInt.c +++ b/src/XExtInt.c @@ -268,7 +268,7 @@ static XExtensionVersion versions[] = { {XI_Absent, 0, 0}, XI_Add_DevicePresenceNotify_Minor}, {XI_Present, XI_Add_DeviceProperties_Major, XI_Add_DeviceProperties_Minor}, -{XI_Present, XI_2_Major, XI_2_Minor} +{XI_Present, 2, 0} }; /*********************************************************************** commit e423bfa6045a2b2eeb02080ae39dbee44e062bfa Author: Peter Hutterer <[email protected]> Date: Fri Dec 16 07:43:45 2011 +1000 libXi 1.4.4 Signed-off-by: Peter Hutterer <[email protected]> diff --git a/configure.ac b/configure.ac index 847895a..3650edb 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) -AC_INIT([libXi], [1.4.3], +AC_INIT([libXi], [1.4.4], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXi]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([src/config.h]) commit 30bff38c7436daad4140fedf867c546bea839b93 Author: Peter Hutterer <[email protected]> Date: Wed Oct 26 08:54:53 2011 +1000 Fix duplicate sizeof in copy_classes sizeof(bla * sizeof()) is'nt right. Plus add some () to the next_block call too to emphasise that *nclasses is the multiplicator. Signed-off-by: Peter Hutterer <[email protected]> Reviewed-by: Jeremy Huddleston <[email protected]> (cherry picked from commit 6d6ae8fc8b9620bf864ac7dff8d818573eee3e4f) diff --git a/src/XExtInt.c b/src/XExtInt.c index 2ce2d44..a5e70b5 100644 --- a/src/XExtInt.c +++ b/src/XExtInt.c @@ -1463,8 +1463,8 @@ copy_classes(XIDeviceInfo* to, xXIAnyInfo* from, int *nclasses) ptr_wire = (char*)from; ptr_lib = to->classes; - to->classes = next_block(&ptr_lib, *nclasses * sizeof(XIAnyClassInfo*)); - memset(to->classes, 0, sizeof(*nclasses * sizeof(XIAnyClassInfo*))); + to->classes = next_block(&ptr_lib, (*nclasses) * sizeof(XIAnyClassInfo*)); + memset(to->classes, 0, (*nclasses) * sizeof(XIAnyClassInfo*)); len = 0; /* count wire length */ for (i = 0; i < *nclasses; i++) commit db739c0770d49e8b47da90f160b99c76be996a18 Author: Peter Hutterer <[email protected]> Date: Thu Oct 27 10:27:49 2011 +1000 man: passive grabs return the number of failed modifier combinations Signed-off-by: Peter Hutterer <[email protected]> (cherry picked from commit 323730f7fa70190d2ea00e62c6964fee524ca430) diff --git a/man/XIGrabButton.txt b/man/XIGrabButton.txt index 18c7ffc..81e077a 100644 --- a/man/XIGrabButton.txt +++ b/man/XIGrabButton.txt @@ -64,7 +64,7 @@ SYNOPSIS or XIAnyKeycode. num_modifiers - Number of elements in modifiers or modifiers_return + Number of elements in modifiers or modifiers_inout. modifiers Specifies the set of latched and base modifiers or @@ -178,6 +178,14 @@ DESCRIPTION XIUngrabButton and XIUngrabKeycode can generate BadDevice, BadMatch, BadValue and BadWindow errors. +RETURN VALUE +------------ + XIGrabButton and XIGrabKeycode return the number of modifier combination + that could not establish a passive grab. The modifiers are returned in + modifiers_inout, along with the respective error for this modifier + combination. If XIGrabButton or XIGrabKeycode return zero, passive grabs + with all requested modifier combinations were established successfully. + DIAGNOSTICS ----------- diff --git a/man/XIGrabEnter.txt b/man/XIGrabEnter.txt index f75a5ad..e110eec 100644 --- a/man/XIGrabEnter.txt +++ b/man/XIGrabEnter.txt @@ -51,7 +51,7 @@ SYNOPSIS Specifies the device that is to be grabbed or released num_modifiers - Number of elements in modifiers or modifiers_return + Number of elements in modifiers or modifiers_inout. modifiers Specifies the set of latched and base modifiers or @@ -152,6 +152,14 @@ DESCRIPTION XIUngrabEnter and XIUngrabFocusIn can generate BadDevice, BadMatch, BadValue and BadWindow errors. +RETURN VALUE +------------ + XIGrabEnter and XIGrabFocusIn return the number of modifier combination + that could not establish a passive grab. The modifiers are returned in + modifiers_inout, along with the respective error for this modifier + combination. If XIGrabEnter or XIGrabFocusIn return zero, passive grabs + with all requested modifier combinations were established successfully. + DIAGNOSTICS ----------- commit d21fdd9653b0e38e54692735b5a040a7acf22164 Author: Peter Hutterer <[email protected]> Date: Fri Oct 21 08:49:31 2011 +1000 man: XIGrabButton returns error codes, not status codes Reword slightly that the returned value is the error code for this particular grab. Signed-off-by: Peter Hutterer <[email protected]> (cherry picked from commit 5189df57e18c79327848fb117a8ede59868c8fdb) diff --git a/man/XIGrabButton.txt b/man/XIGrabButton.txt index b16d018..18c7ffc 100644 --- a/man/XIGrabButton.txt +++ b/man/XIGrabButton.txt @@ -75,7 +75,7 @@ SYNOPSIS modifiers_inout Specifies the set of latched and base modifiers or XIAnyModifier to grab. Returns the modifiers that could - not be grabbed and their status code. + not be grabbed and their error code. grab_window Specifies the grab window. @@ -160,7 +160,7 @@ DESCRIPTION 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. + and their respective error codes. XIGrabButton and XIGrabKeycode can generate BadClass, BadDevice, BadMatch, BadValue, and BadWindow errors. commit cb2028ed23d3f23829241de166a14c4ef9494bd5 Author: Peter Hutterer <[email protected]> Date: Fri Oct 21 08:07:45 2011 +1000 man: fix #include for XIGrabButton Reported-by: Matthias Clasen <[email protected]> Signed-off-by: Peter Hutterer <[email protected]> (cherry picked from commit 05aaf65b3b6b7dc7268137ce4ee516f08eefb62f) diff --git a/man/XIGrabButton.txt b/man/XIGrabButton.txt index 4e9bcb9..b16d018 100644 --- a/man/XIGrabButton.txt +++ b/man/XIGrabButton.txt @@ -10,7 +10,7 @@ NAME SYNOPSIS -------- - #include <X11/extensions/XInput.h> + #include <X11/extensions/XInput2.h> int XIGrabButton( Display *display, int deviceid, commit 22e9ace88d57803ecda95db7c9355a614db1902a Author: Peter Hutterer <[email protected]> Date: Wed Aug 17 15:20:48 2011 +1000 Handle unknown device classes. If the server sends an unknown device class in response to an XIQueryDevice call, no memory is allocated for these classes but we still write type and sourceid as well as setting to->classes[i]. The latter causes multiple classes to point to the same memory field. Move the common code of assigning these three into the respective class type handlers so to automatically skip any unknown classes. Signed-off-by: Peter Hutterer <[email protected]> (cherry picked from commit 91f928a70246c26cbee00bf59a8e318e9317142e) diff --git a/src/XExtInt.c b/src/XExtInt.c index 134ccc6..2ce2d44 100644 --- a/src/XExtInt.c +++ b/src/XExtInt.c @@ -98,7 +98,7 @@ extern int _XiGetDevicePresenceNotifyEvent( Display * /* dpy */ ); -int copy_classes(XIDeviceInfo *to, xXIAnyInfo* from, int nclasses); +int copy_classes(XIDeviceInfo *to, xXIAnyInfo* from, int *nclasses); int size_classes(xXIAnyInfo* from, int nclasses); static XExtensionInfo *xinput_info; @@ -1449,30 +1449,29 @@ size_classes(xXIAnyInfo* from, int nclasses) * |______________________^ */ _X_HIDDEN int -copy_classes(XIDeviceInfo* to, xXIAnyInfo* from, int nclasses) +copy_classes(XIDeviceInfo* to, xXIAnyInfo* from, int *nclasses) { XIAnyClassInfo *any_lib; xXIAnyInfo *any_wire; void *ptr_lib; char *ptr_wire; int i, len; + int cls_idx = 0; if (!to->classes) return -1; ptr_wire = (char*)from; ptr_lib = to->classes; - to->classes = next_block(&ptr_lib, nclasses * sizeof(XIAnyClassInfo*)); + to->classes = next_block(&ptr_lib, *nclasses * sizeof(XIAnyClassInfo*)); + memset(to->classes, 0, sizeof(*nclasses * sizeof(XIAnyClassInfo*))); len = 0; /* count wire length */ - for (i = 0; i < nclasses; i++) + for (i = 0; i < *nclasses; i++) { any_lib = (XIAnyClassInfo*)ptr_lib; any_wire = (xXIAnyInfo*)ptr_wire; - to->classes[i] = any_lib; - any_lib->type = any_wire->type; - any_lib->sourceid = any_wire->sourceid; switch(any_wire->type) { case XIButtonClass: @@ -1486,6 +1485,8 @@ copy_classes(XIDeviceInfo* to, xXIAnyInfo* from, int nclasses) cls_lib = next_block(&ptr_lib, sizeof(XIButtonClassInfo)); cls_wire = (xXIButtonInfo*)any_wire; + cls_lib->type = cls_wire->type; + cls_lib->sourceid = cls_wire->sourceid; cls_lib->num_buttons = cls_wire->num_buttons; size = ((((cls_wire->num_buttons + 7)/8) + 3)/4); cls_lib->state.mask_len = size * 4; @@ -1500,6 +1501,7 @@ copy_classes(XIDeviceInfo* to, xXIAnyInfo* from, int nclasses) for (j = 0; j < cls_lib->num_buttons; j++) cls_lib->labels[j] = *atoms++; + to->classes[cls_idx++] = any_lib; break; } case XIKeyClass: @@ -1510,12 +1512,15 @@ copy_classes(XIDeviceInfo* to, xXIAnyInfo* from, int nclasses) cls_lib = next_block(&ptr_lib, sizeof(XIKeyClassInfo)); cls_wire = (xXIKeyInfo*)any_wire; + cls_lib->type = cls_wire->type; + cls_lib->sourceid = cls_wire->sourceid; cls_lib->num_keycodes = cls_wire->num_keycodes; cls_lib->keycodes = next_block(&ptr_lib, cls_lib->num_keycodes * sizeof(int)); memcpy(cls_lib->keycodes, &cls_wire[1], cls_lib->num_keycodes); + to->classes[cls_idx++] = any_lib; break; } case XIValuatorClass: @@ -1526,6 +1531,8 @@ copy_classes(XIDeviceInfo* to, xXIAnyInfo* from, int nclasses) cls_lib = next_block(&ptr_lib, sizeof(XIValuatorClassInfo)); cls_wire = (xXIValuatorInfo*)any_wire; + cls_lib->type = cls_wire->type; + cls_lib->sourceid = cls_wire->sourceid; cls_lib->number = cls_wire->number; cls_lib->label = cls_wire->label; cls_lib->resolution = cls_wire->resolution; @@ -1535,12 +1542,16 @@ copy_classes(XIDeviceInfo* to, xXIAnyInfo* from, int nclasses) /* FIXME: fractional parts */ cls_lib->mode = cls_wire->mode; + to->classes[cls_idx++] = any_lib; } break; } len += any_wire->length * 4; ptr_wire += any_wire->length * 4; } + + /* we may have skipped unknown classes, reset nclasses */ + *nclasses = cls_idx; return len; } @@ -1551,6 +1562,7 @@ wireToDeviceChangedEvent(xXIDeviceChangedEvent *in, XGenericEventCookie *cookie) XIDeviceChangedEvent *out; XIDeviceInfo info; int len; + int nclasses = in->num_classes; len = size_classes((xXIAnyInfo*)&in[1], in->num_classes); @@ -1565,13 +1577,13 @@ wireToDeviceChangedEvent(xXIDeviceChangedEvent *in, XGenericEventCookie *cookie) out->deviceid = in->deviceid; out->sourceid = in->sourceid; out->reason = in->reason; - out->num_classes = in->num_classes; out->classes = (XIAnyClassInfo**)&out[1]; info.classes = out->classes; - copy_classes(&info, (xXIAnyInfo*)&in[1], in->num_classes); + copy_classes(&info, (xXIAnyInfo*)&in[1], &nclasses); + out->num_classes = nclasses; return 1; } diff --git a/src/XIQueryDevice.c b/src/XIQueryDevice.c index 4e2f392..c22aee1 100644 --- a/src/XIQueryDevice.c +++ b/src/XIQueryDevice.c @@ -29,7 +29,7 @@ #include <X11/extensions/extutil.h> #include "XIint.h" -extern int copy_classes(XIDeviceInfo* to, xXIAnyInfo* from, int nclasses); +extern int copy_classes(XIDeviceInfo* to, xXIAnyInfo* from, int *nclasses); extern int size_classes(xXIAnyInfo* from, int nclasses); XIDeviceInfo* @@ -87,7 +87,7 @@ XIQueryDevice(Display *dpy, int deviceid, int *ndevices_return) ptr += ((wire->name_len + 3)/4) * 4; lib->classes = Xmalloc(size_classes((xXIAnyInfo*)ptr, lib->num_classes)); - ptr += copy_classes(lib, (xXIAnyInfo*)ptr, lib->num_classes); + ptr += copy_classes(lib, (xXIAnyInfo*)ptr, &lib->num_classes); } Xfree(buf); commit b6a431df65a1d98272f3c9742b2bfe2cf185d7a0 Author: Peter Hutterer <[email protected]> Date: Mon Aug 22 13:55:56 2011 +1000 man: fix typo in XIQueryDevice man page struct name is XIValuatorClassInfo. Signed-off-by: Peter Hutterer <[email protected]> (cherry picked from commit 14f674296bc23b3cd50f6d302c3064250132c2c1) diff --git a/man/XIQueryDevice.txt b/man/XIQueryDevice.txt index 2b1f76f..09da8d6 100644 --- a/man/XIQueryDevice.txt +++ b/man/XIQueryDevice.txt @@ -175,7 +175,7 @@ DESCRIPTION double value; int resolution; int mode; - } XIValuatorInfo; + } XIValuatorClassInfo; The number field specifies the number of the axis on the physical device. commit a15593744048d23e407906e34530beb5a57e3c2c Author: Peter Hutterer <[email protected]> Date: Fri Jun 24 10:09:10 2011 +1000 man: Fix formatting in XGetFeedbackControl Indent structs to make them more readable, make "Structures" header an actual header. Signed-off-by: Peter Hutterer <[email protected]> (cherry picked from commit 653b45b7cc275a560c1ea213216a908c125e443d) diff --git a/man/XGetFeedbackControl.txt b/man/XGetFeedbackControl.txt index 316f141..820ff96 100644 --- a/man/XGetFeedbackControl.txt +++ b/man/XGetFeedbackControl.txt @@ -81,6 +81,7 @@ DESCRIPTION BadValue error. Structures +~~~~~~~~~~ Each class of feedback is described by a structure specific to that class. These structures are defined in the file XInput.h. @@ -88,17 +89,16 @@ Structures contain three fields that are at the beginning of each class of feedback: - typedef struct { + typedef struct { XID class; int length; XID id; - } XFeedbackState, - XFeedbackControl; + } XFeedbackState, XFeedbackControl; The XKbdFeedbackState structure defines the attributes that are returned for feedbacks equivalent to those on the X keyboard. - typedef struct { + typedef struct { XID class; int length; XID id; @@ -109,82 +109,83 @@ Structures int led_mask; int global_auto_repeat; char auto_repeats[32]; - } XKbdFeedbackState; + } XKbdFeedbackState; The XPtrFeedbackState structure defines the attributes that are returned for feedbacks equivalent to those on the the X pointer. - typedef struct { + typedef struct { XID class; int length; XID id; int accelNum; int accelDenom; int threshold; - } XPtrFeedbackState; + } XPtrFeedbackState; The XIntegerFeedbackState structure defines attributes that are returned for integer feedbacks. - typedef struct { + typedef struct { XID class; int length; XID id; int resolution; int minVal; int maxVal; - } XIntegerFeedbackState; + } XIntegerFeedbackState; The XStringFeedbackState structure defines the attributes that are returned for string feedbacks. - typedef struct { + typedef struct { XID class; int length; XID id; int max_symbols; int num_syms_supported; KeySym *syms_supported; - } XStringFeedbackState; + } XStringFeedbackState; The XBellFeedbackState structure defines the attributes that are returned for bell feedbacks. - typedef struct { + typedef struct { XID class; int length; XID id; int percent; int pitch; int duration; - } XBellFeedbackState; + } XBellFeedbackState; The XLedFeedbackState structure defines the attributes that are returned for LED feedbacks. - typedef struct { XID class; + typedef struct { + XID class; int length; XID id; int led_values; - } XLedFeedbackState; + } XLedFeedbackState; The XPrtFeedbackControl structure defines the attributes that can be controlled for pointer feedbacks. - typedef struct { + typedef struct { XID class; int length; XID id; int accelNum; int accelDenom; int threshold; - } XPtrFeedbackControl; + } XPtrFeedbackControl; The XKbdFeedbackControl structure defines the attributes that can be controlled for keyboard feedbacks. - typedef struct { + typedef struct { XID class; int length; XID id; @@ -196,51 +197,51 @@ Structures int led_value; int key; int auto_repeat_mode; - } XKbdFeedbackControl; + } XKbdFeedbackControl; The XStringFeedbackControl structure defines the attributes that can be controlled for string feedbacks. - typedef struct { + typedef struct { XID class; int length; XID id; int num_keysyms; KeySym *syms_to_display; - } XStringFeedbackControl; + } XStringFeedbackControl; The XIntegerFeedbackControl structure defines the attributes that can be controlled for integer feedbacks. - typedef struct { + typedef struct { XID class; int length; XID id; int int_to_display; - } XIntegerFeedbackControl; + } XIntegerFeedbackControl; The XBellFeedbackControl structure defines the attributes that can be controlled for bell feedbacks. - typedef struct { + typedef struct { XID class; int length; XID id; int percent; int pitch; int duration; - } XBellFeedbackControl; + } XBellFeedbackControl; The XLedFeedbackControl structure defines the attributes that can be controlled for LED feedbacks. - typedef struct { + typedef struct { XID class; int length; XID id; int led_mask; int led_values; - } XLedFeedbackControl; + } XLedFeedbackControl; DIAGNOSTICS ----------- -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected] Archive: http://lists.debian.org/[email protected]

