mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 22:41:43 +00:00
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.
This commit is contained in:
parent
e7d84898ee
commit
b8a86e6ca4
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user