Skip to content
  • Peter Hutterer's avatar
    xkbinfo: use libxkbregistry to parse the rules files for us · a980a4c8
    Peter Hutterer authored
    Version 2, this time with libxkbregistry build-time conditional, see
    4f6bec60 for the first commit, reverted in
    a8c94b74 due to
    GNOME/gnome-build-meta#329.
    
    Available in libxkbcommon 1.0.0 and later, libxkbregistry is a library wrapper
    around the evdev.xml rules file that we used to parse directly here. It
    provides a basic iteration API - load the evdev ruleset, then iterate through
    the layouts and options and copy the values over into our data structures as
    needed. This removes the need for XML parsing and error-checking, we can now
    rely on libxkbregistry to do this for us.
    
    The side-effect of this (and motivation for libxkbregistry) is that we
    automatically load user-specific XKB RMLVO as well where they are present.
    Together with mutter commit f71238732508d91bdfcb581c84697a516499a1eb this
    allows a user to drop up their custom XKB layouts in
    $XDG_CONFIG_DIR/xkb and have them both listed in the GUIs and working.
    
    See original MR at
    GNOME/gnome-desktop!79
    
    GNOME/gnome-desktop!88
    a980a4c8