From f0b69aab19d7848f592f6537781ae78e18845816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Wed, 29 Jan 2020 19:30:12 +0000 Subject: [PATCH] hidpp20: only set active resolution if there are resolutions on 0x8100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prevents us from trying to set a resolution on keyboards. Signed-off-by: Filipe LaĆ­ns --- src/driver-hidpp20.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/driver-hidpp20.c b/src/driver-hidpp20.c index 759b2e10..454d0425 100644 --- a/src/driver-hidpp20.c +++ b/src/driver-hidpp20.c @@ -1482,7 +1482,6 @@ hidpp20drv_commit(struct ratbag_device *device) struct ratbag_led *led; struct ratbag_resolution *resolution; int rc; - unsigned int dpi_index = 0; list_for_each(profile, &device->profiles, link) { if (!profile->dirty) @@ -1544,10 +1543,9 @@ hidpp20drv_commit(struct ratbag_device *device) if (profile->is_active) { ratbag_profile_for_each_resolution(profile, resolution) { if (resolution->is_active) - dpi_index = resolution->index; + hidpp20_onboard_profiles_set_current_dpi_index(drv_data->dev, + resolution->index); } - hidpp20_onboard_profiles_set_current_dpi_index(drv_data->dev, - dpi_index); } } }