backends/x11: Iterate button modifiers all the way

This is misuse of XIMaskLen (on a mask len! not the right mask!).
Have this iterate all possible values stored in the button state.

Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1559
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1617>
This commit is contained in:
Carlos Garnacho 2020-11-30 19:02:28 +01:00
parent 6aafdbebd9
commit fc6446f326

View File

@ -1506,7 +1506,7 @@ translate_state (XIButtonState *button_state,
if (button_state)
{
for (i = 1; i < XIMaskLen (button_state->mask_len); i++)
for (i = 1; i <= button_state->mask_len * 8; i++)
{
if (!XIMaskIsSet (button_state->mask, i))
continue;