mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
hidpp20-drv: actually retrieve the current resolution value
The onboard profile do not store the current value but the default. To retrieve the current value, we need to access the switchable resolution feature. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
@@ -592,7 +592,7 @@ hidpp20drv_read_profile_8100(struct ratbag_profile *profile, unsigned int index)
|
||||
struct hidpp20drv_data *drv_data = ratbag_get_drv_data(device);
|
||||
struct ratbag_resolution *res;
|
||||
struct hidpp20_profile *p;
|
||||
unsigned i, dpi;
|
||||
unsigned i, dpi = 0;
|
||||
|
||||
hidpp20drv_read_onboard_profile(device, profile->index);
|
||||
|
||||
@@ -600,6 +600,10 @@ hidpp20drv_read_profile_8100(struct ratbag_profile *profile, unsigned int index)
|
||||
if ((int)index == hidpp20drv_current_profile(device))
|
||||
profile->is_active = true;
|
||||
|
||||
/* retrieve the resolution through 220X as the profile doesn't has it */
|
||||
if (profile->is_active)
|
||||
hidpp20drv_read_resolution_dpi(profile);
|
||||
|
||||
dpi = ratbag_resolution_get_dpi(profile->resolution.modes);
|
||||
|
||||
p = &drv_data->profiles->profiles[index];
|
||||
|
||||
Reference in New Issue
Block a user