From 28438e638b7c3ff39728b3ba734d404381aff502 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Tue, 10 May 2016 11:35:17 +0200 Subject: [PATCH] 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 --- src/driver-hidpp20.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/driver-hidpp20.c b/src/driver-hidpp20.c index 62bbeb3a..2ff5e6bb 100644 --- a/src/driver-hidpp20.c +++ b/src/driver-hidpp20.c @@ -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];