From 3875bb70fd5407990dd391aa1dd1fb81ef818285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Fri, 3 Jan 2020 19:56:26 +0000 Subject: [PATCH] hidpp20: implement dirty flag for report rate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe LaĆ­ns --- src/driver-hidpp20.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/driver-hidpp20.c b/src/driver-hidpp20.c index 28da82be..5f973a4a 100644 --- a/src/driver-hidpp20.c +++ b/src/driver-hidpp20.c @@ -1422,9 +1422,11 @@ hidpp20drv_commit(struct ratbag_device *device) if (!profile->dirty) continue; - rc = hidpp20drv_update_report_rate(profile, profile->hz); - if (rc) - return RATBAG_ERROR_DEVICE; + if (profile->rate_dirty) { + rc = hidpp20drv_update_report_rate(profile, profile->hz); + if (rc) + return RATBAG_ERROR_DEVICE; + } ratbag_profile_for_each_resolution(profile, resolution) { if (resolution->is_active) {