1
0
forked from drath/libratbag

fix button count and default report rate always zero

This commit is contained in:
Ilya Guterman
2021-10-17 11:12:07 +03:00
committed by Ilya guterman
parent fa95abbc33
commit a55297e0fa
2 changed files with 6 additions and 1 deletions

View File

@@ -1096,6 +1096,7 @@ hidpp20drv_read_special_key_mouse(struct ratbag_device *device)
drv_data->controls = NULL;
drv_data->num_controls = 0;
rc = hidpp20_special_key_mouse_get_controls(drv_data->dev, &drv_data->controls);
log_raw(device->ratbag, "num_control %d\n", rc);
if (rc > 0) {
drv_data->num_controls = rc;
rc = 0;
@@ -1646,7 +1647,9 @@ hidpp20drv_init_device(struct ratbag_device *device,
if (num >= 0)
drv_data->num_buttons = num;
drv_data->report_rates[0] = ratbag_device_data_hidpp20_get_report_rate(device->data);;
num = ratbag_device_data_hidpp20_get_report_rate(device->data);
if (num >= 0)
drv_data->report_rates[0] = num;
ratbag_device_init_profiles(device,
drv_data->num_profiles,

View File

@@ -165,8 +165,10 @@ init_data_hidpp20(struct ratbag *ratbag,
int num;
char *str;
data->hidpp20.button_count = -1;
data->hidpp20.index = -1;
data->hidpp20.led_count = -1;
data->hidpp20.report_rate = -1;
num = g_key_file_get_integer(keyfile, group, "Buttons", &error);
if (num > 0 || !error)