libxkbcommon/xkbcommon
Ran Benita 60bd92021b keymap: wrap the layout parameter if it is out of range for the key
The functions num_levels_for_key() and get_syms_by_level() have a
'layout' parameter. Currently it is expected that this value is always
legal for the key, as determined by num_layouts_for_key(). However,
there are legitimate use cases for passing an out-of-range layout there,
most probably passing the effective layout, and expecting to get the
keysyms/levels for just this layout. So we wrap it just as we do in the
xkb_state_* functions.

This is also useful for stuff like this:
http://developer.gnome.org/gdk/stable/gdk-Keyboard-Handling.html#gdk-keymap-lookup-key

If this behavior is not desired, the user has the option to check
against num_layouts_for_key herself.

https://bugs.freedesktop.org/show_bug.cgi?id=56866

Reported-by: Gatis Paeglis <gatis.paeglis@digia.com>
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-11-11 00:32:16 +02:00
..
xkbcommon-compat.h Split the mods, layout, leds parts of xkb_state_components 2012-10-22 21:48:40 +02:00
xkbcommon-keysyms.h xkbcommon-keysyms: Add header protection 2012-09-11 16:49:04 +01:00
xkbcommon-names.h Improve API doxygen documentation 2012-09-24 09:13:32 +10:00
xkbcommon.h keymap: wrap the layout parameter if it is out of range for the key 2012-11-11 00:32:16 +02:00