diff options
author | Matthias Clasen <mclasen@redhat.com> | 2016-03-26 18:48:27 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2016-03-26 18:48:27 -0400 |
commit | 59d8cba48229f03ab7657ae3258174f1cd6d41fd (patch) | |
tree | b8b0c058040c76d006848409ab3ac17c09b5871d /gdk/wayland/gdkkeys-wayland.c | |
parent | 7249897dc80f5dbe8c03885b1b103f1fe93c75f2 (diff) | |
download | gtk+-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.c | 5 |
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); |