diff options
author | Matthias Clasen <mclasen@redhat.com> | 2016-04-19 12:43:03 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2016-04-19 12:43:03 -0400 |
commit | b8a86e6ca4fd3cf64ae0c2d014b4355dc9315146 (patch) | |
tree | 3510e643cddebecdef7efcb1e3daa876fe6c7624 /gdk/wayland/gdkkeys-wayland.c | |
parent | e7d84898ee65100b8ffe905cbcc4b878b7e67e10 (diff) | |
download | gtk+-b8a86e6ca4fd3cf64ae0c2d014b4355dc9315146.tar.gz |
wayland: Some more debug spew
Print the modifiers and their mapping out as well. This
information is contained in the keymap, but this is a bit
easier to digest.
Diffstat (limited to 'gdk/wayland/gdkkeys-wayland.c')
-rw-r--r-- | gdk/wayland/gdkkeys-wayland.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/gdk/wayland/gdkkeys-wayland.c b/gdk/wayland/gdkkeys-wayland.c index a4f39d33d5..086e4de956 100644 --- a/gdk/wayland/gdkkeys-wayland.c +++ b/gdk/wayland/gdkkeys-wayland.c @@ -552,6 +552,46 @@ _gdk_wayland_keymap_new (void) return GDK_KEYMAP (keymap); } +#ifdef G_ENABLE_DEBUG +static void +print_modifiers (struct xkb_keymap *keymap) +{ + int i, j; + uint32_t real; + struct xkb_state *state; + + g_print ("modifiers:\n"); + for (i = 0; i < xkb_keymap_num_mods (keymap); i++) + g_print ("%s ", xkb_keymap_mod_get_name (keymap, i)); + g_print ("\n\n"); + + g_print ("modifier mapping\n"); + state = xkb_state_new (keymap); + for (i = 0; i < 8; i++) + { + gboolean need_arrow = TRUE; + g_print ("%s ", xkb_keymap_mod_get_name (keymap, i)); + for (j = 8; j < xkb_keymap_num_mods (keymap); j++) + { + xkb_state_update_mask (state, 1 << j, 0, 0, 0, 0, 0); + real = xkb_state_serialize_mods (state, XKB_STATE_MODS_EFFECTIVE); + if (real & (1 << i)) + { + if (need_arrow) + { + g_print ("-> "); + need_arrow = FALSE; + } + g_print ("%s ", xkb_keymap_mod_get_name (keymap, j)); + } + } + g_print ("\n"); + } + + xkb_state_unref (state); +} +#endif + void _gdk_wayland_keymap_update_from_fd (GdkKeymap *keymap, uint32_t format, @@ -585,6 +625,8 @@ _gdk_wayland_keymap_update_from_fd (GdkKeymap *keymap, return; } + GDK_NOTE(INPUT, print_modifiers (xkb_keymap)); + xkb_keymap_unref (keymap_wayland->xkb_keymap); keymap_wayland->xkb_keymap = xkb_keymap; |