--- mouse_plugin.c.orig 2008-03-31 09:40:40.817995467 +0200 +++ mouse_plugin.c 2008-03-31 09:40:22.164035390 +0200 @@ -172,7 +172,7 @@ { XDeviceInfo *device_info; unsigned char *buttons; - gint n_buttons, n_devices, i; + gint n_buttons, n_devices, i, j; gint idx_1 = 0, idx_3 = 1; gsize buttons_capacity = 16; @@ -211,15 +211,15 @@ n_buttons = XGetDeviceButtonMapping (GDK_DISPLAY (), device, buttons, n_buttons); } - for (i = 0; i < n_buttons; i++) + for (j = 0; j < n_buttons; j++) { - if (buttons[i] == 1) + if (buttons[j] == 1) { - idx_1 = i; + idx_1 = j; } - else if (buttons[i] == ((n_buttons < 3) ? 2 : 3)) + else if (buttons[j] == ((n_buttons < 3) ? 2 : 3)) { - idx_3 = i; + idx_3 = j; } }