[mutter/wip/carlosg/modifier-query-x11: 2/2] backends/x11: Iterate button modifiers all the way




commit fc6446f32649dfdffbcd8fff6ebe35122e5648f3
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Nov 30 19:02:28 2020 +0100

    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>

 src/backends/x11/meta-seat-x11.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/backends/x11/meta-seat-x11.c b/src/backends/x11/meta-seat-x11.c
index e320a1e4c8..a1d1cc5e10 100644
--- a/src/backends/x11/meta-seat-x11.c
+++ b/src/backends/x11/meta-seat-x11.c
@@ -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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]