Index: plugins/mouse_plugin/mouse_plugin.c =================================================================== --- plugins/mouse_plugin/mouse_plugin.c (revision 26490) +++ plugins/mouse_plugin/mouse_plugin.c (working copy) @@ -174,7 +174,7 @@ set_xinput_mouse_values (gboolean right_ unsigned char *buttons; gint n_buttons, n_devices, i; gint idx_1 = 0, idx_3 = 1; - gsize buttons_capacity = 16; + gsize buttons_capacity = DEFAULT_PTR_MAP_SIZE; device_info = XListInputDevices (GDK_DISPLAY (), &n_devices); @@ -207,7 +207,7 @@ set_xinput_mouse_values (gboolean right_ n_buttons = XGetDeviceButtonMapping (GDK_DISPLAY (), device, buttons, DEFAULT_PTR_MAP_SIZE); if (n_buttons > DEFAULT_PTR_MAP_SIZE) { - buttons = g_alloca (n_buttons); + buttons = g_realloc (buttons, n_buttons); n_buttons = XGetDeviceButtonMapping (GDK_DISPLAY (), device, buttons, n_buttons); }