evdev: Don't oveflow when translating buttons to masks

An array is used to translate the button to its mask. Clutter defines
the masks for button 1 to 5 but we report BTN_LEFT..BTN_TASK ie
0x110..0x117. We need to pad the array for the translation not to access
random data for buttons between 0x115 and 0x117.
This commit is contained in:
Damien Lespiau 2010-11-19 14:19:52 -05:00
parent ac431ac21d
commit bce4c87232

View File

@ -219,10 +219,10 @@ notify_button (ClutterEventSource *source,
ClutterEvent *event;
ClutterActor *stage;
gint button_nr;
static gint maskmap[5] =
static gint maskmap[8] =
{
CLUTTER_BUTTON1_MASK, CLUTTER_BUTTON2_MASK, CLUTTER_BUTTON3_MASK,
CLUTTER_BUTTON4_MASK, CLUTTER_BUTTON5_MASK
CLUTTER_BUTTON4_MASK, CLUTTER_BUTTON5_MASK, 0, 0, 0
};
stage = clutter_stage_get_default ();