Skip to content

kbd preview: don't fall over unfortunate arg combos

as it turns out it's fairly easy to fail the original xkb assert when using variants with certain models that don't actually sport support for the variants

e.g. --model applealu_iso --layout gb --variant mac_intl

to deal with this we no longer assume that geometry compilation will actually work and instead switch the qml ui into an error state when problems appear. furthermore we'll run the arg combination through setxkbmap|xkbcomp to get a sense of why the server might have failed to compile the geometry and use that as detailed error output

I need to point out that the preview failing doesn't necessarily mean the layout application as a whole will because there's different code paths the kcm and the kded will take to apply layouts so depending on which path is taken the configuration may be partially applied or not at all (e.g. with the scenario from above the end result may be that model doesn't get applied but the layout and variant will)

since these changes required some rejiggering of the pointers and their life times this has also seen some related cleanup. notably the geometry is now in charge of the life time of the root xkb object and the previous qsharedpointer cleanup (which was really scoped pointer cleanup but scoped pointer has kinda sad api for custom deleters) is now instead a unique_ptr with custom deleter.

Merge request reports