forked from drath/libratbag
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 <benjamin.tissoires@gmail.com>
This commit is contained in:
committed by
Peter Hutterer
parent
e2190964c2
commit
1fab318dd3
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user