diff --git a/src/driver-etekcity.c b/src/driver-etekcity.c index eca68c3e..dbbe378c 100644 --- a/src/driver-etekcity.c +++ b/src/driver-etekcity.c @@ -744,7 +744,6 @@ struct ratbag_driver etekcity_driver = { .remove = etekcity_remove, .read_profile = etekcity_read_profile, .write_profile = etekcity_write_profile, - .get_active_profile = etekcity_current_profile, .set_active_profile = etekcity_set_current_profile, .has_capability = etekcity_has_capability, .read_button = etekcity_read_button, diff --git a/src/driver-hidpp10.c b/src/driver-hidpp10.c index 3ae71786..288bc10e 100644 --- a/src/driver-hidpp10.c +++ b/src/driver-hidpp10.c @@ -104,22 +104,6 @@ hidpp10drv_has_capability(const struct ratbag_device *device, enum ratbag_capabi return 0; } -static int -hidpp10drv_current_profile(struct ratbag_device *device) -{ - struct hidpp10drv_data *drv_data; - struct hidpp10_device *hidpp10; - int8_t profile; - int rc; - - drv_data = ratbag_get_drv_data(device); - hidpp10 = drv_data->dev; - - rc = hidpp10_get_current_profile(hidpp10, &profile); - - return rc >= 0 ? profile : rc; -} - static int hidpp10drv_set_current_profile(struct ratbag_device *device, unsigned int index) { @@ -284,7 +268,6 @@ struct ratbag_driver hidpp10_driver = { .remove = hidpp10drv_remove, .read_profile = hidpp10drv_read_profile, .write_profile = hidpp10drv_write_profile, - .get_active_profile = hidpp10drv_current_profile, .set_active_profile = hidpp10drv_set_current_profile, .has_capability = hidpp10drv_has_capability, .read_button = hidpp10drv_read_button, diff --git a/src/driver-hidpp20.c b/src/driver-hidpp20.c index c3a3eada..357cccb4 100644 --- a/src/driver-hidpp20.c +++ b/src/driver-hidpp20.c @@ -313,6 +313,10 @@ hidpp20drv_read_profile(struct ratbag_profile *profile, unsigned int index) hidpp20drv_read_resolution_dpi(profile); hidpp20drv_read_special_key_mouse(device); + + profile->is_active = false; + if ((int)index == hidpp20drv_current_profile(device)) + profile->is_active = true; } static int @@ -496,7 +500,6 @@ struct ratbag_driver hidpp20_driver = { .remove = hidpp20drv_remove, .read_profile = hidpp20drv_read_profile, .write_profile = hidpp20drv_write_profile, - .get_active_profile = hidpp20drv_current_profile, .set_active_profile = hidpp20drv_set_current_profile, .has_capability = hidpp20drv_has_capability, .read_button = hidpp20drv_read_button, diff --git a/src/libratbag-private.h b/src/libratbag-private.h index 3aa0699d..f14a02f9 100644 --- a/src/libratbag-private.h +++ b/src/libratbag-private.h @@ -119,13 +119,6 @@ struct ratbag_driver { */ int (*write_profile)(struct ratbag_profile *profile); - /** called when the user of libratbag wants to know which - * current profile is in use. - * - * It is fundamentally racy. - */ - int (*get_active_profile)(struct ratbag_device *device); - /** called to mark a previously writen profile as active. * * There should be no need to write the profile here, a