summaryrefslogtreecommitdiff
path: root/gdk/wayland/gdkkeys-wayland.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2016-03-26 18:48:27 -0400
committerMatthias Clasen <mclasen@redhat.com>2016-03-26 18:48:27 -0400
commit59d8cba48229f03ab7657ae3258174f1cd6d41fd (patch)
treeb8b0c058040c76d006848409ab3ac17c09b5871d /gdk/wayland/gdkkeys-wayland.c
parent7249897dc80f5dbe8c03885b1b103f1fe93c75f2 (diff)
downloadgtk+-59d8cba48229f03ab7657ae3258174f1cd6d41fd.tar.gz
wayland: Get min/max keycode from xkb keymap
Instead of hardcoding 8/255 here.
Diffstat (limited to 'gdk/wayland/gdkkeys-wayland.c')
-rw-r--r--gdk/wayland/gdkkeys-wayland.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdk/wayland/gdkkeys-wayland.c b/gdk/wayland/gdkkeys-wayland.c
index 4819ab69d5..46d2631046 100644
--- a/gdk/wayland/gdkkeys-wayland.c
+++ b/gdk/wayland/gdkkeys-wayland.c
@@ -133,10 +133,13 @@ gdk_wayland_keymap_get_entries_for_keyval (GdkKeymap *keymap,
struct xkb_keymap *xkb_keymap = GDK_WAYLAND_KEYMAP (keymap)->xkb_keymap;
GArray *retval;
guint keycode;
+ xkb_keycode_t min_keycode, max_keycode;
retval = g_array_new (FALSE, FALSE, sizeof (GdkKeymapKey));
- for (keycode = 8; keycode < 255; keycode++) /* FIXME: min/max keycode */
+ min_keycode = xkb_keymap_min_keycode (xkb_keymap);
+ max_keycode = xkb_keymap_max_keycode (xkb_keymap);
+ for (keycode = min_keycode; keycode < max_keycode; keycode++)
{
gint num_layouts, layout;
num_layouts = xkb_keymap_num_layouts_for_key (xkb_keymap, keycode);