[Xcb] [PATCH] XKB: Fix broken events

Josh Triplett josh at joshtriplett.org
Thu Jun 21 10:56:57 PDT 2012


On Thu, Jun 21, 2012 at 12:40:02PM +0100, Daniel Stone wrote:
> XKB events all have exactly the same event number - 0 (from the XKB
> event base).  Within this, they're all multiplexed by the xkbType field,
> which comes immediately after the event type field, before the sequence
> number.  Without this field, the events are pretty much useless, so add
> it manually.
> 
> Signed-off-by: Daniel Stone <daniel at fooishbar.org>
> ---
>  src/xkb.xml |   48 ++++++++++++++++++++++++++++++++++++------------
>  1 file changed, 36 insertions(+), 12 deletions(-)
> 
> diff --git a/src/xkb.xml b/src/xkb.xml
> index e8f4c02..a6ef374 100644
> --- a/src/xkb.xml
> +++ b/src/xkb.xml
> @@ -2593,7 +2593,9 @@ authorization from the authors.
>  
>  	<!-- Events -->
>  
> -	<event name="NewKeyboardNotify" number="0">
> +	<event name="NewKeyboardNotify" number="0" no-sequence-number="true">
> +		<field name="xkbType" type="CARD8" />
> +		<field name="sequence" type="CARD16" />

This seems wrong.  Filling in the byte before the sequence number
shouldn't require using no-sequence-number.  Among other things,
no-sequence-number implies that XCB can't use the event for
sequence synchronization; just because you filled in a field named
"sequence" in the right place doesn't mean that it has the semantics of
a sequence number.

(Right now, at least, libxcb just internally hardcodes the event numbers
from which it can't use the sequence number; however, I can easily
imagine a library or other decoder getting that data from the XML
instead.)

- Josh Triplett


More information about the Xcb mailing list