[Xcb] RFC: API break in xinput

Daniel Martin consume.noise at gmail.com
Tue Jan 8 01:04:44 PST 2013


On Tue, Jan 08, 2013 at 09:35:11AM +0100, Uli Schlachter wrote:
> Hi,
> 
> On 08.01.2013 09:20, Michael Stapelberg wrote:
> [...]
> >>In XI2 events are not prefixed and there's a FocusIn/Out too. But,
> >>that's due to a mistake as the "old" FocusIn/Out events we currently
> >>have should have been called DeviceFocusIn/Out:
> >>   http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n2361
> >>Here I realy would like to rename the "old" events, give them their
> >>proper names and therefor _break the api_.
> >I think that’s okay, given that the fix to compile with both old and new
> >xcb looks like this:
> >
> >/* just as an example, not sure which version this will be and how the
> >    variable is called */
> >#if XCB_MAJOR_VERSION < 5
> >#define xcb_input_device_focus_in_event_t xcb_input_focus_in_event_t
> >#endif
> 
> Shouldn't this be a check on the version of xcb/proto that libxcb
> was built with? After all, one can (often) use newer libxcb with
> older versions of the protocol descriptions.
> 
> The only way I know for getting this information is:
> 
>  $ pkg-config --variable xcbproto_version xcb
>  1.8
> 
> So this information cannot easily be accessed by the C preprocessor.

One could check XCB_INPUT_MAJOR_VERSION, as the change to the name
should be applied before merging the XI2 stuff and therefor bumping the
major version to 2. And XCB_INPUT_MAJOR_VERSION is generated from the
proto regardless of the libxcb version.


More information about the Xcb mailing list