Skip to content

Add version query method (xkb_get_version) #932

@Caellian

Description

@Caellian

There's currently no way to use multiple versions of libxkbcommon with standard dynamic linking. You're forced to use dlopen if you're going to support both Arch (on version 1.13.0 atm) and Ubuntu (on version 1.7.0).

This is very inconvenient because now you're forced to manually load all the symbols and check whether they exist to figure out which version you're on. There's versions that don't differ in exposed symbols though, so you're actually supposed to query the system package database (?) to deal with breaking changes. Or just assume you don't have access to functionality newer than 1.7.0.

In my case (Rust bindings) I want to bind xkb_keymap_new_from_names2, but return a VersionNotSupported error if the specified format is too new and fall back on xkb_keymap_new_from_names.

Solution

Provide a global xkb_get_version function that returns a pointer to a static version triplet (e.g. [uint8; 3]) which would allow the libraries to query the installed version of the library on the system and change some logic based on that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    compile-keymapIndicates a need for improvements or additions to keymap compilation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions