From 1fab318dd303b806152df8c0cc4e70601ed0f579 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Mon, 23 Oct 2017 10:57:04 +0200 Subject: [PATCH] hidpp20-drv: fix number of buttons for non-profiles mice This was nasty. We correctly set the number of buttons but rely later on the field set in drv_data. Signed-off-by: Benjamin Tissoires --- src/driver-hidpp20.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/driver-hidpp20.c b/src/driver-hidpp20.c index 68e7fbc4..146305e8 100644 --- a/src/driver-hidpp20.c +++ b/src/driver-hidpp20.c @@ -1052,7 +1052,7 @@ hidpp20drv_init_feature(struct ratbag_device *device, uint16_t feature) /* we read the profile once to get the correct number of * supported buttons. */ if (!hidpp20drv_read_special_key_mouse(device)) - device->num_buttons = drv_data->num_controls; + drv_data->num_buttons = drv_data->num_controls; break; } case HIDPP_PAGE_BATTERY_LEVEL_STATUS: { @@ -1077,7 +1077,7 @@ hidpp20drv_init_feature(struct ratbag_device *device, uint16_t feature) /* we read the profile once to get the correct number of * supported buttons. */ if (!hidpp20drv_read_kbd_reprogrammable_key(device)) - device->num_buttons = drv_data->num_controls; + drv_data->num_buttons = drv_data->num_controls; break; } case HIDPP_PAGE_ADJUSTABLE_REPORT_RATE: {